How to use
- Choose Encode or Decode, then type or paste your text or link.
- When encoding, pick what it is for: a part of a URL (one query value or path segment), a whole URL, or form data.
- When decoding, choose whether + means a space. It does in query strings.
- Copy the result. Links with a query string also get a table of every parameter, decoded.
Everything runs in your browser, so links with tokens or personal details stay private.
How percent-encoding works
A URL may only contain certain characters. Anything else is turned into UTF-8 bytes, and each byte is written as % plus two hex digits (RFC 3986). A space is byte 20, so it becomes %20; é is two bytes, %C3%A9.
- Never encoded: A–Z, a–z, 0–9 and
- . _ ~. - Delimiters such as
/ ? # & =are kept in a whole URL but encoded inside one value, so they can’t break it apart. - % itself becomes
%25.
Examples
| Character | Part of a URL | Whole URL | Form data |
|---|---|---|---|
| space | %20 | %20 | + |
| & | %26 | & | %26 |
| / | %2F | / | %2F |
| ? | %3F | ? | %3F |
| + | %2B | + | %2B |
| é | %C3%A9 | %C3%A9 | %C3%A9 |
| ~ | ~ | ~ | %7E |
“Hello World & Friends?” encoded as a part of a URL is Hello%20World%20%26%20Friends%3F. As form data it is Hello+World+%26+Friends%3F.
%2520, + signs and which mode JavaScript uses
- %2520 means the text was encoded twice: % became %25. Decode once to get %20, then again to get the space. RFC 3986 warns never to encode a string twice.
- Part of a URL matches JavaScript’s
encodeURIComponent, and whole URL matchesencodeURI. Form data matchesURLSearchParamsand HTML forms (the WHATWG URL Standard). - Bad input such as
%zzor a broken byte sequence is reported with its position, instead of a bare “URI malformed”.
Want to share the finished link on paper or a screen? Turn it into a code with the QR code generator.