Ad
INPUT
OUTPUT
Common use cases
- Encode query parameters for API calls
- Decode URLs from server logs
- Fix double-encoded URLs
- Build OAuth redirect URIs
Frequently asked questions
What is URL encoding?
URL encoding (percent encoding) replaces special characters with a percent sign and two hex digits, keeping URLs valid when they contain spaces, slashes, or non-ASCII characters.
When should I use encodeURIComponent vs encodeURI?
encodeURIComponent is for individual values inside a URL (query string values, path segments). encodeURI is for whole URLs and preserves URL syntax characters like / and ?.