← Back to home

Percent Encoding Explained: What Those %20 Characters Mean

Published on Nov 10, 2026 · Updated Nov 15, 2026 · 4 min read

Percent encoding — also called URL encoding — is the rule that replaces any character a URL cannot safely carry with a percent sign followed by two hexadecimal digits. A space is byte 32, which is 0x20 in hex, so it becomes %20. Servers decode these sequences automatically, which is why an encoded query string still works when you paste it into a browser.

Want to try it right now? The free URL encoder and decoder runs entirely in your browser — paste a value, hit encode, and copy the result.

Ever copied a link and seen search?q=elden%20ring%20build in the address bar? Those %20 chunks aren't garbage — they're percent-encoding, the system that lets URLs carry characters they were never designed for. Understanding it takes ten minutes and saves hours of debugging broken links.

Why URLs Need Encoding at All

The URL specification reserves certain characters for structure: ? starts the query string, & separates parameters, # jumps to an anchor, / splits path segments. When your data contains those same characters, the server can't tell structure from content. A search for "salt & pepper" becomes two parameters: "salt " and a mangled "pepper".

Percent-encoding solves this by replacing any unsafe byte with % followed by its hexadecimal value. A space (byte 32, hex 20) becomes %20. An ampersand becomes %26. Non-ASCII text like Chinese or emoji gets UTF-8 encoded first, then each byte percent-encoded — which is why encoded URLs with international text look so long.

Which Characters Are Actually Safe?

The "unreserved" set that never needs encoding is smaller than people think: A-Z a-z 0-9 plus - _ . ~. Everything else — spaces, slashes inside values, plus signs, non-English text — should be encoded when it appears inside a parameter value. When in doubt, encode: servers decode it transparently.

Percent Encoding Reference Table

Inside a parameter value, these are the ASCII characters that have to be replaced. Each encoded form is just the character's ASCII code written in hexadecimal, prefixed with a percent sign.

CharacterEncodedCharacterEncodedCharacterEncoded
space%20+%2B?%3F
!%21,%2C@%40
"%22/%2F[%5B
#%23:%3A]%5D
$%24;%3B{%7B
%%25=%3D}%7D
&%26'%27\%5C

One result surprises people: searching for C++ tutorial becomes C%2B%2B%20tutorial, not C++%20tutorial. A raw + in a query string is read as a space, so the plus signs have to be encoded as %2B. The same logic explains why a search for "salt & pepper" works only when the ampersand is written %26.

Encoding and Decoding in Practice

The URL encoder/decoder on this site does the job locally in your browser:

  1. Paste the parameter value (not the whole URL — more on that below) into the input.
  2. Click Encode →. "Elden Ring: Shadow of the Erdtree" becomes Elden%20Ring%3A%20Shadow%20of%20the%20Erdtree.
  3. Drop that into your query string: ?q=Elden%20Ring%3A...
  4. To read an encoded URL, paste it and click ← Decode — full URLs decode fine.

The Whole-URL Mistake

The tool uses JavaScript's encodeURIComponent — the strict, correct function for parameter values — which encodes even : and /. That means you should encode just the value, not a complete URL. If you encode https://example.com/search?q=a b in one pass, the https:// structure gets escaped too, producing a broken blob. Encode the pieces, keep the structure readable.

Double Encoding: The Silent Link Killer

If you've ever seen %2520 in a URL, you've met double encoding: a string that got encoded twice. The first pass turned the space into %20; the second encoded the % itself into %25. The server decodes once and receives a literal "%20" instead of a space. The fix is process discipline — encode exactly once, at the point where you build the URL. If you inherited a broken link, decode it repeatedly until it reads clean, then rebuild it with a single encoding pass.

Is Encoding a Way to Hide Data?

No — anyone can decode it instantly. Percent-encoding exists for transport safety, not secrecy. If you need to actually protect a value in a URL, that's encryption or a signed token's job, not encoding's.

Frequently Asked Questions

What is percent encoding?

Percent encoding, also called URL encoding, is the rule that replaces any character a URL cannot safely carry with a percent sign followed by two hexadecimal digits. A space is byte 32, which is 0x20 in hex, so it becomes %20. Servers decode these sequences automatically, which is why encoded query strings still work when pasted into a browser.

Why does %20 mean a space?

URL encoding (officially percent-encoding) represents non-ASCII or reserved characters with a percent sign followed by two hex digits. Space is 0x20 in ASCII, so it becomes %20.

When do I need to encode a URL?

Encode any non-alphanumeric character that is part of a value — spaces, ampersands, equals signs, question marks, slashes that are not path separators. Most programming languages and frameworks do this for you.

Is + the same as %20?

Inside query string values, + is a legacy shorthand for space. It is better to use %20 everywhere for consistency.

Related Guides