Spec & internals
Module size vs camera resolution
A decoder needs roughly three or more camera pixels per module to sample it reliably. Divide the pixels the code occupies in the frame by its module count plus eight for the quiet zone: a version 5 code spanning 200 pixels gives about 4.4 pixels per module, comfortably readable.
The sampling problem
A decoder does not "see" modules; it samples a grid of image pixels and decides, for each grid cell, dark or light. For that decision to be trustworthy, each module must land on enough pixels that at least one falls cleanly inside it rather than straddling an edge. With one pixel per module, a half-module misalignment makes every sample ambiguous. The practical floor is around 2 pixels per module in ideal conditions, and 3–4 pixels per module for reliable real-world scanning, blur, noise, perspective and lens softness all eat into the margin.
This is the same reason scaling a QR image down to near its module count and back up destroys it: information below the sampling floor is gone.
The arithmetic, sensor to module
What matters is not the camera's megapixel count but how many pixels the code occupies in the captured frame:
pixels per module = pixels across the code ÷ (modules per side + 8)
(the + 8 covers the quiet zone, which the decoder also needs to see).
Worked example: a phone captures a 4,000-pixel-wide frame. A poster code fills a tenth of the frame width, 400 pixels. For a version 5 code (37 modules + 8):
400 ÷ 45 ≈ 8.9 pixels per module, easy
Same scene on an old 1,280-pixel webcam frame: the code spans 128 pixels, giving 128 ÷ 45 ≈ 2.8 pixels per module, right at the edge, and any motion blur or glare tips it into failure. This is why a code that scans instantly on a recent phone can be unreadable to a webcam or an older device from the same position: the code did not change, the pixel budget did.
What this explains
- Tiny codes fail on old cameras first. Shrinking print size shrinks pixels-per-module linearly. The newest phones also crop-zoom and enhance; older ones do not.
- Dense codes fail before sparse ones. A version 10 code has 57 + 8 = 65 cells across against version 2's 33, so at equal printed size it gets half the pixels per module. See density and scan distance.
- Distance is just resolution in disguise. Standing further back shrinks the code in the frame, which shrinks the pixel budget. The 10:1 rule is a rough encoding of "keep enough pixels on the code".
- Focus floors matter for very small codes. Phones cannot focus arbitrarily close, so a very small code cannot simply be scanned from nearer, below about 2 × 2 cm you run out of focus before you run out of arithmetic. The failure cases are catalogued in QR code too small to scan.
Designing to the budget
You control two of the three terms. Keep the version low by keeping the payload short, and set the physical size so that the worst camera you care about, at the furthest realistic distance, still lands 3–4 pixels on each module. The size calculator folds this into a print size; the ultimate test is scanning the real output with the oldest device you can find, not the newest.
FAQ
How many pixels does a QR code module need?
Around two per module is the working minimum in ideal conditions; three to four per module gives reliable scanning once blur, noise and perspective are involved. Below that, the decoder's samples straddle module edges and reads become unstable.
Why does my QR code scan on a new phone but not an old one?
The old camera puts fewer pixels on each module: lower sensor resolution, weaker processing, no automatic crop-zoom. A code that yields nine pixels per module on a recent phone may yield fewer than three on an older one at the same distance.
Does a higher megapixel camera scan QR codes better?
Broadly yes, because more pixels land on each module at the same distance. But lens quality, focus, stabilisation and image processing matter as much as raw resolution, a sharp 8 MP frame beats a soft 48 MP one.
What is the smallest a QR code can be printed?
Keep modules at or above roughly 0.4 mm and the whole code at 2 × 2 cm or larger for phone scanning. Below that, printers blur module edges and phone cameras hit their close-focus limit before they get enough pixels per module.
Try it: free, no signup
Related
- 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.
- QR code density and scan distance, Module count times module size sets the physical width a QR code needs. The formula, and a table of common versions at common scanning distances.
- 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.
- QR code too small to scan: the fix ladder, Cameras need 3–4 pixels per module. Minimum sizes by scan distance, why shortening the payload beats enlarging the code, and the 2 × 2 cm print floor.