Back to Lab
Lab · 06

Contrast

Two colors, one number: the exact WCAG contrast ratio, whether it passes, and a fix if it doesn't.

21.0 : 1 contrast ratio
Large text sample Normal body text sample, the kind most of a page is made of.
AA · Normal text needs 4.5:1 Pass
AA · Large text needs 3:1 Pass
AAA · Normal text needs 7:1 Pass
AAA · Large text needs 4.5:1 Pass

Questions

What contrast ratio does WCAG require?

AA requires at least 4.5:1 for normal text and 3:1 for large text (18pt regular, or 14pt bold, and up). AAA is stricter: 7:1 normal, 4.5:1 large.

What's the difference between AA and AAA?

AA is the level most laws and style guides reference. AAA is optional and harder to hit without flattening brand color, which is why WCAG itself doesn't recommend requiring it site-wide.

How is this actually calculated?

Each color's sRGB channels are linearized and weighted (0.2126 red, 0.7152 green, 0.0722 blue) into a relative luminance. The ratio is (L1 + 0.05) / (L2 + 0.05) with the lighter color on top, always landing between 1:1 and 21:1.

Does this check color blindness?

No, just luminance contrast, which is the WCAG baseline. Two colors can pass this and still be hard to tell apart by hue alone for someone with red-green color blindness.

Does it store or send my colors anywhere?

No. It's plain arithmetic in your browser. Nothing is sent to a server or saved.