How Many QR Code Combinations are Possible?

A single Version 40 QR code can produce approximately 223,624 possible combinations, a number so large it dwarfs the estimated 1080 atoms in the observable universe. This means humanity won't run out of unique QR codes. The exact count depends on the QR code version, encoding mode, and error correction level used during generation.

What Are QR Code Combinations?

QR code combinations refer to the total number of unique data patterns a QR code can encode across its 40 version sizes, four encoding modes, and four error correction levels. A Version 40 QR code stores up to 2,953 bytes (23,624 bits), yielding 223,624 distinct permutations per configuration.

How Do QR Code Combinations Work?

Every QR code is a grid of black and white squares called modules. Each module holds a binary value: 1 (black) or 0 (white). The total number of combinations comes from how many modules are available for data storage and how many states each module can take.

Here's the calculation process broken down:

  1. Grid size determines module count: A Version 1 QR code has a 21x21 grid (441 modules total). A Version 40 QR code has a 177x177 grid (31,329 total modules). Not all modules store data though. Finder patterns, timing patterns, and alignment markers consume a fixed portion.
  2. Data capacity sets the combination ceiling: After subtracting structural modules, the remaining space holds encoded data. For Version 40 with Level L error correction, that's 2,953 bytes of raw binary storage. Each byte has 256 possible values, so the combination count is 2562,953, which equals 223,624.
  3. Error correction trades capacity for resilience: Higher error correction levels (M, Q, H) add redundancy data that reduces storage space. Level H can recover 30% of damaged data but cuts maximum capacity roughly in half. Fewer data bytes means fewer possible combinations for that specific configuration.

To put 223,624 in perspective: the number of atoms in the observable universe is roughly 1080. The number of possible permutations for Version 40 alone is approximately 107,111. That's the atom count raised to the 89th power.

What Factors Influence QR Code Combinations?

Three variables determine how many unique QR codes any given configuration can produce: the version (physical size), the encoding mode (data type), and the error correction level (damage resilience). Change any one of these, and the combination count shifts dramatically.

Infographic comparing four QR code encoding modes: Numeric (7,089 chars), Alphanumeric (4,296 chars), Byte (2,953 bytes), and Kanji (1,817 chars)
QR codes support four encoding modes, each with different character capacities that affect the total number of possible combinations.

Encoding Modes

QR codes support four data encoding modes, each optimised for different character sets:

Encoding ModeCharacter SetMax Capacity (Version 40, Level L)Combination Scale
NumericDigits 0-97,089 characters107,089
Alphanumeric0-9, A-Z, space, $%*+-./: 4,296 characters454,296
Byte (Binary)Full ISO 8859-12,953 bytes2562,953
KanjiShift JIS characters1,817 characters~8,0001,817

Numeric mode packs digits most efficiently because each character needs only about 3.3 bits (versus 8 bits in byte mode). Industry analysis suggests that even with just 25 alphanumeric characters, the number of unique permutations exceeds 1.5 septillion.

Error Correction Levels

Every QR code includes Reed-Solomon error correction data. The four levels offer a direct trade-off between damage recovery and data capacity:

  • Level L (Low): Recovers 7% of data. Maximises storage capacity.
  • Level M (Medium): Recovers 15% of data. Standard for most use cases.
  • Level Q (Quartile): Recovers 25% of data. Good for printed codes exposed to wear.
  • Level H (High): Recovers 30% of data. Required when logos overlay the QR code centre.

Choosing Level H over Level L can reduce the usable data capacity by roughly 50%, which still leaves an astronomically large number of combinations. Even the most restrictive configuration produces more unique codes than you'd use in billions of lifetimes.

QR Code Versions and Their Capacities

QR codes span 40 versions, each adding 4 modules per side. Version 1 starts at 21x21 modules. Version 40 reaches 177x177 modules, containing 31,329 total squares. The jump in data capacity between early and late versions is enormous.

Infographic showing QR code versions from Version 1 (21x21 modules) to Version 40 (177x177 modules) with increasing data capacity
QR code versions range from 21x21 to 177x177 modules, with data capacity growing from 41 to 7,089 numeric characters.
VersionGrid SizeTotal ModulesMax Numeric CapacityApproximate Combinations
Version 121x2144141 characters1041
Version 537x371,369154 characters10154
Version 1057x573,249652 characters10652
Version 2097x979,4092,061 characters102,061
Version 40177x17731,3297,089 characters107,089

Most real-world QR codes use Versions 2 through 10. A Version 3 QR code encoding a 50-character URL still has more possible combinations than the total number of stars in the observable universe (estimated at 1024). The later versions exist for edge cases like encoding entire documents or large print applications where high error correction is necessary.

Why Does the Vast Number of QR Code Combinations Matter?

