Qraft

Contrast

Contrast refers to the degree of brightness or color difference between adjacent elements. In QR codes, the contrast between dark modules and light background is one of the most critical factors for scan reliability. Camera decoders use threshold-based detection, so insufficient contrast prevents correct module boundary recognition.

WCAG's 4.5:1 for text is a separate criterion in a separate domain: it describes humans reading text, not whether a decoder can scan. Scanning depends on whether the camera can threshold the brightness difference, so the practical floor is a contrast ratio of 4:1 between modules and background, with 7:1 or above as the margin to aim for when print density loss, backlighting or low resolution stack up. Read quality is graded numerically by verification standards in the ISO/IEC 15415 family, which score Symbol Contrast, whereas ISO/IEC 18004 — the symbology specification itself — sets no numeric contrast threshold. Black (#000000) on white (#FFFFFF) provides 21:1, the most reliable combination.

When creating colored QR codes for design purposes, maintaining contrast is challenging. Common mistakes include pastel-colored modules and photo or gradient backgrounds that create partial contrast failures. Always test colored QR codes on multiple smartphones before deployment.