How it works
URL encoding (percent-encoding) replaces unsafe characters with a
%
followed by two hex digits.
- encodeURIComponent - Encodes everything except
A-Z a-z 0-9 - _ . ! ~ * ' ( ). Use for query parameters. - encodeURI - Preserves URL structure characters like
: / ? # & =. Use for full URLs.
Decode reverses the encoding, converting percent-encoded characters back to their original form.
Want to learn more?
Read the complete guide with examples and tips