A web address can only contain a limited set of characters: letters, digits and a handful of symbols. Anything else, such as a space, an accented letter, an ampersand in a search term or an emoji, has to be written as a percent sign followed by two hex digits for each byte. A space becomes %20, a slash %2F, and “é” becomes %C3%A9. This is URL encoding, also called percent encoding.
You see it every time you copy a link from a search for something with spaces in it. This tool does the conversion for you in both directions.
Choose what you are encoding
This is the choice that trips people up, so the tool makes it explicit.
A value is for a single piece that goes into a URL, such as a search term or a parameter. Everything with a special meaning in a URL is encoded: the slash, question mark, ampersand, equals sign, hash and so on. Use this when the text will sit after ?q= or inside a query string, or the & in “Tom & Jerry” would be read as the start of a new parameter. This is what encodeURIComponent does in JavaScript.
A whole URL is for an address that is already put together. The characters that give a URL its structure, / ? & = # and so on, are left alone, and only characters that cannot appear in a URL at all are encoded, like spaces and accented letters. This matches encodeURI. Use it to tidy up a link with a space in it, but not on a single parameter value.
Encoding a whole URL with the “value” setting gives you a mess that no longer works as an address, with https%3A%2F%2F where https:// should be. That is the commonest mistake.
Decoding
Paste a percent-encoded address and choose Decode for the readable version. It handles UTF-8 sequences, so %E2%9C%93 becomes a check mark. Two details can surprise you:
A plus sign is left as a plus. In HTML form submissions, a space is encoded as +, but in a general URL a plus is just a plus. If you decode a form-style string, replace the plus signs with spaces yourself.
In whole-URL mode, encoded reserved characters such as %2F stay encoded. They would change the meaning of the address if decoded, so the standard says to leave them.
If the tool reports an invalid sequence, a % is probably not followed by two hex digits, or the sequence is a broken UTF-8 character.
Related
For making clean, human-readable addresses from titles, use the slug generator, and see our guide to SEO-friendly URLs. The URL extractor pulls links out of text. Other encodings live in the Base64 tool and the HTML entities tool.