WCAG Contrast Checker

Check the contrast ratio between two colors. Pass/fail verdict for WCAG AA and AAA at every text size.

Aa — Large text 24px / 18px bold
Aa — Normal text 16px
Aa — Small text 12px

The 4.5:1 rule and when it applies

WCAG (Web Content Accessibility Guidelines) defines minimum contrast ratios between text and background so people with low vision, colour-blindness, or those in bright glare conditions can still read your content reliably. This tool computes the exact contrast ratio between any two colours (ranging from 1:1 for identical colours to 21:1 for pure black on pure white) and tells you whether your pair passes WCAG 2.1 Level AA or AAA. It does this separately for normal text, large text, and UI components, using the W3C luminance formula without shortcuts.

Picking colours that pass

The luminance formula under the hood

AA and AAA thresholds by element type

Traps between the spec and the screen

Walking through a check

The default #222222 text on a #FFFFFF background scores a contrast ratio of about 15.9:1 — past every threshold. The tool checks it against WCAG AA (4.5:1 for normal text, 3:1 for large) and AAA (7:1 / 4.5:1) and marks each Pass or Fail. Change the text to #999999 and the ratio falls to about 2.85:1, which now fails AA for body text. Hit Swap to flip foreground and background — the ratio is identical either way.

Large text, symmetric ratios, and APCA

What counts as "large" text? WCAG defines it as 18pt and up, or 14pt and up if bold. Large text only needs 3:1 at AA because thicker, taller letterforms stay legible at lower contrast than body copy.

Why is the ratio the same after I swap the colours? The formula is symmetric — (lighter + 0.05) / (darker + 0.05) — so the order of foreground and background never changes the number. Swap only changes which colour you're actually styling as the text.

If it passes 4.5:1, is my design accessible? Contrast is necessary, not sufficient. A pass says nothing about colour-blind-safe hue pairs, visible focus states, or text sitting over a busy photo. It clears one specific criterion, not accessibility as a whole.

Is this the current WCAG maths? Yes — it's the WCAG 2.x relative-luminance ratio that almost every legal and compliance target still cites. WCAG 3's APCA model computes contrast differently and is still in draft, so 2.x AA remains the number to hit today.

Dark mode and dynamic themes

If your site supports dark mode, every colour pair needs checking twice — once for the light theme and once for the dark theme. A text colour that passes AA on white may fail badly on a dark grey background. Test both directions before shipping a theme toggle, and pay extra attention to secondary text colours (captions, placeholders, disabled labels) that often sit right at the threshold.