Contrast Checker

Foreground × background — compute the WCAG contrast live and see at a glance whether AA / AAA passes.

Text color
Background color
Contrast result
—
Large text preview Aa
Normal text preview The quick brown fox jumps over the lazy dog. 0123456789

What the ratio means

A contrast ratio compares the relative luminance of two colours and is expressed as a range from 1:1 (identical) to 21:1 (black on white). It is calculated from the same luminance formula that drives WCAG, which weights the green channel far more heavily than red or blue because the human eye is most sensitive there.

Two useful anchors: pure black on pure white is 21:1, and mid-grey #767676 on white is exactly 4.54:1 — the lightest grey that still passes AA for body text.

The WCAG thresholds

LevelNormal textLarge textUI components
AA (minimum)4.5:13:13:1
AAA (enhanced)7:14.5:1—

"Large text" means 18pt (24px) regular, or 14pt (18.66px) bold and above. Icons, form borders and focus rings fall under the 3:1 UI component rule even though they are not text.

Where contrast usually fails

Practical fixes

The cheapest repairs are usually to darken the text rather than lighten the background, to add a subtle text shadow over imagery, or to place text on a semi-transparent scrim. Raising font weight also helps: WCAG treats bold text as large from 14pt, which lowers the requirement from 4.5:1 to 3:1.

Related tools

Colour converter Colour palette Gradient generator

FAQ

What contrast ratio passes WCAG?
Normal text (<18pt): AA ≥ 4.5:1, AAA ≥ 7:1; large text (≥18pt or ≥14pt bold): AA ≥ 3:1, AAA ≥ 4.5:1.
How is the contrast calculated?
Per the WCAG 2.x formula: compute each color's relative luminance L (linearize the sRGB channels, then weight by 0.2126/0.7152/0.0722), then contrast = (Llight + 0.05) / (Ldark + 0.05), ranging from 1:1 to 21:1.
Is my data uploaded?
No. Computation is entirely local in your browser; nothing is sent anywhere.