Free Online URL Encoder and Decoder
Runs in this tab. A token, a key, a config — whatever you paste stays local.
Loading the tool…
How it works
Two functions, two different jobs
RFC 3986 divides URL characters into reserved ones that have structural meaning and unreserved ones that never need encoding. encodeURI assumes you are handing it a whole URL, so it leaves the reserved set — : / ? # [ ] @ ! $ & ' ( ) * + , ; = — intact. encodeURIComponent assumes you are handing it one value going inside a URL, so it escapes all of those. Use the component form for a query parameter, the whole-URL form only when you are cleaning up a complete address.
- Unreserved
- A-Z a-z 0-9 - _ . ~ are never encoded by either function. Everything else is a judgement call.
- encodeURI
- Leaves reserved delimiters alone so a full URL stays a URL. Wrong for a value: an & inside it will end the parameter early.
- encodeURIComponent
- Escapes & = ? / # and the rest. The right choice for anything you are inserting into a path segment or query value.
- + versus %20
- In application/x-www-form-urlencoded bodies a space is +, and a literal plus must be %2B. In a URL path a space is %20 and a + is just a plus — decoding with the wrong rule silently changes the value.
- Encoding
- Non-ASCII is UTF-8 first, then percent-escaped per byte, so é is %C3%A9 rather than a single escape.
How to use it
How to URL encode and decode online
- 01
Paste the URL or the value
One whole address, or just the piece you are about to put inside one.
- 02
Pick component or whole-URL
Component encoding for a parameter value; whole-URL to keep delimiters.
- 03
Copy it out
Decoding works the same way in reverse, including form-style + handling.
Where it earns its keep
Where percent-encoding bites
- Building a redirect_uri or callback parameter that contains its own query string.
- Reading a tracking URL to see what was actually passed through it.
- Escaping a search term with spaces and ampersands for a hand-written API call.
- Debugging a webhook URL where a nested URL arrived truncated.
Questions
URL Encode, answered
Which should I use, encodeURI or encodeURIComponent?
Component encoding for any single value going into a URL, which is nearly always the case. Whole-URL encoding only for an address you already consider complete — using it on a value is how an embedded & breaks the query string.
Does my URL leave the browser?
No. Encoding and decoding are pure string operations run in this tab. A signed URL or a callback carrying a token is not sent anywhere.
Why is my space sometimes + and sometimes %20?
They come from different specs. Form bodies use the HTML form-urlencoded rules where a space is +; URLs proper use %20. A decoder has to be told which one it is looking at, so we make it a choice rather than a guess.
Can I encode an entire URL safely in one pass?
No single pass is always right. Encoding a full URL as a component escapes its own slashes and colons; encoding a value as a full URL leaves delimiters that break it. Encode the parts, then assemble.