The sheer scale of possible combinations isn't just a mathematical curiosity. It has practical consequences for businesses, security, and the long-term viability of the technology.

  • No scarcity problem: Unlike IPv4 addresses (which ran out in 2011), QR codes can't be exhausted. The 223,624 possible combinations for Version 40 alone exceeds any conceivable demand for the foreseeable future.
  • Collision resistance: The probability of two independently generated QR codes containing identical data is effectively zero. This matters for supply chain tracking, authentication, and event ticketing where uniqueness prevents fraud.
  • Scalability for growing markets: According to Mordor Intelligence, the global QR code market is valued at $15.23 billion in 2026 and growing at a CAGR of 16.82%. That growth won't create a supply bottleneck because the combination space is effectively infinite.
  • Future-proof data encoding: As QR code adoption expands into healthcare records, government IDs, and IoT device provisioning, the vast combination space means the standard doesn't need replacement. QR codes can absorb new use cases without modification.

According to Juniper Research, QR code payment transactions will increase by 79% over the next five years. Even at that growth rate, the mathematical headroom remains almost incomprehensibly large.

Real-World Scale: How Big Is 223,624?

Raw numbers like 107,111 are hard to grasp. These comparisons help illustrate the scale of QR code possibilities against things we can visualise.

Atoms in the Observable Universe

Physicists estimate roughly 1080 atoms exist in the observable universe. The number of possible Version 40 QR codes (approximately 107,111) is so much larger that you'd need to multiply the atom count by itself 89 times to approach it. If every atom were a planet with its own universe of 1080 atoms, you'd still fall short.

Grains of Sand on Earth

Researchers at the University of Hawaii estimated about 7.5 x 1018 grains of sand on Earth. The QR code combination count has over 7,000 digits. The sand grain count has 19. You can't meaningfully compare them because the gap is too vast for analogy.

A Standard 33x33 QR Code

Even a mid-range QR code tells the story. Take a 33x33 grid (Version 3). Subtract the three finder pattern squares (each 7x7 = 49 modules x 3 = 147 fixed modules) and you're left with roughly 942 variable bits. That gives 2942, which is approximately 3.7 x 10283. Already more than the atoms in the universe by a factor of 10203.

How to Create QR Codes with Optimal Settings

Understanding combinations is useful, but choosing the right settings for your specific use case matters more in practice. Here's what I've found works best after generating thousands of QR codes across different industries and formats.

  1. Match the version to your data length: Don't use Version 40 for a 30-character URL. Let your QR code generator auto-select the smallest version that fits your data. Smaller versions scan faster and print more reliably at small sizes.
  2. Use Level M error correction as your default: Level M recovers 15% of damage and balances size with resilience. Switch to Level H only if you're embedding a logo in the centre or printing on materials that will take physical abuse.
  3. Choose the right encoding mode: If your data is purely numeric (phone numbers, product IDs), use numeric mode for maximum efficiency. For URLs, byte mode handles the full character set. Most free QR code generators select the optimal mode automatically.
  4. Test at target print size: A Version 10 QR code printed at 2cm x 2cm may fail to scan because the modules are too small for camera sensors. Follow QR code printing guidelines and maintain a minimum module size of 0.33mm.
  5. Use dynamic QR codes for changeable content: A dynamic QR code encodes a short redirect URL, keeping the version low and the code simple. The destination can change without reprinting. This is particularly useful for marketing campaigns and consumer engagement where you need scan analytics.
đź’ˇ
Static vs dynamic matters more than version choice for most business users. A dynamic QR code from QRCode.co.uk keeps your code compact while letting you update the destination, track scans, and add pixel tracking without changing the printed code.

Common Myths About QR Code Combinations

Several misconceptions circulate about QR code limits. Here's what the maths actually shows.

Key takeaway note explaining why we will never run out of QR codes, with Version 40 having 2^23,624 possible combinations
Version 40 QR codes alone have more possible combinations than atoms in the observable universe.

"We'll Eventually Run Out of QR Codes"

This is mathematically impossible within any practical timeframe. If every person on Earth generated one billion unique QR codes per second, it would take far longer than the age of the universe (13.8 billion years) to exhaust even a fraction of the available combinations. The 223,624 figure isn't a cap on how many codes can exist simultaneously. It's the number of distinct data patterns possible for one version at one error correction level. Across all 40 versions and 4 error correction levels, the total is vastly larger still.

"QR Codes Are Infinite"

Technically, no. The total number is finite because the grid size has a fixed maximum (Version 40, 177x177). But calling them "practically infinite" is fair. A finite number can still be so large that it has zero real-world constraints. The distinction matters for computer science theory but not for anyone generating QR codes for business use.

"All QR Codes Look Different"

Two QR codes encoding the same data with the same version, error correction, and masking pattern will look identical. The uniqueness comes from the encoded content, not the visual pattern itself. That said, creative QR code designs with custom colours, logos, and shapes can make codes visually distinct while encoding different data.

