Color Contrast Checker
Enter a text color and a background color to get the WCAG contrast ratio and AA/AAA results instantly.
Contrast ratio: –
Last updated:
How to check color contrast
- Enter foreground and background. Type or pick two HEX colors: the text color and its background.
- Read the ratio. The tool shows the contrast ratio and AA/AAA pass or fail for normal and large text.
- Adjust the colors. Swap the colors or darken or lighten one of them until the pair passes, then open both in the palette generator.
WCAG 2 contrast requirements
| Level | Normal text | Large text (18 pt / 14 pt bold) |
|---|---|---|
| AA | 4.5:1 | 3:1 |
| AAA | 7:1 | 4.5:1 |
Neon accents on dark backgrounds often pass for large headings but fail for small body copy, so test both sizes. When text sits on a gradient, test it against the lightest and the darkest stop from the CSS gradient generator.
Frequently asked questions
What contrast ratio do I need?
WCAG 2 level AA needs 4.5:1 for normal text and 3:1 for large text (18 pt, or 14 pt bold). Level AAA needs 7:1 for normal text and 4.5:1 for large text.
How is the contrast ratio calculated?
Each color's relative luminance is computed from its sRGB values, then the ratio is (lighter + 0.05) ÷ (darker + 0.05). It ranges from 1:1 (same color) to 21:1 (black on white).
Is this a full accessibility audit?
No. It checks contrast between two solid colors only. It does not test focus indicators, text over images or gradients, or other WCAG requirements.