URL Encoder / Decoder

Percent-encode and decode URLs and query strings. Choose between full-URL (encodeURI) and component (encodeURIComponent) semantics. Runs entirely in your browser.

What is URL Encoding?

URL encoding (also called percent-encoding) replaces unsafe characters in a URL with % followed by their two-digit hex byte value. It is defined by RFC 3986. For example, a space becomes %20, and & in a query value becomes %26 so the server doesn't mistake it for a parameter separator.

This tool runs entirely in your browser — input never leaves your machine.

encodeURI vs encodeURIComponent

JavaScript ships two encoder functions and choosing the wrong one is the most common URL-encoding bug.

Rule of thumb: when building a URL piece-by-piece, use encodeURIComponent on each query parameter value, then join them with &. Never run encodeURI over a user-provided query value.

Common Encoded Characters

CharEncodedNotes
space%20in query strings, + is also accepted by most servers
&%26otherwise interpreted as parameter separator
=%3Dotherwise interpreted as key/value separator
+%2Botherwise interpreted as a space
#%23otherwise interpreted as fragment start
/%2Fonly encoded by encodeURIComponent

Frequently Asked Questions

encodeURI preserves characters reserved for URL structure — :, /, ?, #, &, =, +, $, and others — because it expects a full URL as input. encodeURIComponent escapes those characters too, because it expects only a fragment that will be inserted into a URL (like a single query-string value). For query parameter values, almost always use encodeURIComponent.
In a query string, + traditionally means a literal space (form-encoded). If you want a literal + sign in a value, it must be encoded as %2B. encodeURIComponent does this for you; encodeURI does not.
Yes, if it was double-encoded — but only intentionally. Double-encoded strings (e.g. %2520 instead of %20) usually indicate a bug where a URL was encoded on the way in and then encoded again. Use the "decode" button repeatedly to peel off layers.
Yes. Both encoding and decoding use UTF-8, matching modern browser and server behavior. Characters like é become %C3%A9 (two bytes), and emoji become four-byte sequences.
No. Everything runs in your browser using the built-in encodeURI / encodeURIComponent / decodeURIComponent functions.
Copied to clipboard!