About this tool
URL encoding breaks real work in two places at once. Build a query string by hand — https://api.example.com/search?q=rock & roll — and the bare & silently splits one value into two parameters, the space becomes an accidental separator or a broken request depending on the client, and the request you meant to send is not the request that leaves. Copy a link out of a Chinese page — full-width punctuation in the path, a title with 中国 in the query — and it may work in the address bar yet fail the moment curl, a log parser or an HTTP client meets it. Percent encoding is the fix, but the two functions that implement it, encodeURI and encodeURIComponent, differ in exactly the characters that cause these failures, and picking the wrong one is how encoded URLs get quietly corrupted.
This tool covers the whole loop in one page. The Encode/Decode tab converts text in either direction with a scope switch that matters: encodeURIComponent for a single value or path segment — it escapes the URL structure itself, so ? & = / become part of the data — and encodeURI for a complete URL whose structure must survive, where ? & = / # keep their meaning and only the characters that cannot appear anywhere get encoded. Decoding is strict rather than best-effort: a broken escape like %E0%A4 produces an error naming the exact position in your input, instead of garbage or a silent exception. It also watches for double encoding — if %XX sequences remain after a decode, it flags them and offers to decode one more layer, because text encoded twice (%2520 instead of %20) never fixes itself.
The two details developers trip over get straight answers. The Modes tab encodes the same input three ways side by side — encodeURI, encodeURIComponent and strict RFC 3986, which additionally turns ! ' ( ) * into %21 %27 %28 %29 %2A — with the exact list of characters each mode leaves alone spelled out, so “which one do I use” becomes a visible fact instead of a guess. The plus sign gets the same treatment: in a query string, + traditionally means a space — a convention HTML form encoding invented before the RFC settled on %20 — while everywhere else + is just a plus. The tool applies the right rule in each place and says which rule is in effect, because that single distinction is where most one-box encoders get it wrong.
The Query params tab takes a full URL or a bare query string and parses it into name/value rows: duplicate names stay as separate rows instead of collapsing, empty flag= values survive, and a value sent as %26 decodes to & without splitting the pair. Above the table sit the parameter count and the byte size of what actually went over the wire; below it a re-serializer rebuilds the query with every space as %20 — never + — so parse and serialize round-trip cleanly. The URL inspect tab hands the URL to the browser's own WHATWG parser and shows protocol, hostname, port, path, search and hash, with internationalized domains in punycode, because xn--fiqs8s.icu is what DNS actually resolves for 中国.icu.
Nothing is uploaded — URLs regularly carry credentials (signed links, presigned S3 URLs, OAuth redirects), so every byte of encoding, decoding and parsing happens in your browser.
How to use URL Encoder & Decoder
- Encode/Decode: paste text, pick Encode or Decode, and choose the scope — component (encodeURIComponent) for a single value or path segment, whole URL (encodeURI) to keep ? & = intact. Decode errors name the exact position of a broken escape; the + checkbox controls whether query-string semantics apply.
- Modes: one input, three encodings side by side — encodeURI, encodeURIComponent and strict RFC 3986 — each with its keep-list of unescaped characters, so you can see which mode preserves ? & = and which escapes them.
- Query params: paste a full URL or a bare query string; read name/value rows (duplicates and empty values kept), the parameter count and byte size, then copy the re-serialized query — spaces come back as %20, never +.
- URL inspect: paste a URL and the browser's own parser splits it into protocol, hostname (punycode for internationalized domains), port, path, search, hash and parameter count — copy any part with one click.
Frequently asked questions
When should I use encodeURI and when encodeURIComponent?
encodeURI is for a complete URL you are about to open: it leaves the structure characters (? & = / # : @) alone and encodes only what cannot appear anywhere, like spaces, quotes and non-ASCII. encodeURIComponent is for one piece of a URL — a query value, a path segment — where ? & = are part of the data and must be escaped so they cannot change the URL's structure. Encoding a whole link with encodeURIComponent produces https%3A%2F%2F…, which no server will route; encoding a single value with encodeURI leaves & unescaped, which silently splits the value into two parameters. The Modes tab shows both on your own input.
Why is a space sometimes %20 and sometimes +?
Two standards, two answers. RFC 3986 (and encodeURI/encodeURIComponent) writes a space as %20. HTML form encoding — application/x-www-form-urlencoded, born with early HTML form handling — writes it as +, and that convention survives in PHP's $_GET, JavaScript's URLSearchParams and most web frameworks when they read the query string. So inside a query string both usually decode to a space, but in a path or component only %20 is correct and + is a literal plus. Safe rule: always generate %20, and encode a real plus as %2B; this tool parses + as a space only in query context and never emits + itself.
How do I recognize and fix double encoding?
Look for %25 where a single-encoded string would have %: a space encoded twice is %2520, an & encoded twice is %2526 — the % of %20 itself got encoded to %25. Decode once and the text still looks encoded (%20 or %26 remains); that residue is the tell. Decode a second time to recover the original. This tool flags the residue automatically after a decode and offers a “Decode again” step. The real fix is at the source: encode exactly once, at the last moment before the value enters the URL — encoding at every layer is how %2526 happens.
What happens when %20 and + are mixed in one string?
In query semantics both mean a space, so 'q=hello%20world+again' decodes to 'hello world again'. But the mix is fragile: a strict RFC 3986 parser reads the + as a literal plus and returns 'hello world+again', and a form-style decoder will turn any deliberate + (say, in 'C++') into a space. Mixing also breaks round trips — re-encoding the decoded value produces all-%20, so the + silently disappears. Pick one convention (prefer %20), encode deliberate pluses as %2B, and this tool's re-serializer does exactly that.
How are non-ASCII characters like Chinese encoded?
First to UTF-8 bytes, then each byte as %XX. 中 is three bytes in UTF-8 (E4 B8 AD), so it becomes %E4%B8%AD — nine characters for one. That is also why a long Chinese query explodes in length: every character costs three to four escapes. Decoding collects the %XX bytes and decodes the run as UTF-8; if the bytes do not form a valid sequence (a truncated %E4 at the end of a string, for example), the tool reports the exact position instead of emitting replacement garbage.
How is URL encoding different from Base64?
They solve different problems. Percent encoding keeps text readable and escapes only the bytes that are unsafe in a URL — the output is still mostly the original text. Base64 packs arbitrary binary into 64 printable characters at roughly 33% size inflation, with no relationship to URL rules — that is why JWT segments, data URIs and HTTP Basic auth use it. For a value inside a query string, percent encoding is the right tool; if you must put Base64 in a URL, use the URL-safe variant (- and _ instead of + and /) or it will be mangled by exactly the + and / rules described above.
Is my data uploaded anywhere?
No. Every conversion, parse and inspection runs locally in your browser with JavaScript. URLs and text pasted here — including signed or tokenized links, which are credentials — never leave your device.