When to use it
Putting Unicode, spaces, or symbols into a URL safely. Or doing the
reverse: turning a %E3%81%82%E3%81%84 log line back into something a
human can read.
componentURI vs uri
Two encoding scopes:
- componentURI — same as
encodeURIComponent. Escapes reserved characters too (: / ? # & =). Use it for query values, path segments, and POST bodies. - uri — same as
encodeURI. Leaves reserved characters intact and only escapes spaces and non-ASCII. Use it when you have a full URL string and don't want its structure rearranged.
When in doubt pick componentURI. Reach for uri only when you're
making a complete URL safe in one shot.
Decoding
If the input isn't valid percent-encoded text, decoding fails. The tool surfaces an error so you can see where the problem is, instead of silently chewing on bad bytes.
Where does your input go?
URL encoding and decoding all happen in this browser. Your input is never sent or stored. Close the tab and it's gone.