URL Encoder / Decoder

Percent-encode text for safe use in URLs and query strings, or decode %XX sequences back to readable text. UTF-8 aware, with predictable handling of plus signs and broken sequences.

The output will appear here.
Advertisement Kelivo — a word game by icyabmod, on Google Play and the App Store

How URL Encoder / Decoder works

Percent-encode text for safe use in URLs and query strings, or decode %XX sequences back to readable text. UTF-8 aware, with predictable handling of plus signs and broken sequences.

Input URL text
Output Encoded or decoded URL
Works done 3,664

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

  1. Paste the value you want to encode, or the percent-encoded text you want to decode.
  2. Leave the mode on "Auto-detect" or set it to "Encode" or "Decode".
  3. Click "Run tool" or press Ctrl + Enter.
  4. 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 20 from turning into a space on the server.
  • /, ? and # become %2F, %3F and %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:

GoalWhat to encodeResult
Search linkOnly the term red shoes & bags/search?q=red%20shoes%20%26%20bags
Return after loginThe whole target path /cart?step=2/login?next=%2Fcart%3Fstep%3D2
Share linkThe 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: %2520 is a %20 that 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%FF turns into "u with umlaut" followed by an untouched %FF.
  • A lone percent sign: text like 100% off has no valid sequence, so auto mode encodes it to 100%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.

Advertisement Clicker Alchemist — a mobile game by icyabmod, on Google Play and the App Store

Frequently asked questions

They solve different problems. URL encoding (percent-encoding) makes text safe inside a web address by replacing characters with %XX sequences, so a space becomes %20. HTML encoding makes text safe inside a web page by replacing characters with entities, so a less-than sign becomes an entity starting with an ampersand. A value that goes into a link inside an HTML attribute may need both: first URL encoding, then HTML escaping of the finished link.

Use %20 unless you are producing classic HTML form data. %20 means a space everywhere in a URL, while + only means a space in the application/x-www-form-urlencoded format that forms submit; in a URL path it stays a literal plus sign. This tool encodes spaces as %20 and does not convert + to a space when decoding, so form data with plus signs needs a quick manual replacement.

You probably encoded the entire address. Component encoding converts the colon and slashes of https:// into %3A%2F%2F, which is correct when the URL is passed as a parameter value but not when you want a clickable link. Encode only the variable parts, such as search terms, file names or IDs, and keep the scheme, domain and path separators as they are.

Run the decoder twice. A double-encoded string shows %25 where a percent sign used to be, for example %2520 instead of %20, and each run removes one layer. After the second pass you should see readable text. To stop it from happening again, look for two places in your stack that both encode the same value, such as your own code and an HTTP client library.