Color contrast is one of the most important accessibility parameters in web design. According to the WHO, over 2.2 billion people worldwide have vision impairments. Insufficient contrast between text and background makes content unreadable — not only for people with low vision, but for anyone using a screen in bright sunlight or on a poorly calibrated display.
The WCAG (Web Content Accessibility Guidelines) standard sets clear minimum contrast requirements. This guide covers how the calculation formula works, what compliance levels exist, and how to check contrast in practice.
What Is WCAG and Why It Matters
WCAG is a set of web content accessibility guidelines developed by the W3C (World Wide Web Consortium). The standard defines how to make websites usable for people with various disabilities: visual, auditory, motor, and cognitive impairments.
The current version is WCAG 2.1 (published in 2018). It includes three conformance levels: A (minimum), AA (recommended), and AAA (maximum). Most accessibility laws (ADA in the US, EN 301 549 in the EU) reference level AA as the required standard.
AA and AAA Contrast Levels
WCAG defines minimum contrast ratios based on text size and conformance level:
| Element | Level AA | Level AAA |
|---|---|---|
| Normal text (up to 18px or up to 14px bold) | ≥ 4.5:1 | ≥ 7:1 |
| Large text (18px bold or 24px and above) | ≥ 3:1 | ≥ 4.5:1 |
| UI components (buttons, icons, input borders) | ≥ 3:1 | — |
Contrast Ratio Formula
The contrast ratio is calculated as:
CR = (L1 + 0.05) / (L2 + 0.05)
where L1 is the relative luminance of the lighter color and L2 is the darker color. The result ranges from 1:1 (no contrast) to 21:1 (maximum contrast, black on white).
In practice, you don't need to calculate this manually — use our contrast checker tool to instantly see the ratio and WCAG compliance level.
Good and Bad Contrast Examples
| Color Pair | Contrast | WCAG AA | Rating |
|---|---|---|---|
| Black (#000) on white (#FFF) | 21:1 | Pass | Maximum contrast |
| Dark gray (#333) on white (#FFF) | 12.6:1 | Pass | Excellent |
| Blue (#1D4ED8) on white (#FFF) | 7.8:1 | Pass | Good |
| Gray (#767676) on white (#FFF) | 4.5:1 | Pass | Minimum acceptable |
| Gray (#888) on white (#FFF) | 3.5:1 | Fail | Hard to read |
| Light gray (#AAA) on white (#FFF) | 2.3:1 | Fail | Nearly unreadable |
How to Fix Low Contrast
- Darken the text — the simplest approach. Use #555 or #333 instead of #888.
- Lighten the background — if the background is dark, make it lighter or use pure white.
- Increase font size — large text (≥ 18px bold) has softer requirements (3:1 instead of 4.5:1).
- Find an alternative color — our contrast checker suggests the nearest colors that pass WCAG AA and AAA.
Frequently Asked Questions
What is the minimum contrast ratio for text?
WCAG 2.1 level AA requires at least 4.5:1 for normal text and 3:1 for large text (18px bold or 24px+). Level AAA requires 7:1 and 4.5:1 respectively.
Is WCAG compliance mandatory?
In many countries, yes. In the US — ADA and Section 508. In the EU — European Accessibility Act (from 2025). For commercial websites, WCAG compliance is a best practice that improves user experience and SEO.
How do I quickly check contrast?
Open our WCAG contrast checker, enter two colors (text and background), and instantly see the contrast ratio, AA/AAA compliance, and color suggestions.
Does contrast affect SEO?
Yes. Google considers accessibility in ranking (Core Web Vitals, Lighthouse Accessibility score). Sites with good contrast score higher in Lighthouse audits, which indirectly affects search positions.
What if my brand color fails WCAG?
Use the brand color for large elements (headings, buttons) where the threshold is lower (3:1). For body text, find a more contrasting shade from the same color family. Our tool automatically suggests the nearest passing color.
Conclusion
Contrast is not an abstract metric — it directly affects your website's usability. Check every text-background pair against WCAG 2.1, aim for at least AA, and target AAA for main content. Start with our WCAG contrast checker — it shows issues and suggests fixes in seconds.