Glossary
Contrast ratio
Contrast ratio is the luminance difference between a QR code's dark and light modules. Decoders need a clear threshold; the practical floor is about 40% luminance difference, and colour choice matters far less than luminance choice.
Luminance, not hue
A decoder converts the image to greyscale before thresholding. Two colours that look strongly different to a human — a mid red on a mid green — can have nearly identical luminance and produce a code no scanner can read.
Compute relative luminance and compare. Anything under roughly a 40% difference is risky; under 30% will fail on most cameras in ordinary light.
Dark on light, not light on dark
The specification assumes dark modules on a light background. Many decoders handle inverted codes, but not all, and phone cameras are inconsistent about it. An inverted code is a gamble for no design benefit.
Real-world derating
Contrast measured on screen is the best case. Printing on uncoated stock, laminating, scanning under warm restaurant lighting, and photographing at an angle all reduce effective contrast. Leave headroom — a code that is marginal on screen fails in the room.
UseQR's validator computes the actual luminance contrast of your chosen colours and decodes the rendered output rather than guessing.
Related
- DPI (dots per inch) — DPI is printing resolution. For QR codes it matters because each module must be rendered from a whole number of printer dots — 300 dpi is the practical…
- Module — A module is one square cell of a QR code — the smallest unit of the pattern. Codes are measured in modules, not pixels or millimetres, because the module…
- Scan rate — Scan rate is the share of people who see a QR code and scan it. There is no universal benchmark worth quoting — placement, context and the reason to scan…