Contrast checker.
Pick a text color and a background. Get the WCAG contrast ratio, AA and AAA verdicts, and the nearest text color that passes.
Ratios are calculated with the WCAG 2.1 relative-luminance formula. AA normal text needs 4.5:1, AAA needs 7:1.
Aa
Good contrast is invisible — until it isn't. This paragraph is the test.
—WCAG contrast
CSS variables
What the ratio means.
Contrast ratio compares the relative luminosity of two colors on a scale from 1:1 (identical) to 21:1 (black on white). It is a property of the pair, not of either color alone — the same gray can pass on black and fail on white.
The thresholds
- AA normal text — 4.5:1 for body copy under 18 pt (or under 14 pt bold).
- AAA normal text — 7:1, the stricter target for long-form reading.
- AA large text — 3:1 at 18 pt regular or 14 pt bold and above.
- UI components — 3:1 for icons, borders and focus indicators.
Why it is not the whole story
A passing ratio still fails if the type is too thin, too small or sits over a busy image. Use this tool as a floor, not a finish line, and test the result on the actual background the text will sit on.