# 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.

Source: https://useqr.app/docs/spec/module-size-vs-camera-resolution · Last reviewed 2026-08-21 · UseQR is free forever, no signup.

---

## 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](/glossary/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](/docs/scanning/qr-scanning-with-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](/docs/spec/qr-code-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](/docs/print/the-10-to-1-distance-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](/docs/troubleshooting/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](/docs/spec/how-much-data-fits-in-a-qr-code), 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](/size-calculator) folds this into a print
size; the ultimate test is [scanning the real output](/scan) 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

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