URL Encoder & Decoder (Percent Encoding)

Make a string safe to put in a query parameter, or decode a %E2%9C%93-style URL back to something readable. Runs in your browser; no data is transmitted.

What percent-encoding is

URLs can only contain a limited set of ASCII characters. Anything else — spaces, non-Latin letters, and reserved characters like ?, &, =, # and / that have structural meaning — must be written as % followed by the two-digit hexadecimal value of each UTF-8 byte. A space becomes %20, & becomes %26, and é becomes %C3%A9.

Component encoding vs. full-URL encoding

This tool uses component encoding only (JavaScript's encodeURIComponent), which is right for a single value that goes inside a query string or path segment: it encodes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ). It has no full-URL mode (encodeURI, which leaves :/?#&= intact), so pasting a complete URL encodes its colon and slashes too and breaks it. Encode just the value, then place it after ?q= yourself.

The plus sign problem

HTML form submissions (application/x-www-form-urlencoded) encode spaces as + rather than %20. This tool always writes a space as %20 and a literal + as %2B, which is what you want when a plus must survive a query string. When decoding, + stays a plus sign; there is no form-encoding toggle, so replace plus signs with spaces yourself first if the text came from a form.

How to use it

  1. Paste the text into the input box.
  2. Choose Encode or Decode and press Process.
  3. Copy the result. Decoding reports an error if the input has a stray % or invalid UTF-8; double-encoded text needs one pass per layer.

Example

Encoding the search phrase café & crème 50% off as a query parameter value gives:

caf%C3%A9%20%26%20cr%C3%A8me%2050%25%20off

Each accented letter becomes two bytes (%C3%A9), the ampersand becomes %26 so it is not read as a parameter separator, and the literal percent sign becomes %25.

Common use cases

What this tool does, exactly

The tool has two modes, Encode and Decode, and a single Process button. Encode applies JavaScript's encodeURIComponent to the whole input and Decode applies decodeURIComponent. There is no separate full-URL mode and no form-encoding toggle, so use it for individual values rather than complete URLs.

That is why pasting https://example.com/a b?x=1&y=ü and pressing Encode gives https%3A%2F%2Fexample.com%2Fa%20b%3Fx%3D1%26y%3D%C3%BC: even the colon and slashes are encoded. Encode only the value, then place it after ?q= yourself.

Worked examples

a+b=c d/e?f#g becomes a%2Bb%3Dc%20d%2Fe%3Ff%23g. Note the plus sign: it is written as %2B, which is exactly what you need when a literal plus must survive a query string. A space becomes %20, never +. Non-Latin text is encoded as UTF-8 bytes, so 日本 becomes %E6%97%A5%E6%9C%AC.

The characters A-Z a-z 0-9 - _ . ! ~ * ' ( ) are left as they are, so an input such as it's (ok) comes out as it's%20(ok). Some strict parsers expect ' and parentheses to be encoded as well; if yours does, replace them by hand with %27, %28 and %29.

Decoding problems

Decode shows an error such as URI malformed when the input contains a % that is not followed by two hex digits (for example 100%) or a byte sequence that is not valid UTF-8. Encode a bare percent sign as %25 before decoding such text.

Decode does not turn + into a space: a+b%20c decodes to a+b c. If the text came from an HTML form, replace the plus signs with spaces first. Double-encoded text such as %2520 decodes only one layer per pass, to %20, so press Decode again until the result stops changing.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent escapes every reserved character and is for individual values; this tool uses it. encodeURI leaves URL structure characters (: / ? # & =) alone and is for whole URLs, but this tool does not offer it.

Why is my decoded string still full of % signs?

It was encoded more than once. Press Process again in Decode mode; each pass removes one layer of encoding.

Should spaces be %20 or +?

In paths and most query strings use %20. The + convention only applies to form-encoded bodies and is interpreted as a space by servers parsing form data.

Does this tool send my URLs anywhere?

No. Encoding and decoding run entirely in your browser.

Can it encode a whole URL and keep the slashes?

No. The tool always encodes every reserved character, including : / ? # & and =. Encode just the parameter value, or build the URL around it.

Why does decoding my text keep the plus signs?

Decoding follows percent-encoding rules only, in which + is an ordinary character. Replace + with a space yourself if the text came from a form submission.

Related tools

Explore all developer tools →