WCAG 2.1 AA & AAA accessibility compliance for any color combination
| Level | Normal Text | Large Text |
|---|---|---|
| AA | 4.5:1 | 3:1 |
| AAA | 7:1 | 4.5:1 |
Large text = 18pt+ (24px) or 14pt+ (18.5px) bold
The Web Content Accessibility Guidelines (WCAG) require minimum contrast ratios between text and its background. Poor contrast makes content unreadable for users with visual impairments, color blindness, or low vision. Compliance isn't just ethical — it's required by law in many jurisdictions (Section 508, ADA, EN 301 549).
Contrast is the difference in perceived brightness between text and the surface behind it. Get it wrong and your interface is unreadable for people with low vision, for anyone using a phone in sunlight, and increasingly for everyone as displays and eyes vary. The Web Content Accessibility Guidelines turn that into a measurable number, and this checker calculates it for any pair of colors.
Every color has a relative luminance, a value from 0 for black to 1 for white, derived from its red, green, and blue channels after each has been linearised and weighted for how sensitive human vision is to it. Green contributes most, blue least. The contrast ratio between two colors is then the lighter luminance plus 0.05, divided by the darker luminance plus 0.05.
That formula produces a value between 1 and 21. Identical colors give 1 to 1, meaning no contrast at all. Pure black on pure white gives 21 to 1, the theoretical maximum. The small 0.05 offset accounts for ambient light reflecting off a real screen, which is why even black on white does not reach infinity.
A common mistake is mid-grey text on white. Grey at #777777 on a white background gives roughly 4.48 to 1, which fails AA for body text by a hair, even though it looks fine to most designers on a good monitor. Darkening it slightly to #767676 pushes it just past 4.5 and it passes. That is how tight the margin often is, and exactly why you check the number instead of trusting your eye.
Which WCAG version does this use? The contrast ratio definition and thresholds from WCAG 2.1, which are unchanged from 2.0 and carried into 2.2.
Does it handle transparency? Enter the color that actually results after the layer is composited over its background, since the ratio depends on the final rendered color.
Is AA good enough? AA is the usual legal and contractual benchmark. AAA is better where long-form reading is the point.
Colour contrast is expressed as a ratio between the relative luminance of the text and its background, running from 1 to 1 for identical colours up to 21 to 1 for pure black on pure white. The Web Content Accessibility Guidelines set the thresholds that make text readable for people with low vision, and the checker above compares your two colours against them.
For level AA, normal text needs a contrast ratio of at least 4.5 to 1, and large text needs at least 3 to 1. Large text is defined as roughly 18pt, which is about 24px, or 14pt, about 18.66px, when bold. The stricter level AAA raises those to 7 to 1 and 4.5 to 1. Meeting AA is the common target for most public websites.
Passing the ratio is necessary but not sufficient, because colour alone should never be the only way you convey meaning; pair it with text, underlines, or icons for anyone who cannot distinguish the colours. If a brand colour fails, you can often keep it by darkening the text slightly or adding a subtle background rather than abandoning the palette.