Percent-encode text for URLs and query strings, or decode %20-style URLs back to text
Encode text so it’s safe inside a URL, or decode a percent-encoded URL back to readable text.
How to use it
Choose Encode or Decode. To encode, pick Component for one value, or Whole URL to keep : / ? # & as they are. Turn on + for spaces for HTML form data, then paste your text or URL, or open a file to encode its bytes. Options holds the charset (Latin-1, Windows-1252, Shift_JIS and more), Each line, and %0A or %0D%0A for line breaks. Copy or download the result. Decoding a URL with a ? also lists its query parameters under the text.
Examples
Encode a query value
café & crème
caf%C3%A9%20%26%20cr%C3%A8me
Decode a redirect parameter
%2Faccount%3Ftab%3D2
/account?tab=2
Component or Whole URL
| Input | Component | Whole URL |
|---|---|---|
a b | a%20b | a%20b |
a/b?c=d | a%2Fb%3Fc%3Dd | a/b?c=d |
é | %C3%A9 | %C3%A9 |
Character sets
| Text | UTF-8 | Windows-1252 | Shift_JIS |
|---|---|---|---|
é | %C3%A9 | %E9 | %3F (none) |
日 | %E6%97%A5 | %3F (none) | %93%FA |
Questions
- Should spaces be %20 or +?
In URLs, %20. The + form comes from HTML forms (application/x-www-form-urlencoded) and is only read as a space in query strings by servers that expect form data. - Why does decoding fail with "invalid escape"?
A % sign must be followed by two hex digits that form valid UTF-8, like %20 or %C3%A9. A bare % (e.g. "100%") has to be written as %25. A link from an older site may be in Latin-1, where é is %E9: pick that charset under Options. - Which characters does Component leave as they are?
Letters A–Z and a–z, digits and - _ . ! ~ * ' ( ). Everything else becomes % and two hex digits per UTF-8 byte, so é is %C3%A9. - Is my URL uploaded?
No. Everything runs in your browser, so your URL stays on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. That matters because URLs can contain tokens and personal data.