Skip to content
toolgrid

No tool found. Try another word.

URL Encoder

Percent-encode text for URLs and query strings. Choose between encoding everything or keeping the URL structure, with spaces as %20 or +.

URL Decoder

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the URL Encoder

  1. 1 Type or paste the text or URL.
  2. 2 Choose "Everything" for a value inside a query string, or "Keep URL structure" for a whole URL.
  3. 3 Copy the encoded result.

About the URL Encoder

URLs may only contain a limited set of characters. Everything else, such as spaces, accents and characters with a special meaning like & and ?, has to be percent-encoded: each byte is written as % followed by two hexadecimal digits. A space becomes %20 and é becomes %C3%A9, its two UTF-8 bytes.

"Everything" encodes all characters except letters, digits and - _ . ! ~ * ' ( ), just like JavaScript’s encodeURIComponent. Use it for a single value in a query string, a path segment or a form field. "Keep URL structure" also keeps ; , / ? : @ & = + $ #, like encodeURI, so a whole URL stays a working URL.

HTML forms traditionally encode spaces as + instead of %20 (application/x-www-form-urlencoded). Turn on "Spaces as +" when you build such form data by hand. Decoding works the other way with the URL Decoder.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent encodes characters such as / ? & = too, because inside a value they would break the URL. encodeURI leaves them alone, so it is meant for a complete URL.

Should spaces be %20 or +?

%20 is correct everywhere in a URL. + only means a space in query strings and form data, so use it only there.

Why does é become two codes?

URLs are encoded as UTF-8, where é takes two bytes (C3 and A9). Each byte gets its own %XX.

Which characters are never encoded?

Letters A–Z and a–z, digits 0–9 and - _ . ! ~ * ' ( ) are always left as they are.