Web

Contrast checker

Enter a foreground and background color to see the contrast ratio and whether it passes WCAG AA and AAA.

#
#
2.98:1
WCAG AA:
WCAG AAA:
The five boxing wizards jump quickly.
WCAG AA:
WCAG AAA:
The five boxing wizards jump quickly.
WCAG AA:
Advertisement

How to use the contrast checker

Enter a foreground and background color as a hex value, or use the color picker next to each field. Adjust Alpha to see how a semi-transparent foreground color would actually look once blended with the background, and use each Lightness slider to nudge a color brighter or darker while keeping its hue and saturation. Results update instantly as you adjust anything.

How the ratio and pass/fail results are calculated

This follows the WCAG contrast formula: each color's relative luminance is calculated from its sRGB values, and the contrast ratio is the lighter luminance plus 0.05, divided by the darker luminance plus 0.05. That produces a ratio from 1:1 (identical colors) up to 21:1 (black against white). WCAG 2.x level AA calls for at least 4.5:1 for normal text and 3:1 for large text; level AAA raises that to 7:1 and 4.5:1. Graphical objects and interface components need at least 3:1 under WCAG 2.1, with no separate AAA threshold defined for that category. Large text is defined as 18pt (about 24px) or larger, or 14pt (about 18.66px) and bold or larger.

Frequently asked questions

What contrast ratio do I need for WCAG AA?

WCAG 2.x level AA calls for at least 4.5:1 for normal text and 3:1 for large text. Graphical objects and interface components (like icons or input borders) need at least 3:1 under WCAG 2.1.

What counts as "large text"?

Large text is defined as 18pt (about 24px) or larger, or 14pt (about 18.66px) and bold or larger. Everything smaller falls under the stricter normal-text thresholds.

What does the Alpha slider do?

It makes the foreground color partially transparent, the way text or an icon might sit over a background at less than full opacity. The tool blends the foreground into the background at that opacity before calculating contrast, since that's the color a viewer would actually see.

Is contrast ratio the only accessibility requirement for color?

No — contrast is one important piece, but WCAG also expects that color alone never be the only way information is conveyed (like a red border being the sole indicator of a form error), among other requirements. A passing contrast ratio doesn't guarantee full compliance on its own.