URL Encoder/Decoder
100% LocalSafely encode and decode URL parameters and strings.
Safe Web Transport
Encodes sensitive characters (like &, ?, =) into their URI-safe equivalents.
Paste a URL or query string. Encoded output appears instantly.
What is URL Encoder/Decoder?
Frequently Asked Questions
Technical Deep Dive
URL Encoder/Decoder
Ensure your URL parameters are correctly escaped for transport. This tool handles standard percent-encoding and decoding, making it easy to share complex data in URLs or debug web requests.
encodeURIComponent and encodeURI are different. This page shows both so query values do not break the whole URL.
Encode a b&c=d as a query value. You should see spaces as %20 and & as %26. Decoding that string must round-trip.
Do not encode an entire URL with encodeURIComponent or you will break the scheme slashes.
01 Character Mapping Reference
| Character | Encoded (Hex) | Role in URL | Status |
|---|---|---|---|
| Space | %20 | Separator | Must Encode |
& | %26 | Param Delimiter | Must Encode |
? | %3F | Query Prefix | Must Encode |
A-Z | N/A | Literal | Safe |
02 Encoding Logic Pipeline
- . _ ~ are passed through.
03 When You Reach for URL Encoding
Percent-encoding shows up at every boundary where free-form text becomes part of a structured URL. Skip it in the wrong place and you get truncated query strings, broken OAuth callbacks, or full-blown injection bugs.
-
Query string parameter values A search term like
cats & dogsmust be encoded ascats%20%26%20dogsbefore being appended to?q=. Otherwise the&terminates your parameter and the rest is parsed as a new key. -
OAuth 2.0 redirect_uri values RFC 6749 says the
redirect_uriparameter must be percent-encoded.https://app.example.com/cb?state=xbecomeshttps%3A%2F%2Fapp.example.com%2Fcb%3Fstate%3Dx, providers do exact-match comparison, so even a missing colon encoding breaks the callback. -
application/x-www-form-urlencoded bodies HTML form POSTs use the same percent-encoding plus one wrinkle: spaces become
+instead of%20.URLSearchParamsin JavaScript andurllib.parse.urlencodein Python both follow this rule. -
Path segments with user content Building
/users/{name}/postsfrom raw input lets a name containing/or..change the route entirely. Encode each segment withencodeURIComponent, not the whole URL withencodeURI. -
Encoding an already-encoded URL If
%20becomes%2520, the server sees a literal%20in the path, not a space. Always know whether the value coming in has been encoded already, encoding twice is a real bug.
04 Worked Examples
hello world
q=hello+world
q=hello%20world
Most servers accept both in a query string, but it is application-defined. Express's req.query turns both back into a space; raw decodeURIComponent turns + into a literal +, not a space.
a/b?c#d@e
a/b?c#d@e
a%2Fb%3Fc%23d%40e
RFC 3986 ยง2.2 lists the reserved set: :/?#[]@!$&'()*+,;=. They have meaning at the URL level, so a value containing them must be percent-encoded, otherwise the parser splits the URL at the wrong place.
?next=%2Fdashboard
?next=%252Fdashboard
%2Fdashboard (treated as a literal filename)
The decoder ladder here is critical. Decode once at the framework boundary and never re-encode an already-encoded value. If you see %25 appearing in logs you almost certainly have a layer that is encoding twice.
05 Related Tools
URL encoding is rarely a destination, it is one stop on a debugging trip through proxies, redirects, and query strings.
URL Parser
Break a URL into scheme, host, path, and query parameters, useful when an encoded blob hides which part is malformed.
HTML Entity Converter
When a URL is embedded inside HTML, the & separators also need entity encoding, a common source of "missing parameter" bugs.
Base64 Encoder
JWTs and OAuth state parameters often carry Base64URL, use this when the URL-encoded value contains an encoded token.