"Bigger QR Codes Are Always Better"

Larger versions hold more data but are harder to scan at small physical sizes, slower to decode, and unnecessary for short data strings. A URL like "qrcode.co.uk/my-link" fits comfortably in a Version 3 code. Using Version 40 for that same URL wastes space and creates a needlessly dense pattern.

How Do QR Codes Compare to Other Barcode Technologies?

QR codes aren't the only matrix symbology available. But their combination capacity far exceeds alternatives, which partly explains their market dominance.

TechnologyDimensionsMax Data CapacityApproximate Combinations
Traditional Barcode (UPC-A)1D12 digits1012
Data Matrix2D2,335 alphanumeric chars~362,335
QR Code (Version 40)2D4,296 alphanumeric chars~454,296
NFC TagN/A~8 KB typical2568,192

Traditional barcodes max out at 12-48 digits, giving them about 1048 combinations at best. QR codes surpass that by thousands of orders of magnitude. When you look at QR codes vs NFC, NFC tags hold more raw bytes but require physical proximity (under 4cm), while QR codes work at camera distance. Each technology fills a different niche, but QR codes win on combination density per scan effort.

What Does the Future Hold for QR Code Technology?

QR codes have been around since 1994, when Denso Wave invented them for tracking automotive parts. Thirty-two years later, the technology is growing faster than at any point in its history. An estimated 2.2 billion people worldwide now interact with QR codes regularly.

Several trends are expanding how these codes get used:

  • Secure authentication: Banks and government agencies use QR codes for two-factor authentication, where each code is a one-time token. Thomas Wilson, Senior Analyst at Juniper Research, notes: "In unattended and open environments, QR code payments are highly vulnerable to phishing attacks. It is essential that uniform QR payment standards featuring strict security controls are implemented across regions."
  • Supply chain provenance: Each product unit gets a unique QR code linking to its manufacturing history. With billions of products shipped annually, the combination space ensures every item can carry a distinct identifier.
  • Augmented reality triggers: AR applications use QR codes as spatial anchors. Each code points to a different 3D experience, and the version flexibility means codes can embed both the trigger ID and metadata.

The combination ceiling isn't a practical barrier for any of these applications. What limits QR code technology is scanning hardware, display size, and user behaviour. The maths behind the codes themselves won't be the bottleneck.

Frequently Asked Questions

How many QR codes are theoretically possible?

For a single Version 40 QR code using byte encoding and Level L error correction, there are 223,624 possible combinations (roughly 107,111). When you account for all 40 versions and all four error correction levels, the combined total is many orders of magnitude larger. The exact number depends on which configuration you're counting, but any way you calculate it, the result far exceeds any conceivable demand.

Are there infinite combinations of QR codes?

No, the number is technically finite because QR codes have a maximum size (Version 40, 177x177 modules). But "practically infinite" is an accurate description. The number 223,624 is so large that even generating trillions of QR codes per second for billions of years wouldn't approach it. For all real purposes, QR codes function as if their supply were unlimited.

How many squares are in a QR code?

It depends on the version. Version 1 has 441 squares (21x21). Version 40 has 31,329 squares (177x177). Each "square" is technically called a module. Not all modules encode data. Some form the finder patterns (the three large corner squares), timing patterns, and alignment markers that help scanners read the code.

What is the maximum size of a QR code?

Version 40 is the largest standard QR code at 177x177 modules. It stores up to 7,089 numeric characters, 4,296 alphanumeric characters, or 2,953 bytes of binary data (at Level L error correction). The physical print size varies based on module size, but the data capacity is fixed by the standard defined in ISO/IEC 18004:2015.

Who invented QR codes?

Masahiro Hara and his team at Denso Wave, a subsidiary of Toyota, invented QR codes in 1994. They needed a barcode that could hold more data and scan faster than traditional 1D barcodes for tracking automotive parts during manufacturing. Denso Wave chose not to exercise their patent rights, making the QR code standard freely available for anyone to use.

Can two different QR codes look the same?

Two QR codes encoding identical data with the same version, error correction level, and mask pattern will produce visually identical codes. Different data always produces different patterns. It's also worth noting that QR code generators apply one of eight masking patterns to optimise readability, so the same data can produce slightly different visual patterns depending on which mask the generator selects.

The Maths Is Clear: QR Codes Won't Run Out

The scale of possible QR code combinations makes "astronomical" an understatement. Version 40 alone offers 223,624 unique codes, a number with over 7,000 digits. Across all versions, encoding modes, and error correction levels, the total combination space is so large that running out is a mathematical impossibility within any meaningful timeframe.

For businesses, marketers, and developers, the takeaway is straightforward: you can generate as many unique QR codes as you need without worrying about duplication or scarcity. The technology's design ensures that.