Encode query parameters, decode percent-encoded strings, or encode a full URL while preserving its structure.
Encodes a query parameter or path segment — escapes all reserved characters including /, ?, #, &.
encodeURIComponentEncodes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ). Use for individual query parameter values or path segments — it will escape / ? & = #.
encodeURIPreserves URL-structural characters : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Use when you have a full URL and want to encode only the unsafe characters.
decodeURIComponentReverses percent-encoding for any encoded string. Throws on malformed sequences like %ZZ. Use to read back values that were encoded with either encodeURI or encodeURIComponent.
| Char | Encoded | Description |
|---|---|---|
(space) | %20 | Space |
! | %21 | Exclamation mark |
" | %22 | Double quote |
# | %23 | Hash / fragment |
$ | %24 | Dollar sign |
% | %25 | Percent sign |
& | %26 | Ampersand |
' | %27 | Single quote |
( | %28 | Open parenthesis |
) | %29 | Close parenthesis |
* | %2A | Asterisk |
+ | %2B | Plus sign |
, | %2C | Comma |
/ | %2F | Forward slash |
: | %3A | Colon |
; | %3B | Semicolon |
= | %3D | Equals sign |
? | %3F | Question mark |
@ | %40 | At sign |
[ | %5B | Open bracket |
] | %5D | Close bracket |
{ | %7B | Open brace |
| | %7C | Pipe |
} | %7D | Close brace |