Spec & internals
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.
The 40 sizes
A QR code's 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. 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 and the version and module table.
Structural features arrive on a schedule too: alignment patterns from version 2, the explicit 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 and select the smallest version whose capacity holds the encoded bit stream. Three inputs move the outcome:
- Payload length — the dominant factor.
- Encoding mode — 100 digits fit in far fewer bits than 100 arbitrary bytes.
- 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 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:
- Shorten the payload (a short URL can drop several versions).
- Set the EC level the environment needs — not more.
- Let the version fall where it falls, then size the print for the distance.
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 — free, no signup
Related
- QR code version and module count table — Every QR version's module count follows one formula: 17 + 4 × version. Version 1 is 21 × 21 modules and version 40 is 177 × 177. This table lists all…
- QR code data capacity table — The maximum a QR code can hold is 7,089 digits, 4,296 uppercase alphanumeric characters, 2,953 bytes or 1,817 kanji — all at version 40, error-correction…
- QR code anatomy — every region of the symbol — A labelled tour of a QR code: finder patterns, separators, timing, alignment, format and version information, the data region and the quiet zone.
- How much data fits in a QR code — Theoretical ceilings are 7,089 digits, 4,296 alphanumeric characters or 2,953 bytes — but the practical answer is to keep URLs under about 50 characters.