Home Other URL Encode / Decode

URL Encode / Decode

Calculate your Percent-encoding tool in seconds with the free URL Encode / Decode. No registration needed.

Input

Output

ADVERTISEMENT

What is a URL Encode / Decode Calculator?

A URL Encode / Decode calculator converts special characters in URLs to percent-encoded format and vice versa. It replaces unsafe ASCII characters with a % followed by two hexadecimal digits, ensuring data transmits safely over the internet. This tool supports both Component mode (encodeURIComponent) for individual query parameters and Full URL mode (encodeURI) for entire addresses.

How to calculate URL encoding manually (the formula)

Percent encoding follows a simple pattern: each character is converted to its ASCII code in hexadecimal, then prefixed with %. For example, a space (ASCII 32 decimal = 20 hex) becomes %20. The formula is %XX where XX is the two-digit hex value of the byte. For non-ASCII characters like é (e with acute), the UTF-8 bytes are encoded individually — é becomes %C3%A9.

Example calculation

Take the string hello world!. In Component mode: hello%20world%21. The space becomes %20 and the exclamation mark becomes %21. In Full URL mode, https://example.com/search?q=hello world becomes https://example.com/search?q=hello%20world. Notice Full URL mode preserves the colon, slashes, and question mark while encoding only the unsafe characters.

Common mistakes

  • Double encoding — Encoding an already-encoded string turns %20 into %2520. Always decode first before re-encoding.
  • Encoding the whole URL in Component mode — Component mode encodes the colon, slashes, and other URL structure characters, breaking the URL.
  • Confusing %20 with + — In query strings the + sign represents a space in form encoding, but %20 is the proper universal percent-encoded form.

Frequently asked questions

What is percent encoding in a URL?

Percent encoding replaces special characters with % followed by two hex digits so that data can be safely transmitted in URLs.

How do I decode a percent-encoded URL?

Use decodeURIComponent() for individual parameters or decodeURI() for full URLs.

What characters need to be encoded?

Reserved characters like :, /, ?, #, [, ], @, !, $, &, ', (, ), *, +, ,, ;, =, and space.

What is the difference between Component and Full URL mode?

Component mode encodes/decodes using encodeURIComponent/decodeURIComponent rules; Full URL mode uses encodeURI/decodeURI.

Why does my URL have %20 instead of spaces?

Spaces are not allowed in URLs and are encoded as %20 (or + in query strings).

Is URL encoding reversible?

Yes, decoding a percent-encoded string returns the original text perfectly.