URL Encoder / Decoder
Percent-encode a full URL or just a query parameter value — and decode it back. Live conversion, no sign-up, nothing leaves your browser.
encodeURI vs. encodeURIComponent
The two JavaScript functions solve different problems. encodeURI is for a complete URL: it escapes spaces and Unicode but leaves the structural characters : / ? # & = alone, so the URL still works. encodeURIComponent escapes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ) — use it for a single query parameter value (or a path segment) so characters like & and = inside the value can't break the URL apart.
What is percent-encoding?
Characters outside the allowed URL set are replaced by % followed by two hexadecimal digits per UTF-8 byte. A space becomes %20, é becomes %C3%A9, and an emoji takes four bytes (twelve characters). Decoding reverses the process.
FAQ
What's the difference between encodeURI and encodeURIComponent?
encodeURI leaves URL structure characters like : / ? # & untouched, so it is safe for whole URLs. encodeURIComponent escapes those too, so it is meant for a single value — like a query parameter — that must not break the URL apart.When should I encode only the parameter value?
search?q=YOUR VALUE. If the value contains & or =, encoding the whole URL would still split it into fake parameters. Encode just the value with encodeURIComponent so the full URL keeps its structure.Why do spaces become %20?
% sign followed by two hex digits of the UTF-8 bytes. A space is byte 0x20, hence %20. This tool decodes them back on request.