URL encoding (percent-encoding) is a mechanism for encoding information in a Uniform Resource Identifier (URI). It replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits representing the character's byte value.
Defined in RFC 3986, percent-encoding is essential for transmitting data in URLs, especially when the data contains characters that have special meaning in URI syntax (such as &, =, ?, and #) or non-ASCII characters like accented letters and emoji.
API Development
Encode query parameters and path segments for API requests
Web Scraping
Decode extracted URLs and handle encoded characters
SEO
Ensure URLs are properly encoded for search engine crawlers
Debugging
Decode and inspect URL parameters during troubleshooting
What is URL encoding?
URL encoding, also called percent-encoding, replaces unsafe characters in a URL with a '%' followed by two hexadecimal digits. For example, a space becomes '%20' and '&' becomes '%26'. This ensures URLs are transmitted correctly over the internet.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URI but preserves characters like ':', '/', '?', and '&' that have special meaning in URLs. encodeURIComponent encodes everything except letters, digits, and a few special characters (- _ . ! ~ * ' ( )), making it ideal for encoding query parameter values.
When should I URL-encode data?
You should URL-encode data whenever you include user input or special characters in URL query parameters, form data, or path segments. Common scenarios include API requests, form submissions, and building dynamic URLs.
Why are spaces encoded as %20 instead of +?
The '%20' encoding follows the RFC 3986 standard for URIs. The '+' encoding for spaces comes from the application/x-www-form-urlencoded format used in HTML forms. Both are valid in query strings, but '%20' is the standard for general URL encoding.
Can I parse and rebuild a full URL with this tool?
Yes! The URL Parser tab lets you paste any URL and breaks it down into protocol, host, path, query parameters, and fragment. You can edit individual query parameters and the tool rebuilds the complete URL for you.
Privacy First
All encoding and decoding happens in your browser. Your data never leaves your device.