URL encoder / decoder

Percent-encode in both directions, and see what a query string actually contains once it is split into parameters.

Query string breakdown

Paste a full URL to turn ?a=1&b=2 into a table.

How to use

  • Put text on the left and press Encode; put an escaped string on the right and press Decode.
  • Not sure which mode? Encoding a parameter value needs Component; encoding a whole link that must keep ://, / and ? needs Whole URL.
  • The breakdown below accepts a URL straight from the address bar.

How the two modes differ

  • encodeURIComponent() also escapes / : ? & = # +, which is what a parameter value needs — only this guarantees that special characters inside a value cannot break the URL structure.
  • encodeURI() keeps those characters intact, so it suits whole links, but it does not escape ? or # — never use it on a value.
  • A space becomes %20. In form submissions it is often written as +; both are equivalent under application/x-www-form-urlencoded.

When you need this

  • Putting a search phrase into an API URL — without encoding it either fails or arrives garbled.
  • Debugging a third-party callback, to see exactly what redirect_uri was encoded as.
  • Chasing "the parameter disappears sometimes" bugs — an unescaped & inside a value swallows everything after it.

Edge cases worth knowing

  • The + ambiguity. In form encoding a space is +; in strict RFC 3986 percent-encoding a space is %20 and a real plus must be %2B. Phone numbers are the classic victim: +86 sent unencoded often arrives as 86. Encode the plus explicitly.
  • Double encoding. Encoding an already-encoded string escapes the percent signs: %20 → %2520. If a value arrives showing %25 or %2520, it was encoded twice — decode, then check which layer did the extra pass.
  • Non-ASCII needs UTF-8 first. Percent-escaping works on bytes. 中 is UTF-8 bytes E4 B8 AD → %E4%B8%AD. If text arrives as %C3%A4-style mojibake, something encoded it as Latin-1 instead of UTF-8.
  • Slash in path segments. A / inside a single path segment (like a date 2026/11/19) changes the URL's structure. Encode it as %2F when the receiving route treats segments as identifiers.
  • Decoding is lossy by design. Once decoded you cannot tell whether a space was originally a space or a + — keep the encoded original if you need to re-emit the URL.
  • Empty vs missing. ?a= and ?a and no parameter at all are three different things. Some frameworks treat the first two as identical, others do not; be explicit when building URLs.

FAQ

Why does decoding throw "URI malformed"?

The string contains an incomplete escape — a lone %, or a truncated sequence such as %E4%. Check whether a few characters were lost when copying, or whether the input was never encoded at all.

Why is a space sometimes %20 and sometimes +?

%20 is the URI standard; + is a form-encoding convention. This tool always encodes to %20 and decodes both correctly.

Does it handle the part after #?

The breakdown only reads the query string after ?. Everything after # is a fragment and is never sent to the server.

Other tools