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.

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