How to use it
This tool lets you URL encode text so it can travel safely inside a link, or decode percent-encoded strings such as caf%C3%A9%20menu back into plain text. It follows the rules of JavaScript's encodeURIComponent: reserved characters like &, =, ? and / are encoded too, so a value can never break the structure of your query string. Everything runs in your browser.
How to URL encode or decode a string
- Paste the value you want to encode, or the percent-encoded text you want to decode.
- Leave the mode on "Auto-detect" or set it to "Encode" or "Decode".
- Click "Run tool" or press Ctrl + Enter.
- Copy the output into your link, code or documentation.
Auto-detect decodes when it finds at least one valid %XX sequence and encodes otherwise. If you deliberately want to encode text that already contains something like %20, select "Encode".
Which characters get encoded
Letters, digits and the marks - _ . ! ~ * ' ( ) pass through unchanged. Everything else is converted to UTF-8 bytes and written as % plus two hex digits. Non-ASCII characters therefore expand to several sequences:
- A space becomes
%20, and&becomes%26. +becomes%2B, which protects phone numbers like+44 20from turning into a space on the server./,?and#become%2F,%3Fand%23.- The euro sign takes three bytes:
%E2%82%AC. - A thumbs-up emoji takes four:
%F0%9F%91%8D.
Encoding a value versus encoding a whole URL
Because this is component encoding, running a complete address through it also encodes the colon and slashes. The result, https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dshoes, is not a working link. It is exactly what you need when that address becomes the value of another parameter, for example a return address after login:
| Goal | What to encode | Result |
|---|---|---|
| Search link | Only the term red shoes & bags | /search?q=red%20shoes%20%26%20bags |
| Return after login | The whole target path /cart?step=2 | /login?next=%2Fcart%3Fstep%3D2 |
| Share link | The full page address | ?url=https%3A%2F%2Fexample.com%2Fpost |
Without encoding, step=2 in the second row would be read as a parameter of the login page itself.
The plus sign and the space
HTML forms submit spaces as +, while general URL encoding uses %20. This tool always encodes spaces as %20, and when decoding it leaves + untouched: q=red+shoes%21 decodes to q=red+shoes!. If you are reading a form-encoded query string, replace the plus signs with spaces yourself.
Characters left alone, and when that matters
encodeURIComponent does not touch ! ' ( ) *. That is fine for almost every link, but some request-signing schemes, OAuth 1.0 among them, require strict RFC 3986 encoding in which only letters, digits and - . _ ~ stay literal. If your signature keeps failing on values with apostrophes or parentheses, encode those five by hand: %21, %27, %28, %29 and %2A.
Fixing double-encoded and broken strings
- Double encoding:
%2520is a%20that was encoded again. The decoder removes one layer per run, so run it twice. Then find the second encoding step in your code and remove it. - Malformed sequences: invalid bytes do not stop the whole decode.
%C3%BC%FFturns into "u with umlaut" followed by an untouched%FF. - A lone percent sign: text like
100% offhas no valid sequence, so auto mode encodes it to100%25%20off.
Privacy
All encoding and decoding runs locally in JavaScript. URLs, session tokens and query parameters you paste are not sent to the server; the page only increments an anonymous usage counter. To build a clean path segment from a headline, try the slug generator; for Base64 strings found in URLs, use the Base64 encoder and decoder. More utilities are listed under web tools.