URL Encode and Decode

Make text safe to put in a URL, or read an encoded URL back as text. Choose whether you are working on one part of a URL or a whole one; the two need different rules.

How it works

A URL can only contain a small set of characters. Everything else, including spaces, accents and symbols such as & or =, has to be written as a percent sign and two hex digits: a space becomes %20.

Part of a URL is for a single value, such as a search term in a query string. It escapes & = ? / and # too, because inside a value those would end it early. This is what encodeURIComponent() does in JavaScript.

Whole URL keeps the characters that give a URL its shape, such as :// ? & and #, and escapes only what is not allowed at all. This is what encodeURI() does. Both run on this page and send nothing anywhere.

How to use it

  1. 1 Pick Encode or Decode.
  2. 2 Choose Part of a URL for a single value, or Whole URL for a full address.
  3. 3 Type or paste into the first box. The result updates as you type.
  4. 4 Copy it or download it as a .txt file. Swap moves the result back into the first box and flips the direction.

Good to know

  • When decoding a part of a URL, a + is read as a space, because that is how web forms send spaces.
  • Whole URL decoding leaves %2F, %3F, %26 and similar escapes alone, because turning them back into / ? & would change where the URL points.
  • If decoding fails with "not UTF-8", the URL was probably made by an old system that used Latin-1, where é was %E9 rather than %C3%A9.
  • Encoding twice is a common bug: a space becomes %20, then %2520. If you see %25 in a URL, it was probably encoded twice.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Why "café & crème" becomes caf%C3%A9%20%26%20cr%C3%A8me

A URL is plain text with a grammar. The scheme ends at ://, the path is split by /, the query starts at ?, its pairs are split by &, each name is split from its value by =, and # starts the fragment. Those characters are the URL’s punctuation, and the rules that define URLs (RFC 3986) only allow a small set of other characters next to them: letters, digits and - . _ ~. Anything else has to be written as a percent sign followed by two hex digits, one escape per byte. That is percent-encoding.

Take a search for "café & crème". The letters c, a and f are allowed as they are. The é is not ASCII, so it is first turned into its UTF-8 bytes, C3 and A9, and each byte is written as an escape: %C3%A9. The space is byte 20, so it becomes %20. The ampersand is allowed in a URL, but inside a value it would end the value and start a new pair, so it is escaped as %26. Putting it together gives caf%C3%A9%20%26%20cr%C3%A8me, where the è of crème is C3 A8. A server decoding that gets back exactly the text that was typed.

This is the difference between the two modes. Part of a URL escapes the ampersand, the slash, the equals sign and the rest, because you are building one value and none of them may leak out. Whole URL leaves them alone, because they are already doing their job in the address. Encoding a whole address as if it were a part would turn https://example.com/ into https%3A%2F%2Fexample.com%2F, which is no longer a link. Encoding a value as if it were a whole URL would leave an & inside it, and the server would split the value in two. In JavaScript these are encodeURIComponent() and encodeURI(), and choosing the wrong one is one of the most common URL bugs there is.

Decoding has a matching subtlety. In whole URL mode, escapes for the punctuation characters are left as they are: /a%2Fb is a path with one segment named "a/b", while /a/b has two segments, so decoding %2F would change the address. The plus sign is the other trap. HTML forms send a space as +, so in a query string a + means a space, and this tool reads it that way when decoding a part. In a path, though, + is just a plus sign, which is why the encoder always writes %20 for a space: it is the only spelling that means a space everywhere.

Two failures are worth recognising. If decoding complains that an escape is not UTF-8, the text was probably produced by an old system that used Latin-1, where é was the single byte E9 and was written %E9. That cannot be read as UTF-8, and guessing would risk turning it into the wrong letter, so the tool reports it. And if you see %25 in a URL, look twice: %25 is an escaped percent sign, and %2520 is a space that was encoded once to %20 and then again. Double encoding is the most common bug in hand-built URLs, and decoding once more usually reveals it.

Frequently asked questions

What is the difference between encoding part of a URL and a whole URL?

Part of a URL escapes every character with a special meaning, so a value like "fish & chips" becomes fish%20%26%20chips and cannot break the query string. Whole URL keeps : / ? & = # as they are, so a complete address still works after encoding. Use Part for values you are inserting, Whole for an address you already have.

Should a space be %20 or +?

Both mean a space in a query string, because HTML forms send spaces as +. In the path of a URL only %20 is a space; a + there is a literal plus sign. This tool writes %20, which is correct everywhere, and reads + as a space when decoding a part.

Why does é become %C3%A9 and not %E9?

URLs encode the UTF-8 bytes of a character, and é is two bytes in UTF-8, C3 and A9. %E9 is the older Latin-1 spelling, which modern browsers and servers do not expect.

Why does decoding say "not a percent sign followed by two hex digits"?

A % in an encoded URL must always start an escape such as %20. A bare % (for example "100%") or one followed by letters that are not hex means the text was not encoded properly. The message shows where it is so you can fix it.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.