Developer

URL Encoding Explained: What %20 and Other Codes Actually Mean

23 Aug 2026 · 4 min read

Related tool

URL Encoder/Decoder

Open tool →

Paste a search query with a space in it into some contexts and you'll get back %20 where the space used to be. That's URL encoding (also called percent-encoding) — a set of rules for representing characters a URL isn't allowed to contain literally.

Why URLs can't contain every character

The URL specification reserves certain characters for structural meaning — ? separates the path from the query string, & separates query parameters, # marks a fragment. If your actual data (a search term, a filename, a parameter value) contains one of these characters literally, it would be misread as part of the URL's structure instead of as data. Spaces aren't allowed in URLs at all. Percent-encoding solves both problems by representing the character as % followed by its hex byte value.

Common encodings you'll see

  • %20 — space (you'll also see + used for spaces specifically inside query strings)
  • %2F — forward slash /
  • %3F — question mark ?
  • %26 — ampersand &
  • %23 — hash #

When you need to encode something yourself

Most modern browsers and frameworks encode URLs automatically as you type or submit a form, which is why you rarely think about this. You need to encode manually when building a URL programmatically — for example, putting a user's search term or a file name containing spaces or special characters directly into a query string or API request.

Encode or decode a URL

Our URL Encoder/Decoder converts either direction instantly in your browser. Working with binary data instead of URL text? The Base64 Encoder/Decoder solves a related but different problem — making arbitrary data safe for plain-text contexts, not specifically URLs.