Research
QR code colours: the measured contrast floor is lower than you think, with one trap
By OpenQR · updated 25 November 2026
Every QR code style guide says some version of the same thing: keep the contrast high, dark on light, and if you want a number, the accessibility figure of 4.5:1 gets quoted at designers as if scanners were screens. We build a generator, our users put brand colours on printed codes, so we measured where colour actually breaks decoding: 58,048 decode attempts across four pinned open-source decoders, contrast swept from 1.5:1 to 21:1, plus three brand colour pairs held at nominally identical contrast ratios. Two findings matter to anyone picking colours this week. The floor is low: about 2:1 worst-case, and the better decoders hold to 1.5:1, provided the code is printed big enough. And the number you compute from WCAG ratios is not the number the scanner sees: at matched ratios, green-on-white decoded six points worse than navy-on-cream, because scanners binarise gamma-encoded luma, not accessibility luminance.
7 min read · Updated 25 November 2026
The measured floor: about 2:1, not 4.5:1
In our benchmark, the worst-case 95%-success contrast floor is about 2:1 (bootstrap 95% CI 1.9–2.4), and the stronger decoders in the test set read reliably down to 1.5:1. Both sit well beneath the WCAG-AA text-contrast threshold of 4.5:1 that gets quoted as if it applied to codes. A scanner is not making text legible; it is asking a much blunter question, whether a luminance difference exists at the module boundary, and on an adequately captured code that question has a low bar.
One condition carries the whole sentence: provided resolution is adequate. In the full benchmark, contrast was rarely the binding constraint, and resolution almost always was. A pale brand colour at 3:1 on a code printed at four pixels per module scans; the same colour on a two-centimetre code on a curved bottle does not, and the colour is not the thing that killed it. If you take one prioritisation from our measurements: fix module size first, colour second.
The floor is about 2:1, not 4.5:1 - provided the code is printed big enough. Contrast is rarely the binding constraint; resolution almost always is.

The gamma trap: same WCAG ratio, different scan rate
Here is the result we did not expect. We tested three colour pairs, navy-on-cream, red-on-white and green-on-white, at nominally matched WCAG contrast ratios, same error-correction level, same capture conditions. Worst-case decode success:
| Colour pair | WCAG ratio | Worst-case decode rate |
|---|---|---|
| Navy on cream | matched | 0.71 |
| Red on white | matched | 0.69 |
| Green on white | matched | 0.65 |
Across ppm 2–6, level Q. A six-point spread between pairs carrying the same accessibility ratio.
The mechanism is that decoders binarise gamma-encoded luma, the raw grey your image software computes, not the linear-luminance quantity WCAG ratios are built from. Green compresses worst in that grey conversion, so a green code's realised grey contrast is lower than its WCAG ratio implies. The accessibility number and the scanner number are different numbers, and green is where they diverge most.
The practical consequence is not "avoid green". It is: do not clear a colour pair on the strength of a WCAG calculation alone, because the calculation answers a different question.
The ten-second test
The gamma trap has a cheap antidote. Convert your foreground and background colours to plain greyscale and look at the pair that survives. That grey conversion is much closer to what the decoder actually binarises than any ratio formula is: whatever separates in greyscale is roughly all a scanner has to work with. Navy-on-cream separates well in grey; green-on-white compresses; mid-grey-on-white barely separates at all. You can do this in any image editor, or by squinting at the code in black and white, before anything goes to print.
What to actually do with a brand palette
None of this is licence for pale colours. It is permission structure: the floor is low, so a properly dark brand colour is comfortably safe, and the failure zone is crowded with colours that look fine on screen.
- Dark modules on a light ground, always. Every measurement above assumes that polarity; the inverted case is its own failure mode with different stakes (two of our four decoders read inverted codes at 0%).
- Go properly dark. The greyscale test is the arbiter: navy, charcoal, deep burgundy and near-black pass it with room to spare. Mid-grey, pastels and yellows do not separate in grey and live in the failure zone regardless of how they look in colour.
- Skip gradients across the code. A gradient looks like a range of contrast ratios, and the code's worst-looking end is the one that decides the scan.
- Test the finished code, not the palette. Decode the actual image with a real reader (or a tool that does it for you) at the size it will print.
What we did not measure
These are synthetic-image results in WCAG luminance units across four pinned software decoders (ZBar, OpenCV QRCodeDetector, OpenCV WeChat, zxing-cpp), three payload strings, and versions 2–4 of the symbol. Physical print is a different channel: ink spread, substrate and illumination are graded by barcode print-quality standards (ISO/IEC 15415 measures symbol contrast and modulation under real lighting), and we did not measure any of that. The contrast floor also moves with capture quality, which is why resolution, not colour, is the first thing to fix. The full method, dataset and every number above are in the benchmark paper (PDF and dataset on Zenodo, DOI 10.5281/zenodo.24352636).