Complete Guide to URL Encoding (Percent-Encoding)
What is URL Encoding?
URL Encoding, officially known as Percent-Encoding, is a mechanism used to encode information in a Uniform Resource Identifier (URI). The Internet operates on strict protocols, and URLs can only be transmitted over the Internet using the US-ASCII character set.
If your URL contains characters outside the ASCII set (like emojis or foreign languages), or if it contains "reserved" characters that have special meaning in URLs (like spaces, `&`, `=`, `?`, or `#`), those characters must be converted into a valid ASCII format. This tool instantly performs that conversion.
Reserved vs Unreserved Characters
When dealing with URLs, characters are divided into two groups:
- Unreserved Characters: Letters (`A-Z`, `a-z`), numbers (`0-9`), hyphens (`-`), underscores (`_`), periods (`.`), and tildes (`~`). These do not need to be encoded.
- Reserved Characters: Characters like `! * ' ( ) ; : @ & = + $ , / ? % # [ ]`. These characters serve specific structural purposes in a URL (e.g., `?` starts a query string, `&` separates parameters). If you want to pass these characters as data rather than structure, they must be percent-encoded.
How Percent-Encoding Works
When a character is encoded, it is replaced by a percent sign `%` followed by its two-digit hexadecimal equivalent. For example:
- A space ` ` becomes `%20` (or `+` in query strings)
- An ampersand `&` becomes `%26`
- An equals sign `=` becomes `%3D`
- A question mark `?` becomes `%3F`