Contrast Checker — WCAG AA & AAA
Pick a foreground and background colour, see the contrast ratio in real time and whether the pair meets WCAG 2.1 AA or AAA targets for normal and large text.
Pick a foreground and background colour, see the contrast ratio in real time and whether the pair meets WCAG 2.1 AA or AAA targets for normal and large text.
Small text — 16px Arial, normal weight. The ratio you see needs to be at least 4.5:1 to pass WCAG AA.
Large text — 24px
Contrast ratio is a number from 1:1 (no contrast — same colour on same colour) to 21:1 (black on white) that measures how visually distinct two colours are. WCAG (Web Content Accessibility Guidelines) sets minimum ratios that text must meet for users with low vision or in difficult lighting conditions to read it comfortably.
WCAG 2.1 sets two compliance levels: AA (the legal floor in most jurisdictions — 4.5:1 for normal text, 3:1 for large) and AAA (best practice, 7:1 normal / 4.5:1 large). 'Large text' is 18pt or larger, or 14pt bold or larger. This tool computes the ratio using the official sRGB relative-luminance formula and shows pass/fail for each level.
In the EU (Web Accessibility Directive 2018) and in the US (Section 508, ADA case law), the minimum is WCAG 2.1 AA. For text, that's 4.5:1 for normal-size and 3:1 for large. Public-sector sites must comply; private-sector compliance is increasingly required by case law.
Yes — WCAG 2.1 added a 3:1 minimum for non-text elements (icons, form borders, focus indicators) that convey meaning. Plain decorative images are exempt, but anything users need to perceive must meet 3:1.
WCAG defines large as 18pt or larger (24px at default browser settings) for normal weight, or 14pt or larger (~18.66px) for bold. Headings usually qualify; body text usually does not.
When both colours are dark, you have very little luminance to work with — small adjustments produce small ratio changes. Often the answer is to lighten the background significantly (a card with a slightly lighter tone) rather than tweak the text colour.
Text on a gradient or image needs to meet contrast against the worst spot of the underlying surface. Add a solid overlay or a translucent panel behind the text to ensure readability — auditing 'against a gradient' inevitably finds a failing spot if the gradient is wide enough.
Where checking contrast prevents accessibility issues.
When a brand picks colours for marketing, designers rarely check if the brand-on-brand-background combination passes WCAG. Run all combinations through the checker before locking the design system.
A primary CTA needs strong contrast against both the page background AND its own text colour. The checker quickly reveals whether your button colour passes AA against white text or needs adjustment.
Syntax highlighting often fails WCAG even when the rest of the site passes. Run the most-used token colours (keywords, strings) against your code-block background to surface the failures before users complain.
Dark mode designs frequently use too-low contrast for body text. Test your dark-mode foreground/background pair: 4.5:1 isn't optional just because the page is dark.
Habits that make accessible colour choices the default.
AA is the legal minimum; AAA is what your low-vision users actually want. The cost is usually a small darkening of body text or lightening of background — barely noticeable to designers, transformative for users.
Default 'black' (#000) on white gives 21:1 — the maximum. Slate-900 on white gives 17:1, still excellent. Stay close to those defaults for body copy and reserve coloured text for accents and links.
The :focus outline must contrast at 3:1 against the background. Default browser blue (often #0066ff) usually passes against white but fails against dark or coloured surfaces. Override with a custom outline that you've verified.
Many users (touch, keyboard) don't see hover states. The default (non-hover) appearance must already be accessible; hover is an enhancement, not a fallback.