how many qr codes are possible
For practical purposes, the number of possible QR codes is so huge that we will never run out of them in the lifetime of the universe.
Quick Scoop: How many QR codes are possible?
1. The core idea (short answer)
A QR code is a grid of tiny squares (modules), each either black or white.
If a QR code has n×nn\times nn×n modules, then in theory there are
2n22^{n^2}2n2 possible black/white patterns.
- Small QR code (Version 1, 21×21):
- 441 modules → 2441≈2.98×101322^{441}\approx 2.98\times 10^{132}2441≈2.98×10132 possible patterns.
- Largest standard QR code (Version 40, 177×177):
- 31,329 modules → 231,3292^{31,329}231,329 possible patterns.
These numbers are so large that there are not even everyday words for them; they dwarf quantities like the estimated number of atoms in the observable universe (about 108010^{80}1080).
2. But not every pattern is a valid QR code
Real QR codes must follow strict rules:
- Fixed finder patterns in three corners.
- Alignment and timing patterns in predefined locations.
- Reserved bits for:
- Format information (error correction level, mask pattern).
* Version information for larger codes.
- Error correction data using Reed–Solomon codes.
All of this means many of the 2n22^{n^2}2n2 raw patterns are “illegal” or unreadable; only a subset are valid QR codes. But that subset is still astronomically huge.
3. Data capacity and combinations
Each QR version and error-correction level defines how much user data you can store, which in turn defines how many distinct codes you can encode. Some key figures:
- Version 1 (21×21):
- Up to 41 numeric digits.
- Rough scale of possible contents: about 104110^{41}1041 numeric combinations (if you used all 41 digits).
- Version 10 with medium (M) error correction:
- Up to 174 alphanumeric characters.
- Using 45-symbol alphanumeric mode → about 4517445^{174}45174 possible messages.
- Version 40 (177×177), maximum capacity:
- Up to 7,089 numeric characters or 4,296 alphanumeric characters or 2,953 bytes (binary).
* Rough “order of magnitude” of combinations can be expressed as something like 10708910^{7089}107089 for 7,089-digit numeric strings alone.
A forum-style explanation summarizes that a large QR code at medium error correction can carry roughly 15,000 bits, which means about 215,000≈104,5002^{15,000}\approx 10^{4,500}215,000≈104,500 possible bit patterns just for the user payload.
4. Are QR codes “infinite”?
Strictly speaking, the number is finite: the format is fixed, and the grid sizes only go up to Version 40 in the standard.
However:
- The number of valid QR codes is so large (powers like 210,000+2^{10,000+}210,000+, 101000+10^{1000+}101000+, etc.) that:
- We will never generate enough QR codes to “use them up.”
* Even if every person on Earth created millions of QR codes every day, you still would not come close.
That’s why you sometimes see viral claims like “the number of possible QR codes is larger than the number of atoms in the universe.” Those claims are somewhat simplified, but the scale comparison is basically in the right ballpark.
5. Mini story: the “grain of sand” metaphor
Some explainer articles use a metaphor like this:
Imagine all QR codes you’ll ever realistically use as a single grain of sand. The total number of QR codes that could exist is like all the water in all the oceans combined.
The idea is: even if every company, every product, every person, and every digital object had many unique QR codes, what we actually use is still a tiny fraction of what is mathematically possible.
6. Quick HTML table (versions vs rough combinations)
Below is a simple HTML table reflecting the rough scale of combinations discussed in popular explanations (using numeric payloads as a reference).
html
<table>
<thead>
<tr>
<th>QR Version</th>
<th>Size (modules)</th>
<th>Max numeric digits (approx)</th>
<th>Approx. number of possible numeric strings</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>21 × 21</td>
<td>41</td>
<td>~10^41</td>
</tr>
<tr>
<td>10</td>
<td>57 × 57</td>
<td>566</td>
<td>~10^566</td>
</tr>
<tr>
<td>40</td>
<td>177 × 177</td>
<td>7,089</td>
<td>~10^7089</td>
</tr>
</tbody>
</table>
Figures are order-of-magnitude illustrations, not precise counts of all valid codes, but they convey the colossal scale.
TL;DR (in plain language)
- Theoretical patterns for the largest standard QR: 231,3292^{31,329}231,329 possibilities.
- Valid QR codes (after rules and error correction) still number in mind-bending magnitudes like 101000+10^{1000+}101000+ or more.
- In any realistic scenario, humanity will never run out of unique QR codes.
Information gathered from public forums or data available on the internet and portrayed here.