TEXT / BROWSER TOOL

URL encoder and decoder

Encode or decode a URL component.

Processed on your device · no account needed
Your inputStays on your device
Uses component encoding, not whole-URL encoding. Invalid escapes are rejected.
Result

Your result will appear here.

Enter your input, then run the tool.

How to use the url encoder and decoder

Prepare text for a URL parameter or decode an encoded component. The tool uses URL component encoding rather than whole-URL encoding.

Paste the text, choose encode or decode, and copy the output.

  1. Paste the text or encoded value into Input.
  2. Set Mode to encode or decode.
  3. Press Run tool, then use Copy result.
  4. To share the setup, press “Copy a link to these settings”. The link stores the mode only, never your text.

Good to know

  • Encoding uses encodeURIComponent, so spaces become %20.
  • Decoding rejects malformed percent escapes and invalid UTF-8.
  • Encoding a complete URL will also encode its separators, such as / and ?.
  • Input is limited to 500,000 characters and processed in your browser.

Examples

  • Encode rock & roll → rock%20%26%20roll.
  • Encode café → caf%C3%A9; é becomes two UTF-8 bytes.
  • Decode a+b%20c → a+b c. %20 becomes a space, but + stays a plus sign.

If something goes wrong

Invalid percent-escape at character 4. Each % must be followed by two hexadecimal digits.

A % that stands for itself must be written as %25 in encoded text. If the text was never encoded, it doesn’t need decoding.

This text contains a percent-escape sequence that is not valid UTF-8.

The value was probably encoded as Latin-1 or Windows-1252, as in %E9 for é. UTF-8 would be %C3%A9; re-encode it from the original text.

Spaces in a form value decode as + signs.

HTML forms encode spaces as +. Replace each + with %20 before decoding.

Questions

Should I paste a whole URL?

Use this for one component, such as a query value, because it encodes separators too.

Why did a plus sign stay a plus sign when decoding?

decodeURIComponent does not treat + as a space.

What happens to an invalid % code?

The tool shows an error instead of guessing the character.

Which characters stay unencoded?

Letters, digits and - _ . ! ~ * ' ( ) are left as they are. Everything else is percent-encoded as UTF-8 bytes.

Background reading: Base64, URL encoding and HTML entities: which one do you need?

Next steps: Base64 encoder and decoder · HTML entity encoder and decoder · QR code generator

Keep going