FREE ONLINE TOOL

URL Encoder & Decoder

Percent-encode URL components or decode an encoded link in your browser. One page handles both directions, with the same result you would get from JavaScript.

URL Component mode escapes every reserved character, which is what a query string value needs.
Text that is already encoded is encoded a second time if you run it again: %20 becomes %2520. Decode it first when you are not sure.

Free Online URL Encoder and Decoder

A URL can only carry a limited set of characters. Anything else, such as a space, an ampersand inside a value or a letter with an accent, has to be written as a percent escape: a percent sign followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26 and e with an acute accent becomes %C3%A9.

This page encodes and decodes those escapes in the browser with the same functions a developer would call: encodeURIComponent(), encodeURI(), decodeURIComponent() and decodeURI().

How to encode or decode a URL

  1. Choose Encode or Decode.
  2. Choose URL Component for a single value such as a search term, or Full URL to keep the structure of a complete address.
  3. Paste the text into the input box, or click Load Example to see a realistic value.
  4. Click Encode or Decode, then copy the result or swap it back into the input to check a round trip.

Component encoding and full URL encoding

URL Component mode uses encodeURIComponent(), which escapes every character that is not allowed inside a query value, including the reserved characters / ? : & = + # and the percent sign itself. Use it for the value you are about to place in a query string parameter, because a raw ampersand inside a value would otherwise be read as the start of the next parameter.

Full URL mode uses encodeURI(), which keeps the characters that give a URL its structure (: / ? & = #) and escapes only the parts that are genuinely illegal, such as spaces and non-ASCII characters. Use it when the input is already a complete address and the spaces are the only thing to fix.

Reserved characters and why they are encoded

Some characters carry a structural meaning in a URL. The colon separates the scheme, the slashes separate the authority from the path, the question mark starts the query, the ampersand separates parameters and the hash starts the fragment. When one of them appears inside a value it has to be percent-encoded, so the parser does not read it as structure.

Other characters are simply not allowed anywhere in a URL, including spaces, quotation marks, angle brackets, braces and the caret. Non-ASCII characters are either percent-encoded as their UTF-8 bytes or, in modern browsers, sent as they are and displayed as Unicode.

Avoiding double encoding

Encoding text that is already encoded turns the percent sign of every escape into %25. A single space becomes %2520, and a decoder that runs once still shows %20 in the output. This page warns you when the input already contains a percent escape, so you can tell whether the second pass was intended.

Decoding twice is the same problem in reverse: %2520 becomes %20 and then a space. Keep a copy of the original value while you debug a link, and check whether a parameter was already decoded by the framework that produced it.

Are my URLs sent anywhere?

No. Encoding and decoding run in your browser, so tracking links, signed URLs with tokens and internal addresses stay on your machine. Nothing is uploaded and nothing is logged.

Frequently Asked Questions

What is the difference between a plus sign and %20?

In a URL path and query, a space is written as %20, and that is what encodeURIComponent() produces. In an HTML form submission with the application/x-www-form-urlencoded content type, a space is written as + instead. Both appear in the wild, so use %20 unless the system you are talking to expects form encoding.

Why did decoding fail on my string?

A percent sign has to be followed by two hexadecimal digits. A string with a lone percent sign, such as 100% off, is not valid percent encoding. The decoder reads everything it can, leaves the malformed part unchanged and reports what it found instead of refusing to work.

Should I encode a whole URL or only the parameters?

Encode each parameter value on its own with URL Component mode. Percent-encoding a whole URL also escapes the slashes and the query separator, which breaks the address. Full URL mode fixes illegal characters while leaving the structure readable.