URL Encoder/Decoder

Encode or decode URL strings using encodeURIComponent or encodeURI. Copy results to clipboard.

Uses encodeURIComponent — encodes all special characters (for query params, fragments, etc.)

URL Encoder/Decoder

A URL encoder converts characters that are not allowed in web addresses into a safe format called percent-encoding, defined by RFC 3986. Characters such as spaces, ampersands, question marks, and non-ASCII letters can break a URL or change its meaning, so they are replaced with a percent sign followed by their hexadecimal byte value — a space becomes %20, and 'ç' becomes %C3%A7 in UTF-8. This tool encodes and decodes strings instantly in your browser.

Choosing between encodeURIComponent and encodeURI matters. encodeURIComponent escapes every reserved character, making it the right choice for individual query-string values, form data, and path segments. encodeURI preserves characters that structure a URL — such as :, /, ?, and & — so it is suited for encoding a complete address without breaking it. Decoding reverses the process, translating percent-encoded sequences back into readable text, which is useful for inspecting analytics parameters, API requests, and shared links.

How it works

Percent-encoding works by converting each unsafe character to its UTF-8 byte sequence, then representing each byte as % followed by two hexadecimal digits. For example, the space character (byte 0x20) becomes %20 and 'é' (UTF-8 bytes 0xC3 0xA9) becomes %C3%A9. encodeURIComponent escapes everything except A-Z, a-z, 0-9 and - _ . ! ~ * ' ( ), while encodeURI additionally preserves the reserved delimiters ; , / ? : @ & = + $ #. Decoding parses each %XX sequence back to its byte and reassembles the UTF-8 text.

Use cases

  • Encoding query-string parameters that contain spaces, accents, or symbols before adding them to a URL
  • Decoding tracking links and UTM parameters to inspect what data they carry
  • Preparing API request URLs where user input must be safely embedded
  • Debugging broken links caused by double encoding or unescaped special characters

Frequently asked questions

What is URL encoding and why is it needed?

URL encoding, also called percent-encoding, replaces characters that are unsafe or reserved in URLs with a % sign followed by their hexadecimal byte value, as defined in RFC 3986. It is needed because URLs can only contain a limited set of ASCII characters, and symbols like &, ?, and = have special structural meanings. Encoding ensures that user data such as search terms or names travels through a URL without breaking it.

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent escapes all reserved characters, including / ? & = and :, so it should be used for individual values like query parameters. encodeURI leaves those structural delimiters intact, making it appropriate for encoding an entire URL. Using the wrong one can either break a full URL or leave a parameter value ambiguous.

Why does a space become %20 in a URL?

The space character has the ASCII/UTF-8 byte value 0x20, and percent-encoding represents each byte as % followed by two hexadecimal digits, producing %20. In the older application/x-www-form-urlencoded format used by HTML forms, spaces may also appear as a plus sign (+), which is why you sometimes see both representations.

How do I decode a URL with %C3%A9 or similar codes?

Sequences like %C3%A9 are UTF-8 multi-byte characters that have been percent-encoded — in this case the letter 'é'. Paste the string into a URL decoder and it will convert each %XX pair back into its byte, then interpret the bytes as UTF-8 text. This tool performs the decoding instantly in your browser without sending data to any server.

Can double encoding break my URLs?

Yes. If an already-encoded string is encoded again, the % signs themselves get escaped to %25, so %20 becomes %2520 and the URL no longer decodes to the original text. This commonly happens when multiple systems each encode a value. To fix it, decode the string repeatedly until no %25 sequences remain, then encode it exactly once.

Related Calculators