Percent-encoding, as RFC 3986 defines it
A URL may only carry a small set of ASCII characters. Anything else is converted to its UTF-8 bytes, and each byte is written as % followed by two hex digits. The euro sign is three bytes, so it becomes %E2%82%AC, and an emoji such as the grinning face becomes four bytes, %F0%9F%98%80. This tool calls the browser's own encodeURIComponent or encodeURI, depending on one checkbox.
| Mode | Left alone | Use it for |
|---|---|---|
| Component (checked) | A-Z a-z 0-9 - _ . ! ~ * ' ( ) | One query value or path segment |
| Whole URL (unchecked) | Everything above plus ; , / ? : @ & = + $ # | A complete URL that is already structured |
Worked example
Input: https://example.com/search?q=hello world&lang=fr#top café
Whole-URL mode gives https://example.com/search?q=hello%20world&lang=fr#top%20caf%C3%A9, so the structure survives and only the space and the accented letter change. Component mode gives https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Dfr%23top%20caf%C3%A9. That is correct for a value you are embedding in another URL, but it breaks a link you wanted to click.
Pitfalls specific to this tool
- Spaces are always
%20. The browser functions never emit+. The plus-for-space convention belongs to HTML form encoding, and on decode a literal+is left as a plus. To read a form-style query string, replace the plus signs with spaces yourself first. - Double encoding. Encoding an already-encoded string turns
%20into%2520, because the percent sign itself is encoded. Running Decode twice undoes it. - A bare percent sign. Decoding
100%fails with an invalid percent-encoding message, because%must be followed by two hex digits. Encode50% offfirst and it becomes50%25%20off. - The checkbox applies in both directions. Decoding in whole-URL mode deliberately leaves sequences such as
%2Fand%26encoded, since they stand for reserved characters. Switch to component mode to decode them. - Broken emoji. Text containing half of an emoji (an unpaired surrogate) cannot be encoded, and the tool shows an error instead of failing silently. Remove the stray character and try again.
- The result replaces your text in the same box, so copy the original if you want to compare.
For binary data or tokens that must survive in a URL, see Base64 encode and decode, which solves a different problem.