AyeCalc
All tools
Accessibility

WCAG Color Contrast Checker

Compare foreground and background colors using WCAG relative luminance. Review normal-text and large-text thresholds without sending color values to a server.

WCAG 2.2 thresholdsNormal and large textLive preview
WCAG 2.2

Check text contrast

AA and AAA

Contrast ratio16.40:1
AA normal textPass
AA large textPass
AAA normal textPass
AAA large textPass
AyeCalcReadable text starts with real context.
Core formulacontrast = (lighter luminance + 0.05) ÷ (darker luminance + 0.05)

WCAG AA requires 4.5:1 for normal text and 3:1 for large text; AAA uses 7:1 and 4.5:1.

01
Method

How the contrast checker works

Convert sRGB channels to linear-light values, combine them into relative luminance, identify the lighter and darker colors, and apply the WCAG contrast-ratio formula.

Formulacontrast = (lighter luminance + 0.05) ÷ (darker luminance + 0.05)

WCAG AA requires 4.5:1 for normal text and 3:1 for large text; AAA uses 7:1 and 4.5:1.

02
Worked example

Check #10221d text on #fffefa

This dark green text on a warm near-white background produces a high contrast ratio that passes AA and AAA thresholds for normal and large text.

03
Implementation

Copyable code examples

Use these examples as a starting point, then match the values and assumptions to the rendered project.

CSS custom properties
:root {
  --text: #10221d;
  --background: #fffefa;
}

body { color: var(--text); background: var(--background); }
Contrast formula
const ratio = (lighter + 0.05) / (darker + 0.05);
04
Practical guidance

Using the result accurately

Check every interactive state and actual text size and weight. Contrast is one accessibility requirement; readable typography, visible focus, non-color cues, and usable interaction remain necessary.

Important limitation

A passing mathematical ratio does not guarantee readability over gradients, images, transparency, thin fonts, anti-aliasing, or altered display conditions. Test the rendered interface as well.

References: W3C Understanding WCAG 2.2: Contrast (Minimum).

Common questions

Contrast Checker FAQ

Answers about the method, assumptions, and practical use.

What contrast ratio passes WCAG AA?

Normal text requires at least 4.5:1. Large text requires at least 3:1 under WCAG 2.2 Success Criterion 1.4.3.

What counts as large text?

WCAG defines large-scale text using point-size and boldness conditions. Check the official definition rather than assuming any heading automatically qualifies.

Does AAA require 7:1 for every text size?

AAA uses 7:1 for normal text and 4.5:1 for large text, subject to the exceptions described by WCAG.

Is color contrast enough for accessibility?

No. It must be combined with semantic structure, keyboard access, focus visibility, usable text sizing, and information that does not rely on color alone.