URL Encoder

Spaces, ampersands and non-ASCII characters break URLs. Percent-encoding fixes that, but the rules differ for a whole URL and a single parameter value. Pick the mode that matches where the text will be used.

How to use the URL Encoder

  1. Choose encode or decode.
  2. Select component or full URL mode.
  3. Paste the text and copy the result.

Formula

%20 for a space; encodeURIComponent also escapes / : ? & = +

Worked examples

a b&c
a%20b%26c

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps URL structure characters such as / and ?; encodeURIComponent escapes them.

Why is a space sometimes written as +?

That is form encoding for application/x-www-form-urlencoded data, common in HTML forms.

Does decoding ever fail?

Yes, if the string contains a stray % or an invalid byte sequence; the tool reports the error.