QR code glossary · Design and printing
Contrast ratio
Also called: Color contrast, Symbol contrast
Definition
Contrast, for a QR code, is the difference in brightness between its dark and light modules; scanners need a large difference, with the dark modules darker than the light ones, and designers often check it with the WCAG contrast ratio, which runs from 1:1 (no difference) to 21:1 (black on white).
How it works
A scanner turns the camera image into brightness values and splits them into dark and light. Hue barely matters; lightness does. A navy code on white separates cleanly, while a mid-gray or a pale gold code on white leaves the decoder guessing, especially in dim light or with glare.
The WCAG contrast ratio, defined for text accessibility, is a handy way to put a number on two colors: (L1 + 0.05) ÷ (L2 + 0.05), where L1 and L2 are the relative luminance of the lighter and darker color. It is not part of the QR code standard. Formal print verification follows ISO/IEC 15415, which grades symbol contrast from measured reflectance, but for choosing colors on screen the WCAG ratio is a useful proxy.
| Code color | Ratio on white |
|---|---|
| Black #000000 | 21:1 |
| Navy #1E3A8A | 10.4:1 |
| Red #DC2626 | 4.8:1 |
| Gray #9CA3AF | 2.5:1 |
| Gold #D4AF37 | 2.1:1 |
Why it matters
There is no official minimum ratio for phone scanning, so treat any threshold as a rule of thumb and aim high: dark modules on a light background, as close to black on white as the brand allows. Common problems are pastel or metallic brand colors, gradients that fade toward the background, glossy or foil finishes that reflect light, and a transparent PNG dropped onto a dark slide.
Direction matters too. Light-on-dark (inverted) codes are read by many apps but not all, so a dark code on a light background is the safe choice. Red is a classic trap for laser and red-LED barcode scanners, which see red ink as light; phone cameras handle it better, but only when the red is dark enough. Whatever the colors, test the printed code under the lighting where it will hang.
In CirculateQR
The free generator warns when contrast falls below 4:1 and when the code is lighter than its background; the 4:1 figure is CirculateQR’s rule of thumb, not a standard.
Related terms
- ModuleA module is a single square cell of a QR code, either dark or light, and the basic unit of the symbol: each one is a bit of data or part of a fixed pattern, and the printed width of one module decides how far away the code can be read.
- Quiet zoneThe quiet zone is the blank margin that must surround a QR code on all four sides so a scanner can tell where the code begins; ISO/IEC 18004 requires it to be at least 4 modules wide for a regular QR code and 2 modules for a Micro QR code.
- Logo in a QR codeA logo in a QR code is an image placed over part of the pattern, usually the center, which works because Reed–Solomon error correction can rebuild the modules the logo hides, provided the logo stays within the correction budget and clear of the finder patterns.
- AI QR code artAI QR code art is an image made with a generative AI model so that a working QR code is part of the picture, with the code’s dark and light modules formed by elements of the scene instead of plain squares.
- Finder patternA finder pattern is one of the three large concentric squares in the top-left, top-right and bottom-left corners of a QR code, which a scanner uses to detect the code, measure its size and angle, and work out which way up it is.
Learn more
- QR code design: Colors, shapes and logos that stay readable.
- QR code size guide: Contrast and print checks before a run.
- Free QR code generator: Contrast warnings as you pick colors.
Sources
Last updated . Written by the CirculateQR team; technical facts follow the sources listed above. Example codes and sizes are computed with the open-source qrcode encoder that CirculateQR uses. Spotted something wrong? Email support@circulateqr.com. QR Code is a registered trademark of DENSO WAVE INCORPORATED.
← Browse the full glossary