URL Encoder / Decoder
Mode:
Scope:
Input
0 chars
Encoded Output
0 chars
encodeURIComponent — Encodes all characters except:
A–Z a–z 0–9 - _ . ! ~ * ' ( ). Best for encoding individual query parameters or path segments.How It Works
URL encoding (percent-encoding) converts characters that are not safe for use in URLs into a %XX format, where XX is the hexadecimal value of the character’s UTF-8 byte(s).
When to use which mode
| Mode | Function | Safe characters (not encoded) |
|---|---|---|
| encodeURIComponent | Encode a single query param or path segment | A–Z a–z 0–9 - _ . ! ~ * ' ( ) |
| encodeURI | Encode a full URL, preserving its structure | All of the above + ; , / ? : @ & = + $ # |
Common encoded characters
| Character | Encoded | Use case |
|---|---|---|
| Space | %20 | Separates words in a path |
& | %26 | Ampersand in query value |
= | %3D | Equals sign in query value |
+ | %2B | Plus sign in query value |
# | %23 | Hash character in URL |
? | %3F | Question mark in URL |
Encode HTML entities → HTML Entity Encoder Convert encodings → Universal Encoder/Decoder
