URL Encode and Decode

Percent-encode or decode URL text with encodeURIComponent rules. Fast, private, and browser-based.

Independently verified for accuracy

Calculator by Toolsloft ↗

Encode text so it is safe to put in a URL, or decode a percent-encoded URL back to plain text. Switch direction with one control. Encoding follows the browser rule for encodeURIComponent, so query values and path segments come out valid.

How this is calculated

Encoding uses encodeURIComponent, which leaves letters, digits, and the characters - _ . ! ~ * ' ( ) unescaped and percent-encodes everything else as UTF-8 bytes. Decoding uses decodeURIComponent and rejects malformed escapes rather than returning broken output.

How to use

  1. Pick encode or decode.
  2. Paste the URL text or component you want to convert.
  3. Copy the result. Decoding flags any malformed escapes.

Examples

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

FAQ

Which characters are left unescaped when encoding?
Letters, digits, and - _ . ! ~ * ' ( ) stay as-is, matching encodeURIComponent. Everything else, including spaces, & and =, is percent-encoded.
Why does decoding sometimes show an error?
A percent sign must be followed by two hex digits, and the decoded bytes must be valid UTF-8. Input that breaks either rule is rejected instead of guessed.
Does it convert + to a space?
No. Like decodeURIComponent, a plus sign stays a plus sign. Only %20 decodes to a space.

Embed this calculator

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