Advertisement

URL Encoder / Decoder

Percent-encode special characters for safe URLs, or decode encoded strings back to readable text.

Advertisement

How to Use This Converter

Choose encode or decode, paste the text and convert. The query-string option encodes spaces and slashes too — ideal for parameters.

  • Use encodeURIComponent when passing values inside query strings.
  • Decoding is automatic and safe to apply to any URL string.

Frequently Asked Questions

Why do spaces become %20?

Spaces aren't allowed in URLs, so they're encoded as %20 (the hex value of the space character). The plus sign is an older alternative.

EncodeURIComponent vs encodeURI?

encodeURIComponent escapes nearly everything (good for parameter values); encodeURI preserves reserved characters like / and ? (good for whole URLs).

Is percent-encoding reversible?

Yes — decoding maps every %XX back to its original character, and this tool handles multi-byte UTF-8 correctly.

What about UTF-8 characters?

Non-ASCII characters are encoded as their UTF-8 byte sequences, each byte shown as %XX.

Practical Example

With "Encode for query string" checked, encode a b&c and the output is a%20b%26c — the space becomes %20 and the ampersand becomes %26.

  • Decoding a%20b%26c returns a b&c, proving the round trip is exact.
  • Non-ASCII text is encoded per UTF-8, so café becomes caf%C3%A9.
  • With the query-string option off, reserved characters like / and ? stay unencoded (encodeURI behavior).

What Your Results Mean

  • Percent-encoding — each unsafe character is replaced by % followed by its two hex digits, such as %20 for a space.
  • Query-string mode — encodes nearly every reserved character, ideal for parameter values.
  • UTF-8 bytes — one or more %XX groups represent the multi-byte encoding of a single non-ASCII character.

Trusted Sources

Advertisement