URL Encoder & Decoder

Encode text for use in a URL, or decode percent-encoded text back to readable characters. The input never leaves your browser.

Mode
Encoding type

0 characters · 0 bytes (UTF-8)

0 characters · 0 bytes (UTF-8)

Type or paste to convert. Your input never leaves your browser.

URL encoding, also called percent-encoding, replaces each character that isn't allowed in a URL, or that has a special meaning there, with a % followed by two hexadecimal digits for every byte of its UTF-8 form. A space becomes %20 and é becomes %C3%A9. Without it, a space would break the address, and an & inside a value would split one query parameter into two.

This tool converts both ways, explains malformed input, and splits full URLs into their parts. It runs on this page, so your input never leaves your browser.

Component or full URL?

Component mode encodes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for one piece of a URL, such as a query value: encodeURIComponent("a b&c=d/e") gives a%20b%26c%3Dd%2Fe, so the & = and / can't be mistaken for structure.

Full URL mode keeps the characters that give a URL its structure (; , / ? : @ & = + $ #). Use it on a complete address: encodeURI("a b&c=d/e") gives a%20b&c=d/e.

+ or %20 for spaces?

%20 is a space anywhere in a URL. A + is a space only in form-encoded data (application/x-www-form-urlencoded), which HTML forms send; in a path, + is a plus sign. So a b becomes a%20b by default, or a+b with “Encode spaces as +”. When decoding form data, tick “Treat + as a space”; a real plus sign there is %2B.

How to use

  1. Choose Encode or Decode, then Component or Full URL.
  2. Type or paste into Input; the output updates as you type. Swap sends the output back and switches the mode.
  3. For form data, tick “Treat + as a space” when decoding, or “Encode spaces as +” when encoding.
  4. Tick “Convert each line separately” to convert a list, one value per line, keeping the line breaks.
  5. For a full URL, the Parse URL panel lists its parts and query parameters.

Features

Common uses

Frequently asked questions

Why does a space become %20?

A space isn't allowed in a URL, so it's replaced by its byte value in hexadecimal: byte 32 is 20 in hex. Each UTF-8 byte becomes a % and two hex digits, so é, which takes two bytes, becomes %C3%A9.

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent is for one part of a URL and also encodes separators such as / ? & = and #. encodeURI is for a whole URL and leaves them alone. Using encodeURI on a single value is a common bug: an & in the value then starts a new parameter.

Why do I see %25 in my URL?

%25 is an encoded % sign. %2520 where you expected %20 means a value was encoded twice: the second pass turned the % of %20 into %25.

When should I encode twice?

Almost never. Encode each value once, when you put it into the URL. Accidental double encoding shows up as %25, and the receiving side, which decodes once, sees %20 instead of a space.

Which characters never need encoding?

Letters A–Z and a–z, digits 0–9 and - _ . ~ are safe anywhere in a URL. encodeURIComponent also leaves ! * ' ( ) as they are.

Is my data uploaded?

No. Everything runs in your browser, and what you type is never sent to a server or saved. Like the rest of the site, the page records a visit when it loads, but not your input.

Why does decoding fail on a lone %?

A % must be followed by two hexadecimal digits. A lone %, or one followed by other characters as in %zz, can't be decoded, and neither can invalid UTF-8 such as %E2%82, which is cut short. The tool shows where the first bad sequence is. For a literal %, write %25.

Related tools

Need to test a whole website, not just a snippet?

RoboQA tests real pages and user journeys in a browser: logins, forms, clicks and full flows. See what RoboQA can test or compare plans.