URL Encoder / Decoder
Encode, decode, parse, and build URLs and query strings instantly.
What is URL Encoding?
URL encoding (percent-encoding) replaces unsafe ASCII characters with a % followed by two hexadecimal digits. For example, a space becomes %20 and an ampersand becomes %26. This ensures special characters in URLs, query parameters, and form data are transmitted correctly without being misinterpreted as URL delimiters.
Common Use Cases
- •Encoding special characters in URL query parameters
- •Decoding percent-encoded strings from web server logs
- •Building API request URLs with dynamic parameters
- •Encoding form data for HTTP POST requests
- •Fixing broken links with special characters
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL, preserving characters like :, /, ?, and # that have meaning in URLs. encodeURIComponent encodes everything except letters, digits, and - _ . ~ making it suitable for individual parameter values.
Why is a space encoded as %20 or +?
In URLs, spaces are encoded as %20 (percent-encoding). In form data (application/x-www-form-urlencoded), spaces are encoded as +. Both represent a space but in different contexts.