To URL-encode a value, paste it in the input and pick encodeURIComponent for query parameter values, or encodeURI to preserve URL structure characters like / and ?.
Input
Output
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den
// faq
Frequently asked questions
- What is URL encoding?
- URL encoding (percent-encoding) replaces reserved and non-ASCII characters with % followed by two hex digits. It ensures URLs and query strings can be safely transmitted in HTTP.
- When should I URL-encode a value?
- Encode user input placed in query parameters, path segments, form data (application/x-www-form-urlencoded), or fragments. Never manually concatenate raw user text into a URL.
- What is the difference between encodeURI and encodeURIComponent?
- encodeURI preserves URL structure characters like /, ?, and #. encodeURIComponent escapes them because it treats the input as a single value. Use encodeURIComponent for query parameter values.
- Is my data sent anywhere?
- No. This tool runs entirely in your browser — the encoding and decoding is native JavaScript. No requests, no logs, no telemetry.
// related

