URL Encoder / Decoder

Turn spaces, Chinese characters and reserved symbols into percent-encoded text, and back again.

ready
—

How to use the url encoder / decoder

  1. Paste a URL, a query string or arbitrary text.
  2. Leave the full-URL option on to keep :/?&=# intact, or turn it off to encode everything.
  3. Click Encode or Decode — multi-line input processes line by line.
  4. Copy the result.

URLs are limited to a small set of ASCII characters. Anything outside it — a space, a Chinese character, an emoji, an ampersand inside a parameter value — has to be percent-encoded: written as % followed by the UTF-8 bytes in hex. Spaces become %20, and a space inside a query string is often written +.

Two functions do this job and choosing the wrong one is the classic bug. encodeURI preserves the characters that structure a URL — :/?&=# — so it is right for encoding a whole address. encodeURIComponent encodes those too, which is what you need for a single parameter value, otherwise & inside a value would split it into a new parameter.

What people get wrong

Decoding is lenient here: malformed percent sequences fall back to the untouched text instead of throwing, so a half-encoded string still yields something usable.

Frequently asked questions

Should I use encodeURI or encodeURIComponent?

Whole URLs: encodeURI. Individual parameter values: encodeURIComponent. The checkbox switches between them.

Why did my string become %25 something?

It was already encoded and got encoded again. Decode once, then re-encode.

Does it handle Chinese and emoji?

Yes — input is converted to UTF-8 bytes before encoding, so multi-byte characters come out as the correct percent sequences.

Is the plus sign a space?

Only in application/x-www-form-urlencoded bodies. In a URL path or query value, + is a literal plus unless the server chooses to read it as a space.

Related tools