FT

WCAG Contrast Checker

Check WCAG 2.1 color contrast ratio for accessibility compliance. Test foreground vs background colors against AA and AAA standards.

Sample Heading Text

This is sample paragraph text to preview the color contrast between foreground and background.

Small text for checking readability at smaller sizes.

17.74: 1
✓ Pass
AA Normal
✓ Pass
AA Large
✓ Pass
AAA Normal
✓ Pass
AAA Large

How to Check Color Contrast

Enter your text color (foreground) and background color as HEX codes. The tool calculates the WCAG 2.1 contrast ratio and tells you whether the pair passes AA and AAA standards for both normal and large text. A live preview shows real text in your chosen colors so you can judge readability visually.

Understanding the Contrast Math

WCAG contrast is calculated using a precise formula: (L1 + 0.05) ÷ (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 of the darker. Luminance itself comes from a weighted RGB calculation that accounts for the human eye being more sensitive to green than red or blue. You do not need to memorize this — the tool handles it.

What Passes and What Fails

Body text (under 18pt): needs 4.5:1 for AA, 7:1 for AAA. Large text (18pt+ or 14pt+ bold): needs 3:1 for AA, 4.5:1 for AAA. UI components and graphical objects: need 3:1 minimum. The most common failure: pale gray text on white. The classic "trendy" #999 on #FFF only hits 2.85:1 — failing every WCAG threshold.

Fixing Failing Contrast

If your brand color fails, do not switch the color — switch how you use it. Use the brand color for icons, buttons (white text on the brand fill usually passes), and decorative elements. Use a darker variant (try shade 700+ from our shades generator) for body text. For long-form reading, near-black (#1A1A1A) on near-white (#FAFAFA) gives 17:1 and minimizes eye strain.

❓ Frequently Asked Questions

What is WCAG contrast ratio?
WCAG (Web Content Accessibility Guidelines) defines contrast ratios from 1:1 (no contrast) to 21:1 (black on white). The minimum for body text is 4.5:1 (AA) and 7:1 (AAA). For large text (18pt+), the minimums drop to 3:1 (AA) and 4.5:1 (AAA).
Why does contrast matter for accessibility?
Roughly 1 in 12 men and 1 in 200 women have some form of color vision deficiency. Plus, anyone reading on a low-brightness phone screen in sunlight needs strong contrast. Failing WCAG can also expose your site to legal complaints in regions like the EU and US.
Does my text need to pass AA or AAA?
AA is the legal baseline in most jurisdictions and what most teams aim for. AAA is stricter and recommended for medical, government, and senior-focused services. Many design systems hit AAA on the main UI and AA elsewhere.
What if my brand color fails contrast?
Two options: use a darker shade (try our <a href='/color-shades/'>color shades generator</a>) for text, or keep the brand color only for non-text elements (buttons, banners, icons). Brand consistency matters, but accessibility wins.

Related Color Tools

More Tools