How it works
The URL Encoder Decoder converts special characters to their percent-encoded equivalents for safe use in URLs (encoding) and converts percent-encoded URLs back to their human-readable form (decoding).
URLs can only contain a limited set of characters: letters, digits, and a few symbols (-._~). All other characters — spaces, non-ASCII characters, reserved characters like &, =, ?, #, and / that appear in parameter values — must be percent-encoded as %XX where XX is the character's hex byte value. A space becomes %20, an ampersand becomes %26, a Chinese character like 中 becomes its UTF-8 bytes %E4%B8%AD.
How to use it: paste a URL or URL component in the input and click Encode to get the percent-encoded version, or paste an encoded URL and click Decode to get the readable form. Toggle between encoding the entire URL (which leaves valid URL-structure characters like /, ?, & intact) or encoding a query parameter value (which encodes all reserved characters including / and &).
encodeURIComponent vs. encodeURI: the tool matches JavaScript's two encoding functions. encodeURI encodes a full URL, preserving structural characters. encodeURIComponent encodes a value intended to go inside a URL parameter, encoding everything except letters, digits, and -_.~. Use encodeURIComponent for individual parameter values.
Common use case: building a query string parameter containing a URL or other special characters. If you're passing redirect_url=https://example.com/path?key=value as a parameter, the inner URL must be fully encoded: redirect_url=https%3A%2F%2Fexample.com%2Fpath%3Fkey%3Dvalue.
Frequently Asked Questions
- Encode individual parameter values when building a query string — this uses encodeURIComponent which encodes / and ? too. Encode the full URL only when storing or transmitting it as a string value — this uses encodeURI which preserves /, ?, and & as structural characters.
- %20 is the standard percent-encoding for space. The + character is an alternative encoding for space used only in application/x-www-form-urlencoded format (HTML form submissions). Use %20 in URL paths and query strings for maximum compatibility.
- Non-ASCII characters are first converted to their UTF-8 byte sequence, then each byte is percent-encoded. The Chinese character 中 has UTF-8 bytes E4 B8 AD, encoding as %E4%B8%AD.
- The decoder decodes one level at a time. If a URL was double-encoded (%2520 = %25 encoded, which decodes to %20, which then decodes to space), run the decoder twice to fully decode it.