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.
encodeURI(s)— for a whole URL. Leaves URL-structural characters alone::/?#[]@!$&'()*+,;=encodeURIComponent(s)— for a single component (like one query parameter value). Escapes the structural characters too.
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
| Char | Encoded | Notes |
|---|---|---|
| space | %20 | in query strings, + is also accepted by most servers |
| & | %26 | otherwise interpreted as parameter separator |
| = | %3D | otherwise interpreted as key/value separator |
| + | %2B | otherwise interpreted as a space |
| # | %23 | otherwise interpreted as fragment start |
| / | %2F | only 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.+ 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.%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.é become %C3%A9 (two bytes), and emoji become four-byte sequences.encodeURI / encodeURIComponent / decodeURIComponent functions.