Skip to content
ZeroKit

WCAG contrast ratio

The WCAG contrast ratio compares the relative luminance of text and its background on a scale from 1:1 to 21:1; 4.5:1 is the AA threshold for normal text.

The ratio is computed from relative luminance, not from how different two colours look. Grey text on white can feel readable and still fail: #777 on #fff is about 4.5:1, while #999 is around 2.8:1.

AA requires 4.5:1 for normal text and 3:1 for large text (18pt, or 14pt bold). AAA raises those to 7:1 and 4.5:1.

Opacity modifiers are the usual culprit in component libraries: text-fog at 60% on a dark background easily drops below 4.5:1, which is exactly the kind of thing an automated audit catches.

Apply it: Contrast Checker

Check colour contrast for WCAG 2.1 AA and AAA. Enter two colours to get the exact contrast ratio, pass or fail results and a fix suggestion. Works offline.

Open the free Contrast Checker →
  • WebP — WebP is an image format from Google that typically produces files 25–35% smaller than JPEG…