URL Encode

Percent-encode text so it is safe inside a URL, with three modes for different parts of the URL.

Text
URL-encoded
Runs locally in your browser

About the URL Encode

A URL may contain only a limited set of characters, so spaces, ampersands, slashes and non-ASCII text have to be percent-encoded. Which characters need encoding depends on where the text goes, and this tool gives you the three cases. Component mode (the JavaScript encodeURIComponent) encodes everything that is special in a query value, including &, =, / and ?; use it for a single parameter value.

Full-URL mode (encodeURI) leaves the structural characters of a URL alone, so you can encode a whole address that contains spaces or accents without breaking its slashes and query separators. Form mode encodes like a submitted HTML form, turning spaces into +, which is what application/x-www-form-urlencoded bodies use.

All three encode non-ASCII text as UTF-8 percent-escapes, so café becomes caf%C3%A9, which every server understands. The URL Decode tool reverses any of them.

How to use

  1. Paste the text on the left.
  2. Choose the mode for where the text will go: a single value, a whole URL, or a form body.
  3. Copy the encoded output.

Common questions

Which mode should I use for a query parameter?
Component mode. It encodes &, = and / so the value cannot be mistaken for URL structure.
Why is a space sometimes %20 and sometimes +?
%20 is standard percent-encoding; + is the form-encoding convention. Servers accept both in query strings, but only %20 is valid in a path.
Does it encode accented characters correctly?
Yes, as UTF-8 percent-escapes, which is the modern standard.