Percent Encoding Explained โ What Are %20 and %26 in URLs?
Percent encoding replaces unsafe URL characters with %XX codes. Here is the complete guide to which characters need encoding and why.
You've seen %20 for spaces and %40 for the @ symbol. These are percent-encoded characters. The system behind this is straightforward once you understand the rules.
How percent encoding works
Percent encoding replaces a character with a percent sign followed by its two-digit hexadecimal ASCII code. Space is ASCII decimal 32, which is hex 20, so space becomes %20. The @ symbol is ASCII 64, hex 40, so it becomes %40.
The characters that are safe in URLs without encoding are:
A-Z a-z 0-9 - _ . ~
Everything else needs to be encoded when used in a URL component.
Common encoded characters you'll encounter
%20โ space%21โ ! (exclamation)%22โ " (double quote)%23โ # (hash)%24โ $ (dollar)%25โ % (percent itself)%26โ & (ampersand)%2Bโ + (plus)%2Fโ / (slash)%3Aโ : (colon)%3Dโ = (equals)%3Fโ ? (question mark)%40โ @ (at sign)
Non-ASCII characters
For characters outside the ASCII range (like Devanagari, Chinese, Arabic, or emoji), the character is first encoded as UTF-8 bytes, then each byte is percent-encoded. This means a single character can produce multiple percent-encoded sequences.
The Hindi word "เคจเคฎเคธเฅเคคเฅ" in a URL becomes: %E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87
Reserved characters: context matters
Some characters have meaning in URL structure but can appear unencoded in the right context. A forward slash / is a path separator in the path component but needs to be %2F inside a query parameter value. The rule is: encode the character if it would otherwise be misinterpreted by the URL parser.
Encode and decode any text with our URL Encoder tool.