URL Encode / Decode

Percent-encode text for URLs or decode encoded strings back to plain text, all in your browser.

Independently verified for accuracy

Calculator by Toolsloft ↗
Result
hello%20world

Encode text so it is safe to drop into a URL, or decode a percent-encoded string back to plain text. Encoding uses component rules, so characters like spaces, slashes, ampersands, and equals signs are escaped, which is what you need for query values and path segments. Decoding turns %20 and similar sequences back into the original characters.

How this is calculated

Encoding applies encodeURIComponent, which percent-encodes every character outside the unreserved set A-Z, a-z, 0-9 and - _ . ! ~ * ( ), using UTF-8 byte sequences. Decoding reverses valid percent-encoding and reports an error when a % is not followed by two hexadecimal digits.

How to use

  1. Paste the text or encoded string into the box.
  2. Choose encode or decode.
  3. Copy the converted result below.

Examples

  • Encode: "hello world" → hello%20world
  • Decode: caf%C3%A9 → café

FAQ

Which characters get encoded?
Everything except letters, digits, and a small set of unreserved marks is percent-encoded, including spaces, slashes, ampersands, and equals signs. This matches encodeURIComponent, which is right for query values and path segments.
Why does decoding sometimes fail?
Decoding fails when the input contains a percent sign that is not followed by two valid hexadecimal digits, since that is not a valid escape sequence.
Are non-English characters supported?
Yes. Characters are encoded and decoded using UTF-8, so accented letters and other scripts round-trip correctly.

Embed this calculator

Add this free calculator to your own site. Copy the code and paste it where you want it to appear.