URL Encoder / Decoder

Percent-encode and decode URLs, with component and full-URI modes

Runs entirely in your browser. Your data never leaves this device.

Input
Output

How to use it

  1. Paste a URL or a single value into the input panel.
  2. Pick Encode or Decode, then choose Component or Full URI depending on whether you are handling one value or a complete address.
  3. Copy the result. Conversion is instant and happens on your device.

What percent-encoding is for

A URL is not free-form text. It has structure โ€” scheme, host, path, query, fragment โ€” and a small set of characters carries that structure: / separates path segments, ? starts the query, & separates parameters, # starts the fragment. The moment a value inside the URL contains one of those characters, the structure becomes ambiguous. A search term containing & would silently split into two query parameters.

Percent-encoding resolves the ambiguity by replacing a problem character with % followed by its byte value in hexadecimal. A space becomes %20, & becomes %26, / becomes %2F. The parser then sees only structural characters where structure was intended, and escapes everywhere else.

For anything outside ASCII the process has an extra step. The character is first encoded to UTF-8, which may produce several bytes, and each byte is then percent-encoded individually. That is why รง becomes %C3%A7 and an emoji can expand to four escapes. It also explains occasional mojibake: if one side assumes UTF-8 and the other assumes Latin-1, the bytes survive the round trip but are reassembled into the wrong characters.

Component versus full URI โ€” the distinction that causes bugs

Two different jobs need two different escape sets, and mixing them up is the most common URL bug there is.

Component mode โ€” JavaScript's encodeURIComponent โ€” assumes you are encoding one value that will be dropped into a larger URL. It escapes /, ?, &, =, #, + and everything else that is not unreserved. This is what you want for a query parameter value or a path segment.

Full-URI mode โ€” encodeURI โ€” assumes you already have a complete URL and only want to clean up characters that are illegal anywhere, such as spaces and non-ASCII. It deliberately leaves /, ?, &, = and # untouched so the address keeps working.

Using full-URI mode on a value is the bug: a redirect target containing ?next=/home gets embedded raw and the query breaks. Using component mode on a whole URL is the other side of the same mistake โ€” https%3A%2F%2Fexample.com is no longer a link.

Double encoding

If you see %2520 in a URL, something encoded %20 a second time: the % became %25 and the 20 came along for the ride. This usually happens when a value is encoded by application code and then again by a framework or proxy. The fix is not to decode twice at the far end โ€” it is to find the layer doing the redundant encoding, because the double-encoded form will break any consumer that decodes once, as it should.

Frequently asked questions

What is the difference between component and full-URI mode?

Component mode (encodeURIComponent) escapes everything that is not unreserved, including `/`, `?`, `&` and `=`. Use it for a single query value. Full-URI mode (encodeURI) leaves structural characters intact so a complete URL stays usable.

Should a space become %20 or +?

In a path, always `%20`. In a query string, both are accepted — `+` comes from the older form-encoding rules. This tool produces `%20`; if you are building `application/x-www-form-urlencoded` data, `+` is the conventional choice.

Why does my encoded URL have %25 in it?

`%25` is an encoded `%`, which usually means the text was encoded twice. Decode once and check whether the result already looks correct before encoding again.

Do Turkish or other non-ASCII characters work?

Yes. Non-ASCII characters are first encoded as UTF-8 bytes, then each byte is percent-encoded. So `ç` becomes `%C3%A7` — two bytes, two escapes.

What are unreserved characters?

`A–Z`, `a–z`, `0–9`, and `-`, `.`, `_`, `~`. RFC 3986 guarantees these never need escaping, so a correct encoder leaves them alone.

Last updated: