URL Encode & Decode

Percent-encode text for use in a URL, or decode %XX sequences back to readable text. Choose between encoding a single component and a whole URL.

Loading tool…

About the URL Encode/Decode

URLs may only contain a limited set of ASCII characters (RFC 3986). Anything else is percent-encoded: each UTF-8 byte becomes % plus two hex digits, so a space is %20 and é is %C3%A9.

Component mode matches encodeURIComponent and additionally escapes ! ' ( ) * for strict RFC 3986 output. Use it for a single query value or path segment: it encodes / ? & = # too, so a value like a&b cannot break the query string. Full URL mode matches encodeURI, leaving the URL's structure (:/?#&=) intact and only escaping spaces and non-ASCII characters.

HTML forms submitted as application/x-www-form-urlencoded write spaces as +. Tick “Space as +” to produce or read that format; PHP's urlencode and Python's quote_plus behave the same way. Decoding reports malformed sequences such as %E0%A4 (an incomplete UTF-8 character) instead of silently producing garbage.

How to use it

  1. Select Encode or Decode.
  2. Pick Component for a single value, or Full URL for a complete address.
  3. Tick “Space as +” for form-encoded data.
  4. Copy the output or press ⇄ Swap to reverse it.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI keeps characters that have meaning in a URL (: / ? # & =), so it is for whole URLs. encodeURIComponent escapes them as well, so it is for values you insert into a URL.
Should a space be %20 or +?
%20 is valid everywhere. + means a space only in query strings using the form encoding (application/x-www-form-urlencoded). In a path, + is a literal plus sign.
Why do I get “URI malformed” when decoding?
A % is not followed by two hex digits, or the bytes do not form valid UTF-8 — often because the text was encoded in Latin-1 or was cut off.
Do I need to encode a URL twice?
No. Double encoding turns %20 into %2520. Encode each value once when you build the URL.

Related tools