What is URL encoding?
URLs may only contain a limited set of characters. Spaces, accented letters, emoji and symbols with special meaning, such as &, ?, # and /, have to be written as percent-encoded bytes: a % sign followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26, and “é” becomes %C3%A9 because it takes two bytes in UTF-8. URL decoding reverses the process so you can read what a link really contains.
Encode component vs. encode full URL
- Encode component uses
encodeURIComponent. It escapes everything except letters, digits and- _ . ! ~ * ' ( ), including/ ? & = #. Use it for a single value you are putting into a query string, like a search term or a redirect address. - Encode full URL uses
encodeURI. It leaves the characters that give a URL its structure alone (: / ? & = #) and only escapes spaces, non-ASCII characters and other unsafe symbols. Use it to clean up a whole link that has spaces or accented letters in it.
A common bug is encoding a whole URL with the component method, which turns https:// into https%3A%2F%2F. Another is decoding twice, which can break values that genuinely contain a percent sign. If the output still contains sequences like %2520, the text was probably encoded twice, and the tool will point it out.
Plus signs, spaces and broken sequences
HTML forms and many search engines write spaces as + in query strings (the application/x-www-form-urlencoded format). With “Treat + as a space” on, the decoder converts them to spaces, and in Encode component mode spaces are written as + instead of %20. Turn it off when a plus sign should stay a plus, such as in a path or a phone number.
If the input contains a % that is not followed by two hex digits, or bytes that do not form valid UTF-8, a plain decoder just fails. This tool tells you exactly which sequence is malformed and where it is, so you can fix it.
Reading query strings
When the input contains a query string, every key=value pair is listed in a table with the value decoded, which makes long tracking links and API calls much easier to inspect. To build tagged campaign links from scratch, use the UTM link builder. For other encodings, try Base64 encode and decode, tidy API responses with the JSON formatter, or make readable URL paths with the text to slug converter. Everything runs in your browser, so private links are never uploaded.