CIRCULATEQR

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.

WCAG contrast ratios of some code colors on a white background
Code colorRatio on white
Black #00000021:1
Navy #1E3A8A10.4:1
Red #DC26264.8:1
Gray #9CA3AF2.5:1
Gold #D4AF372.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.

Learn more

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