Back to Blog
Developer Tools

Percent Encoding Explained โ€” What Are %20 and %26 in URLs?

2026-06-03 4 min read

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.

url percent-encoding special-characters http

More Articles