URL Encoder / Decoder
Encode text to percent-encoded URL format, or decode it back. Uses encodeURIComponent / decodeURIComponent.
How percent-encoding works
URLs can only contain a limited set of ASCII characters. Any other character — spaces, unicode, special symbols — must be percent-encoded: replaced by a % followed by the character's two-digit hexadecimal UTF-8 byte value. This encoder uses encodeURIComponent, which encodes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ).
Input
hello world & more
Output
hello%20world%20%26%20more
Common encoded characters
| Character | Encoded | Use case |
|---|---|---|
| Space | %20 | Query params, path segments |
| & | %26 | Prevents ambiguity with param separator |
| = | %3D | Prevents ambiguity with key=value syntax |
| ? | %3F | Prevents ambiguity with query string start |
| / | %2F | Prevents path splitting |
| # | %23 | Prevents fragment confusion |
| + | %2B | Plus sign (not a space in encodeURIComponent) |
| @ | %40 | Email addresses in URLs |
| Non-ASCII | %XX%YY | Multi-byte UTF-8 sequences |
Note:
encodeURIComponent does not encode the + character — it encodes space as %20. If you need application/x-www-form-urlencoded format (which uses + for space), replace %20 with + in the output.Frequently Asked Questions
Your files stay on your computer. Dad promised.