How to use it
- Choose Encode or Decode and paste your text.
- Encoding one value (like a search term or a parameter) is the default. Tick "It's a whole address" to encode a full link but keep its structure.
- Paste a full address starting with https:// to see its parts and every query parameter, decoded.
How URL encoding works
Web addresses can only contain a small set of characters. Anything else, such as spaces, accents or symbols with a special meaning like & and ?, is turned into bytes using UTF-8 and each byte is written as % followed by two hexadecimal digits. This is called percent-encoding, and the rules are in RFC 3986.
"Spaces as +" follows the older rule used when web forms send data (application/x-www-form-urlencoded), where a space becomes + instead of %20.
Which characters need encoding?
Letters A to Z and a to z, the digits 0 to 9, and the four symbols - . _ ~ never need encoding. Some other symbols have a special job in an address, so they must be encoded when they're part of a value:
| Character | Its job in an address | Encoded |
|---|---|---|
? | Starts the query (the part with parameters) | %3F |
& | Separates one parameter from the next | %26 |
= | Separates a parameter's name from its value | %3D |
# | Starts the part the browser keeps to itself | %23 |
/ | Separates folders in the path | %2F |
| space | Not allowed in an address at all | %20 (or + in form data) |
Everyday uses
- Search links. To link to a search for tax & VAT, encode the words first, or the & ends the search term early.
- Email links. A
mailto:link with a subject needs the subject encoded: Invoice #104 becomesInvoice%20%23104. Without it, everything after the # is lost. - Campaign links. Values in tracking parameters, such as a campaign name with spaces, need encoding so the link works everywhere.
- Reading a link. Decode a long link from an email or an advert to see where it really goes and what it's sending.
Frequently asked questions
Should I encode a value or the whole address?
Encode each value on its own before you put it into an address: a search term containing & would otherwise split into two parameters. "Whole address" mode is for fixing a full link that has spaces or accents in it, without breaking its slashes and question mark.
Which JavaScript function does each mode match?
Encoding one value works like encodeURIComponent(), which encodes every special character. "It's a whole address" works like encodeURI(), which leaves characters such as / ? & and = alone so the address keeps working.
Why does decoding fail?
A % must be followed by two hexadecimal digits (0–9, A–F), and the bytes must make valid UTF-8 text. A lone % or a link cut short in the middle of a character can't be decoded.