URL encode/decode
Percent-encode and decode URLs both ways.
“Component” uses encodeURIComponent (also encodes =, &, ?); “full URL” uses encodeURI (keeps URL structure characters).
You paste a link containing a non-English search term and it arrives as a trail of %EC%A0%9C. Or a query string breaks because one value contained an &. Percent-encoding is the fix, and the only real decision is how much of the string to encode.
How it works
Three buttons, two rules
| Button | Underlying function | What it encodes |
|---|---|---|
| Encode (component) | encodeURIComponent | Everything unsafe, including = & ? / : |
| Encode full URL | encodeURI | Unsafe characters only; URL structure is left intact |
| Decode | decodeURIComponent | Turns %XX sequences back into characters |
Use component for a single piece — one query value, a path segment, a redirect target. Use full URL when you have a complete address and want the https://, the slashes and the ? left alone.
Why the distinction matters
Encoding a whole URL with the component rule produces https%3A%2F%2F..., which is exactly right when that URL is itself a parameter value (?next=https%3A%2F%2F...) and exactly wrong when you meant to keep it clickable. Choosing the wrong one is the most common reason a link "looks encoded but doesn't work".
Decoding notes
A + is treated as a space when decoding, matching how HTML forms encode spaces. If decoding fails, the input holds a lone % or an incomplete sequence such as %E1 — often from a URL that was copied only partway. Swap moves the result into the input for a second pass, which is how you unwind a double-encoded link.
Terms explained
- Percent-encoding
- Replacing a byte with `%` followed by its two-digit hex value, so it can travel safely inside a URL.
- Reserved characters
- Characters such as `? & = / #` that carry structural meaning in a URL and must be encoded when used as data.
- encodeURIComponent
- The JavaScript function that encodes a single URL piece, reserved characters included.
- encodeURI
- The function that encodes a whole URL while leaving its structural characters usable.
- Double encoding
- Encoding an already-encoded string, turning `%20` into `%2520`. Decoding twice recovers it.
Frequently asked questions
Which button should I use for a query parameter?
Encode (component). A value can legitimately contain `&`, `=` or `?`, and only the component rule escapes those. Otherwise the server reads your value as the start of a new parameter.
Why did my Korean text turn into %EC%A0%9C…?
Each character is stored as several UTF-8 bytes, and every byte becomes its own `%XX` pair — three pairs per Korean syllable is normal. Pasting the encoded string into Decode gives the original text back.
Is %20 the same as +?
Almost. `%20` means a space anywhere in a URL, while `+` means a space only inside a query string, a convention from HTML form encoding. This tool treats `+` as a space when decoding, so both work here.
My decode returns an error. What now?
The input contains a broken escape — a `%` not followed by two hex digits, usually from a URL that was cut short or wrapped across lines. Recopy the full link and try again.
What is double encoding and how do I fix it?
It happens when an already-encoded value gets encoded a second time, so `%20` becomes `%2520`. Decode once to get back to `%20`, then press Swap and decode again to reach the plain text.
Tell us what went wrong and we'll fix it fast. (Leave an email if you'd like a reply.)