Color Contrast Checker
Check the WCAG contrast ratio between any two colors — instant AA/AAA pass/fail badges.
A free color contrast checker: enter a text (foreground) color and a background color and get the exact contrast ratio, pass/fail badges for AA and AAA at both normal and large text sizes, a non-text/UI-component check, and — if the pair fails — a one-click suggestion for a passing shade. Runs entirely in your browser.
Contrast ratio
:1
Large text preview
Normal text preview — roughly how body copy at 16px will read against this background.
Fix a failing pair
This pair already passes the selected target.
What is a WCAG contrast ratio?
The WCAG contrast ratio is a number from 1:1 (identical colors) to 21:1 (pure black on pure white) that measures how much two colors' relative luminance differs. It's the mathematical basis for WCAG 2.1's contrast requirements — the reason a color-contrast checker exists at all is that "looks readable to me" isn't a reliable test, and the ratio gives a precise, repeatable pass/fail line.
That's the full job of a contrast ratio checker: turn "looks readable to me" into one comparable number. Whether you need a quick WCAG contrast checker for one button, a text contrast checker for a whole design system, or an accessibility contrast checker for icons and UI borders, the math is identical — only the target threshold changes.
AA vs AAA, and what counts as "large text"
WCAG defines four relevant targets: 4.5:1 for normal text at AA, 3:1 for large text at AA, 7:1 for normal text at AAA, and 4.5:1 for large text at AAA. "Large text" specifically means at least 18pt (24px) regular weight, or at least 14pt (about 18.66px) bold weight — anything smaller is judged against the stricter normal-text thresholds. AA is the level referenced by most accessibility regulations; AAA is a stronger recommendation, not usually a hard requirement.
The non-text contrast rule (WCAG 1.4.11)
Text isn't the only thing that needs contrast. WCAG 1.4.11 (Non-text Contrast) requires a 3:1 ratio for the visual boundaries of active UI components — input borders, button outlines, toggle states — and for icons or graphics that carry meaning on their own. This tool checks that threshold automatically alongside the text targets above.
Fixing a failing color pair
If your pair fails the target you care about, use Fix a failing pair above: pick whether to adjust the text or the background, then click Suggest a passing color. It steps that color's lightness in the perceptually-uniform OKLCH space until the ratio clears your target, clamping the result to a real, displayable sRGB color. For finer manual control afterward, the OKLCH Converter lets you fine-tune the exact shade, and if you're building a whole color system rather than checking one pair, the Shadcn Theme Generator enforces contrast automatically across an entire generated palette. And if your background is a gradient rather than a flat color, pull the individual color stops from the CSS Gradient Generator and check the darkest and lightest stops here — contrast against a gradient is only as good as its worst point.