# QR code versions 1 to 40: sizes, capacity and how to choose

> QR codes come in 40 versions. Version 1 is 21×21 modules and each version adds 4 modules per side, up to 177×177 at version 40, which holds up to 2,953 bytes. Generators auto-select the smallest version that fits the payload at the chosen error-correction level, and smaller scans better.

Source: https://useqr.app/docs/spec/qr-code-versions-1-to-40 · Last reviewed 2026-08-21 · UseQR is free forever, no signup.

---

## The 40 sizes

A QR code's [version](/glossary/version) is its size class, nothing more. The rule is
one line:

**side length in modules = 4 × version + 17**

Version 1 is 21 × 21; every step adds 4 modules per side; version 40 is 177 × 177:
31,329 [modules](/glossary/module). Capacity grows faster than area suggests, because the
fixed overhead (finders, timing, format bits) is bought once: at version 1 function
patterns consume 53% of the symbol, at version 40 under 9%.

Milestones (byte capacity at level M):

| Version | Modules | Bytes at M |
|---|---|---|
| 1 | 21 × 21 | 14 |
| 2 | 25 × 25 | 26 |
| 5 | 37 × 37 | 84 |
| 10 | 57 × 57 | 213 |
| 40 | 177 × 177 | 2,331 |

The ceiling at version 40, level L, is **7,089 numeric / 4,296 alphanumeric /
2,953 bytes**. Full per-version figures are in the
[capacity table](/docs/reference/qr-code-capacity-table) and the
[version and module table](/docs/reference/qr-code-version-and-module-table).

Structural features arrive on a schedule too: [alignment patterns](/docs/spec/alignment-patterns)
from version 2, the explicit [version information](/docs/spec/version-information) field
from version 7.

## How the version is chosen

You normally do not choose it. Encoders (UseQR's included) take the payload and the
[error-correction level](/glossary/error-correction-level) and select the **smallest
version whose capacity holds the encoded bit stream**. Three inputs move the outcome:

1. **Payload length**, the dominant factor.
2. **[Encoding mode](/docs/spec/data-encoding-modes)**, 100 digits fit in far fewer bits
   than 100 arbitrary bytes.
3. **EC level**: raising L → H roughly halves data capacity at a given version, pushing
   the payload into a bigger symbol.

Measured with UseQR's encoder: a 71-character URL needs **version 5 (37 × 37) at level M**
but **version 8 (49 × 49) at level H**. Same data, 44% more modules, each one smaller at
the same printed size.

## Why smaller is better

Every version step makes modules smaller at a fixed physical size, and module size is what
[limits scan distance](/docs/spec/qr-code-density-and-scan-distance) and camera focus. A
version 3 code scans from further away, survives worse printing and forgives more styling
than a version 12 code at the same footprint. The practical ordering:

1. **Shorten the payload** (a [short URL](/glossary/short-url) can drop several versions).
2. Set the EC level the environment needs, not more.
3. Let the version fall where it falls, then
   [size the print for the distance](/docs/print/qr-code-size-for-print).

Forcing a *higher* version than needed is occasionally useful (batches where every code
must be the same size regardless of payload), and UseQR's API accepts a `version`
parameter for exactly that. Forcing a lower one is impossible: if the data does not fit,
generation fails rather than silently truncating.

## FAQ

### What do QR code versions mean?
Version is the symbol's size class, from 1 (21×21 modules) to 40 (177×177). Each version adds 4 modules per side and therefore more capacity. It has nothing to do with software versions or the age of the standard.

### Which QR code version should I use?
The smallest one that fits your payload at your chosen error-correction level, which is what generators select automatically. Lower versions have larger modules at the same printed size, so they scan from further away and tolerate more damage.

### How much data does a version 40 QR code hold?
At error-correction level L: 7,089 numeric digits, 4,296 alphanumeric characters, or 2,953 bytes. At level H that falls to 1,273 bytes. In practice codes that large are hard to scan from print and are rarely a good idea.

### How do I find a QR code's version?
Count the modules along one edge and compute (count − 17) ÷ 4. A 29-module side is version 3. Decoders do the same measurement via the timing patterns, cross-checked against the version information field from version 7 up.

## Try it

- https://useqr.app/url
- https://useqr.app/validate
- https://useqr.app/size-calculator
