URL Decoder — Decode Percent-Encoded URLs Online

URL Decoder

Paste a percent-encoded string into the input pane and choose Decode URL. The result appears in the right pane and your input is not changed. The page also shows Encode URL, because it uses the same editor as the URL Encoder. The conversion runs in your browser, and neither path makes a network request.

How this tool handles it

Decoding calls the built-in decodeURIComponent() on the whole input. There is no parsing of the URL structure, so ?, &, = and / are ordinary characters in the input and come back unchanged.

  • Each %XX sequence is read as one UTF-8 byte. Multi-byte characters must have all their bytes present, so %C3%A9 becomes é but %C3 alone is an error.
  • + is not converted to a space. It comes back as a plus sign.
  • If the input is malformed (a % without two hex digits, or bytes that are not valid UTF-8), the output pane shows Error: Invalid URL encoded string. The message does not say which part of the input is wrong.
  • Encode URL on this page runs encodeURIComponent() on the input, with the same rules as the URL Encoder.

Source: src/components/UrlEncoder/UrlEncoderEditor.tsx, functions decodeUrl and encodeUrl. This page passes the same editor the URL Encoder uses, with the command buttons in the opposite order.

Worked example

Input, a redirect URL copied out of a server log:

https%3A%2F%2Fapp.example.com%2Fcallback%3Fnext%3D%2Fdashboard%26tab%3Dbilling%26q%3Dcaf%C3%A9+au+lait

Output of Decode URL:

https://app.example.com/callback?next=/dashboard&tab=billing&q=café+au+lait

The %3A%2F%2F pairs become ://, and %C3%A9 becomes é. The + between café, au and lait stays a plus sign, because the input was not form-encoded.

Gotchas

1. + is not a space

decodeURIComponent("caf%C3%A9+au+lait")   // "café+au+lait"
new URLSearchParams("q=caf%C3%A9+au+lait").get("q")   // "café au lait"

A query string from an HTML form uses + for spaces. Use URLSearchParams for that kind of data. This tool keeps the plus sign.

2. Decoding is not safe to repeat

decodeURIComponent("100%25 sure%41")   // "100% sureA"

The %25 becomes %, so a second decode would read the % that was just produced. Decode the value once, from the encoded form.

3. %2F becomes a slash

decodeURIComponent("a%2Fb")   // "a/b"

If the encoded value was a single path segment that contained a slash, the decoded text now looks like two segments. Keep the decoded result as a value, not as a path.

4. A literal percent sign in the input

Input:   50% off
Output:  Error: Invalid URL encoded string

A % that is not followed by two hex digits makes the whole input fail. If the text was never encoded, replace each literal percent sign with %25 before decoding.

FAQ

Why does the tool say "Invalid URL encoded string" without a position?

The browser's decoder throws without a location, and the tool replaces the thrown message with a fixed string. To find the problem, scan the input for a % that is not followed by two hex digits.

Does the decoder read + as a space?

No. It reads + as a literal plus sign. Form-encoded data needs a form-aware parser such as URLSearchParams.

Can I decode a whole URL?

Yes. The input is decoded as plain text, so an encoded URL comes back as a URL. The decoder does not check that the result is a valid URL.

Does it decode base64 or HTML entities?

No. It only handles percent-encoding. Use a separate tool for base64 or HTML entities.

Can it decode output from encodeURI?

Yes. decodeURIComponent reverses any percent-encoding, including the escapes that encodeURI never writes. The problem is on the encoding side: encodeURI leaves &, =, ? and # unencoded, so its output cannot be used as a single query value. This tool does not encode that way.