$url-encoder
Encoders
Encode or decode URL strings. Compare encodeURIComponent vs encodeURI output side by side. Everything runs in your browser.
Mode:
Encodes all special characters. Use for query parameter values.
Output will appear here
Preserves :, /, ?, #, &, =. Use for full URLs.
Output will appear here
When to use which?
- encodeURIComponent
- Encodes everything except
A-Z a-z 0-9 - _ . ! ~ * ' ( ). Use this when encoding a value inside a query string, path segment, or fragment. - encodeURI
- Leaves structural characters intact:
: / ? # [ ] @ ! $ & ' ( ) * + , ; =. Use this when encoding an entire URL that may contain non-ASCII characters but already has valid structure.