Skip to content

URL Decode and Encode

Decode percent-encoded URLs (%20, %C3%A9) to readable text, or URL encode text for links, query strings and form data. Runs in your browser.

Runs in your browser

Everything happens on your device: nothing you paste or type is sent to our server or stored. A share link holds your settings, and your input only if you choose to include it.

Use “URL component” for one query value or path segment, “Whole URL” to fix spaces and accents in a full link, and “Form data” for what HTML forms send, where + means a space.

21 characters · 27 bytes (UTF-8) · limit 5 MB

Output: 59 characters.

Input length (characters)
21
Output length (characters)
59
Bytes escaped as %XX
16

Method: Percent-encoding, RFC 3986 §2.1 (unreserved characters kept, §2.3) · FindMySum codec (no library), UTF-8

Off by default. When on, your input is packed into the part of the link after “#”, which browsers never send to any server; anyone you give the link to will see it.

How it works

Encoding first turns your text into UTF-8 bytes, the character encoding RFC 3986 and the WHATWG URL Standard both use. Each byte that the chosen format allows through is written as itself; every other byte becomes a percent sign followed by two upper-case hex digits, so é (bytes C3 A9) becomes %C3%A9. The formats differ only in which characters they leave alone: the strict RFC 3986 component format keeps letters, digits and - . _ ~; JavaScript's encodeURIComponent also keeps ! ' ( ) *; encodeURI keeps everything that gives a URL its structure (: / ? # & = and the rest); and form data keeps letters, digits and * - . _ and writes a space as +.

Decoding reads the escapes back into bytes and checks that the bytes are valid UTF-8 before turning them into text. A % that isn't followed by two hex digits, or bytes that can't be UTF-8 (text saved in another character set, or a character cut in half), stop the decode with the position of the problem instead of producing replacement characters. In the form-data format a + becomes a space; in the whole-URL format, escapes of reserved characters such as %2F stay escaped, as JavaScript's decodeURI does, so decoding can't change where a link points.

The work happens in your browser with our own code, checked against RFC 3986, Python's urllib.parse and the browser's built-in functions. Nothing you paste is uploaded.

Standards this tool follows

URL Decode and Encode: Percent-Encoding Explained

By FindMySum · Last reviewed

To URL decode a link or a query string, paste it into the box above with the direction set to decode: escapes such as %20 and %C3%A9 turn back into spaces and accented letters as you type, in your browser. To go the other way, choose encode and the tool writes your text in the form that can travel safely inside a web address.

Why URLs need encoding

A URL may only contain a limited set of ASCII characters, and several of them have jobs to do: / separates path segments, ? starts the query, & separates parameters, = joins a name to its value and # starts the fragment. If a search term contains one of those characters, or a space, or a letter outside ASCII such as é or 中, it has to be written as percent escapes so the server reads it as data rather than structure. That is percent-encoding, defined in RFC 3986.

Picking a format

  • URL component (RFC 3986) is the strictest and the safest default for one value: a query parameter, a path segment or a file name.
  • encodeURIComponent matches what JavaScript developers get from the built-in function, which leaves ! ' ( ) * alone. Use it when you need identical output to a script.
  • Whole URL fixes a complete link that contains spaces or accented letters without breaking its slashes, question mark and ampersands.
  • Form data is what a browser sends when an HTML form is submitted, and what many APIs expect in a request body: spaces become + and a real plus sign becomes %2B.

A worked example

Take the search phrase café & crème. In UTF-8, é is the two bytes C3 and A9, and è is C3 and A8. Encoded as a URL component, the phrase becomes caf%C3%A9%20%26%20cr%C3%A8me: the spaces are %20, the ampersand is %26 so it can't split the query, and each accented letter is two escapes. As form data the same phrase is caf%C3%A9+%26+cr%C3%A8me, because form data writes spaces as plus signs.

Mistakes to watch for

Encoding a whole URL as a component. Running https://example.com/?q=1 through the component format escapes the colon and slashes, so the result is no longer a working link. Encode each value before you assemble the URL, or use the whole-URL format on the finished link.

Decoding plus signs in the wrong format. In a path, + is a literal plus; in a query string written by a form, it is a space. If decoded text shows plus signs where spaces should be, switch to the form-data format.

Double encoding. Frameworks often encode values for you. Encoding them again by hand produces %2520 and similar sequences that show up on the page as literal percent signs.

Mixing character sets. Old systems sometimes encode with Latin-1 or Windows-1252. Those escapes are not valid UTF-8, and this tool will tell you where the decode failed rather than guessing.

For other encodings, the Base64 decoder handles binary data in text form, and the number system converter turns hex byte values like C3 into decimal or binary.

Sources

Frequently Asked Questions

What does %20 mean in a URL?

It is a space. A space can't appear in a URL, so it is written as a percent sign followed by its byte value in hex: 20. In query strings sent by HTML forms you will often see a + for a space instead, which is the form-data convention; decode those with the Form data format.

Should I use encodeURI or encodeURIComponent?

Use the component format (or encodeURIComponent) for a single value you are putting inside a URL, such as a search term or a file name, because it escapes / ? & = and # that would otherwise end the value early. Use the whole-URL format only to clean up a complete link that already has the right structure but contains spaces or accented letters.

Why do I see %2520 instead of %20?

The text was encoded twice. The first pass turned a space into %20, and the second pass escaped the % sign itself as %25. Decode it twice, or fix the code that encodes it a second time. This tool warns you when it spots %25 followed by two hex digits.

Why did decoding stop with an error about UTF-8?

The escapes produce bytes that aren't valid UTF-8, usually because the text was encoded from an older character set such as Windows-1252, where é is the single byte %E9 rather than %C3%A9. Modern browsers and servers expect UTF-8, so re-encode the original text as UTF-8.

Is URL encoding a way to hide or protect data?

No. Percent-encoding only makes text safe to carry inside a URL; anyone can decode it. Passwords, tokens and personal details in a URL also end up in browser history and server logs, so keep them out of links.

Spotted a wrong result or a bug? Report a problem (the link sends the page address only, never what you entered).

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy