decoder.tools

URL Decoder

Decode percent-encoded URLs and query strings back to readable text.

INPUT
OUTPUT

The result appears here as you type.

Decoding runs in your browser. What you paste is not sent to a server.

A URL decoder reverses percent-encoding: every %XX sequence is turned back into the byte it represents, and the bytes are read as UTF-8 text. %20 becomes a space and %C3%A9 becomes é.

Example

Input
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dcaf%C3%A9%20au%20lait%26lang%3Den
Output
https://example.com/search?q=café au lait&lang=en

What is URL encoding?

URLs may only contain a limited set of ASCII characters, and some of those (/ ? # & = +) have special meaning. Percent-encoding (RFC 3986) is how anything else gets in: the character is converted to UTF-8 bytes and each byte is written as % followed by two hex digits.

Two details cause most confusion:

  • + versus %20. In HTML form submissions (application/x-www-form-urlencoded), a space is written as +. In other parts of a URL, + is a literal plus sign. This tool treats + as a space by default. Switch the option to No (strict RFC 3986) when decoding a path or a value where + should stay.
  • Double encoding. If the output still contains %25, %2F and so on, the string was encoded twice (%25 is an encoded %). Decode the output again.

Common percent-encoded characters

EncodedCharacterEncodedCharacter
%20space%3D=
%21!%3F?
%22"%40@
%23#%2B+
%25%%2C,
%26&%2F/
%3A:%7E~

How to use the URL decoder

  1. Paste the encoded URL or query string.
  2. Choose whether + means a space. Keep Yes for query strings from forms.
  3. Read the decoded text. If it still contains %XX sequences, decode it once more.

Decode a URL in code

JavaScript
console.log(decodeURIComponent("caf%C3%A9%20au%20lait")); // café au lait

// For query strings, URLSearchParams also turns + into a space
console.log(new URLSearchParams("q=caf%C3%A9+au+lait").get("q")); // café au lait
Python
from urllib.parse import unquote, unquote_plus

print(unquote("caf%C3%A9%20au%20lait"))      # café au lait
print(unquote_plus("caf%C3%A9+au+lait"))     # café au lait

URL encoding at a glance

SpecificationRFC 3986 (URIs), WHATWG URL Standard, HTML form encoding
Format% plus two hex digits per byte
Character encodingUTF-8
Space%20, or + in form-encoded query strings

Frequently asked questions

What is the difference between decodeURI and decodeURIComponent?

decodeURI leaves the characters that structure a URL encoded (such as %2F for / and %3F for ?), so the URL keeps its shape. decodeURIComponent decodes everything, which is what you want for a single query value. This tool behaves like decodeURIComponent.

Why do I get a "malformed percent-encoding" error?

Either a % is not followed by two hex digits, or the bytes don't form valid UTF-8. A literal % in the text should have been encoded as %25. Older systems sometimes encode in Latin-1 (%E9 for é), which isn't valid UTF-8.

Should + be decoded as a space?

In query strings that came from HTML forms, yes. In paths, and in values encoded with encodeURIComponent, no, because there a space is always %20 and + means a plus sign.

Last reviewed · found a mistake? contact@decoder.tools · view as markdown