URL encoder / decoder
URLs may only contain certain characters — spaces, non-ASCII text, & or ? break them. URL encoding turns those into %XX form so the URL is transmitted and parsed correctly. This tool switches between encoding and decoding in one click.
How to use
- To encode: paste text or a parameter with special characters and click Encode.
- To decode: paste a %XX string and click Decode to restore it.
- To encode a whole URL instead of one parameter, tick the option to use encodeURI.
Common use cases
- Build query strings with non-ASCII or special characters.
- Read an encoded URL copied from the address bar.
- Debug parameter encoding in API requests.
Encode the value, not the whole URL
Two everyday jobs: packing a query parameter that contains spaces, Chinese characters, & or ? into a URL — a search term or an API argument, say — and decoding a long %E4%B8%AD… string from a log back into readable text. The classic trap is scope: you should only encode the value of each parameter, not the entire URL.
- Feed a whole address in and you'll encode the ://, ? and = as well, which breaks the link.
- Encode something that's already encoded and you get double encoding — % turns into %25, and the far end decodes to garbage.
Encode each parameter value on its own, then stitch the URL back together with & and =.
Which characters get replaced, and which do not?
The actual output of this page draws the line best. hello world → hello%20world, a+b=c → a%2Bb%3Dc, 100% → 100%25, ?q=x&r=y → %3Fq%3Dx%26r%3Dy. But ~_.- comes back untouched: those four are unreserved, and a correct encoder must leave them alone. Note that the plus sign itself becomes %2B — left as-is, any decoder that reads + as a space would silently corrupt the value.