How percent encoding works
A URL may only contain a limited set of ASCII characters. Everything else is written as %HH, where HH is the byte value in hexadecimal. A space becomes %20, an ampersand becomes %26 and an equals sign becomes %3D, which is why hello world&x=1 turns into hello%20world%26x%3D1. Non-ASCII characters are encoded as their UTF-8 bytes, so a single accented letter often produces two percent groups.
If you want a different flavour of the same thing, try the Base64 encoder.
How to use this encoder
Type the value you want to place inside a query string and copy the encoded result. The tool uses encodeURIComponent(), which is the right function for a single parameter value: it escapes &, =, ?, # and / so they cannot break the surrounding URL structure. To reverse it, use the URL decoder.
Encode each parameter value on its own, never the whole URL, otherwise the separators that hold the address together get escaped as well. The text you type stays in your browser and is never uploaded.
The slug generator covers the same ground with a different mechanism.
Characters that are never encoded
The unreserved characters pass through untouched:
| Group | Characters |
|---|---|
| Letters | A-Z and a-z |
| Digits | 0-9 |
| Marks | - _ . ! ~ * ' ( ) |
Everything else is escaped. If you also need to embed the value in HTML, run it through the HTML encoder.
Encode the value before joining it to the query string, not after, and encode only once — a stray second pass turns %20 into %2520 and the space comes back as literal text.
Frequently asked questions
- What is hello world encoded for a URL?
- It becomes hello%20world, because a space is byte 0x20.
- What is the difference from encodeURI?
- encodeURI keeps URL structure characters such as & and = intact. This tool uses encodeURIComponent, which escapes them, and that is what you want for a parameter value.
- Why do accented letters produce two percent groups?
- They are encoded as UTF-8, and most accented characters take two bytes, so you get two %HH groups.
- Should a space become %20 or a plus sign?
- Use %20 in paths and modern query strings. The plus form only applies to HTML form data sent as application/x-www-form-urlencoded.
- Does encoding happen on your servers?
- No. The tool calls a JavaScript function in your own browser, so the text you type is never uploaded, logged or stored. Parameter values holding API keys or personal data stay on your device.