URL Decoder & Encoder

This URL decoder turns percent-encoded text like caf%C3%A9%20menu back into readable characters, and the encoder does the reverse so a value can go safely into a link or query string. A third tab works as a URL parser, splitting any address into its parts and listing its query parameters, decoded.

Mode

Runs entirely in your browser. Nothing you paste is uploaded or stored.

How do you decode a URL?

To decode a URL, replace every percent sign followed by two hex digits, such as %20, with the byte it stands for, then read those bytes as UTF-8 text. Paste the encoded URL above and it is decoded as you type. Turn on Treat + as space for query strings that came from an HTML form, where spaces are sent as +.

How to URL decode and URL encode

  1. URL decode: paste an encoded URL or fragment. If a % is not followed by two hex digits, or the bytes are not valid UTF-8, the error says at which character.
  2. URL encode: choose Component to encode a single value (like encodeURIComponent) or Full URL to encode only what a complete address cannot contain (like encodeURI).
  3. Parse URL: see protocol, host, port, path, query and fragment separately, with every query parameter decoded in a table.
  4. If the decoded result still contains %XX sequences, press Decode again: the URL was encoded twice.

Percent encoding rules (RFC 3986)

A URL may only contain a limited set of ASCII characters. RFC 3986, section 2 splits them into two groups:

  • Unreserved: A–Z a–z 0–9 - . _ ~. These never need encoding.
  • Reserved: : / ? # [ ] @ ! $ & ' ( ) * + , ; =. They separate the parts of a URL, so they must be encoded when they appear inside a value.

Everything else, including spaces and all non-ASCII characters, is converted to UTF-8 bytes and each byte is written as % plus two hex digits:

CharacterEncoded
space%20 (or + in form data)
&%26
=%3D
/%2F
?%3F
#%23
%%25
é%C3%A9
😀%F0%9F%98%80

encodeURIComponent vs. encodeURI

JavaScript has two built-in encoders, and picking the wrong one is a common bug. encodeURIComponent is for a piece of a URL: it also encodes / ? & = #, so a value containing them cannot break the URL around it. encodeURI is for a whole URL that is already structured: it leaves those characters alone and only escapes spaces, non-ASCII text and a few others.

const q = 'fish & chips'
'https://example.com/?q=' + encodeURIComponent(q)
// → https://example.com/?q=fish%20%26%20chips  ✔

encodeURI('https://example.com/?q=' + q)
// → https://example.com/?q=fish%20&%20chips   ✘ "&" starts a new parameter

When building query strings in code, URLSearchParams handles all of this for you (it uses the form encoding, with + for spaces). See the MDN reference for encodeURIComponent for the full list of characters each function leaves unescaped.

Plus signs, %20 and form data

In the path of a URL a space must be %20. In a query string submitted by an HTML form (the application/x-www-form-urlencoded format) a space is written as + and a literal plus as %2B. A strict URL decoder leaves + as it is, which is why this tool has a separate option for form data. If you decode a search URL and see words joined by plus signs, switch that option on.

Tokens and IDs inside URLs are often Base64URL rather than percent-encoded; the Base64 decoder reads those, and the JWT decoder splits a token from an ?id_token= parameter into its claims.

Frequently asked questions

What is URL encoding?

URL encoding is the conversion of characters that are not allowed or have a special meaning in a URL into a % sign followed by two hexadecimal digits. A space becomes %20 and "é" becomes %C3%A9 (its two UTF-8 bytes), so the URL can be sent and parsed safely.

What is percent encoding?

Percent encoding is the official name for URL encoding, defined in RFC 3986: each byte that must be escaped is written as "%" plus its value in two hex digits. Only letters, digits and - . _ ~ never need encoding; reserved characters such as / ? # & = are encoded when they are part of a value rather than structure.

What does encodeURIComponent do?

encodeURIComponent is a JavaScript function that percent-encodes a string so it can be placed safely inside one part of a URL, such as a query parameter value. It encodes every character except A–Z a–z 0–9 - _ . ! ~ * ' ( ), including / ? & = and #, which encodeURI leaves alone because they structure a full URL.