How to URL-encode or decode text
- Choose Encode or Decode.
- Type or paste your text. The result appears as you type.
- If you paste a full web address, its parts and query parameters are listed in a table, already decoded.
What is URL encoding?
URLs can only contain a limited set of characters. Spaces, accented letters, non-Latin scripts and symbols such as &, ? and # must be written as a percent sign followed by hexadecimal byte values. This is called percent-encoding. For example, a space becomes %20 and “café” becomes caf%C3%A9 (the é is two bytes in UTF-8).
Which option should I use?
- Default (encodeURIComponent) – for a single value you put inside a URL, such as a search term or a parameter value. It encodes everything except letters, digits and
- _ . ! ~ * ' ( ). - Encode a whole URL (encodeURI) – for a complete address with non-ASCII characters. It keeps the characters that give a URL its structure.
- Spaces as + – the format used by HTML forms (
application/x-www-form-urlencoded).
FAQ
Why do I get an error when decoding?
The text contains a % that is not followed by two hexadecimal digits, or a multi-byte character was cut in half. Check that you copied the whole URL.