Encoding, decoding and parsing
Choose Encode (component) for a single value that goes inside a link, for example a search phrase or a redirect address. Choose Encode full URL when you have a complete address and only want unsafe characters fixed. Decode turns percent codes back into text. Parse query string lists each parameter as a key and value, which is handy when you debug a long tracking link.
Tips
- Encode each value separately and then join them with & and =. Encoding the whole query string would also encode those separators.
- Do not encode twice. If you see %2520, the text was encoded two times.
- Need to hide data in a URL? Encoding is not secret. For binary text use the Base64 tool.
Frequently asked questions
What is URL encoding?
Web addresses can only contain a limited set of characters. Everything else, such as spaces, accents or symbols, is written as a percent sign and two hex digits. A space becomes %20 and an é becomes %C3%A9.
What is the difference between component and full URL encoding?
Component encoding (encodeURIComponent) escapes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for a single value such as a search term. Full URL encoding (encodeURI) keeps characters like : / ? & = # so a whole address stays working.
Why do I see + instead of %20?
HTML forms write spaces as a plus sign in query strings. When decoding, keep the plus option switched on to turn + back into a space.
Why does decoding fail?
A percent sign must be followed by two hex digits, and the bytes must form valid UTF-8. A stray % or a cut-off sequence such as %E0%A4 causes a malformed error.
Is the text sent anywhere?
No. Encoding and decoding use your browser's built-in functions on your own device.