URL encoding explained: encode and decode query strings safely
Spaces, ampersands and non-English letters cannot sit raw inside a web address. They are replaced with a percent sign and two hex digits, such as %20 for a space. URL encode/decode does this for you.
Steps
- Paste your text or URL.
- Choose the Action: encode a component, encode a whole URI, or decode.
- Copy the result.
Component or whole URI?
- Component encodes almost everything special:
a b&cbecomesa%20b%26c. Use it for a value that goes into a query string. - Whole URI keeps the structure characters such as
:,/,?and=and only encodes unsafe ones:https://x.com/a b?q=1becomeshttps://x.com/a%20b?q=1.
Encoding a whole URL as a component would break it, because the slashes and colons would be encoded too.
Decoding
Decoding turns %20 back into spaces and %E0%A4%A8 into Unicode characters. A broken sequence, such as a lone %E0%A4%A, gives an error message instead of garbage.
Tips
- Encode each value separately, then join with
&. - Double encoding (
%2520) means something was encoded twice; decode once and check. - Keep
+in mind: in forms it can mean a space, but in a path it is a literal plus.