URLBridge
URL Encoder / Decoder
Percent-encode strings for use in URLs, or decode percent-encoded URLs back into readable text.
Percent-encoding for reserved URL characters
Characters that have a structural meaning in a URL must be escaped as a percent sign followed by their hex byte value when they appear inside a value.
| Character | Encoded | Why it is reserved |
|---|---|---|
| space | %20 | Terminates the URL in many parsers |
| ! | ! | Not escaped by encodeURIComponent |
| " | %22 | Quote, breaks HTML attributes |
| # | %23 | Starts the fragment |
| % | %25 | Starts an escape sequence itself |
| & | %26 | Separates query parameters |
| + | %2B | Means a space in form encoding |
| , | %2C | List separator in some APIs |
| / | %2F | Path separator |
| : | %3A | Separates scheme and port |
| ; | %3B | Legacy parameter separator |
| < | %3C | Opens an HTML tag |
| = | %3D | Separates key and value |
| > | %3E | Closes an HTML tag |
| ? | %3F | Starts the query string |
| @ | %40 | Separates userinfo from host |
| [ | %5B | IPv6 literal delimiter |
| ] | %5D | IPv6 literal delimiter |
| ^ | %5E | Unsafe in older specs |
| ` | %60 | Unsafe in older specs |
| { | %7B | Unsafe in older specs |
| | | %7C | Unsafe in older specs |
| } | %7D | Unsafe in older specs |
encodeURIComponent leaves ! ' ( ) and * unescaped even though RFC 3986 reserves them, so some APIs need those escaped by hand. Encoding % itself as %25 is what stops double-encoding bugs.
Two flavours
encodeURI keeps URL structure characters like : / ? & untouched; encodeURIComponent encodes everything not in the safe-character set — use this one inside query parameters.
Frequently asked questions
My URL has a space in a query parameter — should I use %20 or +?
%20 is the standard percent-encoding for spaces and works everywhere. The + sign is only valid for spaces inside form data (application/x-www-form-urlencoded). When in doubt, use %20.
Should I encode the entire URL or just the query string values?
Encode only the values inside query parameters, not the full URL. Encoding the full URL would break the protocol, slashes, and domain. Use encodeURIComponent for parameter values, not encodeURI.
Why do special characters break my URLs?
URLs can only contain ASCII letters, digits, and a few safe symbols. Characters like spaces, &, =, and # have special meaning in URL syntax, so they must be percent-encoded to be treated as literal data rather than delimiters.
Related Developer calculators
Last updated: September 7, 2026