Rules as of November 26, 2026: WCAG 2.2 (W3C Recommendation, 12 December 2024), success criteria 1.4.3, 1.4.6 and 1.4.11, and its definitions of relative luminance and contrast ratio.
Worked example: grey text and a bright brand orange
The popular light grey #777777 on white has a ratio of 4.47:1, just under the 4.5:1 that AA needs for body text, so it fails. The nearest passing grey is #767676 at 4.54:1, a change hardly anyone would notice. A bright orange #ff6b35 on white manages only 2.83:1, which fails even the 3:1 allowed for large headings and button outlines. For text it has to darken to about #cd4c1a (4.52:1). Keep the bright orange for backgrounds behind dark text, or for decoration.
What the success criteria ask for
| Criterion | Level | Applies to | Minimum |
|---|---|---|---|
| 1.4.3 Contrast (Minimum) | AA | Normal text / large text | 4.5:1 / 3:1 |
| 1.4.6 Contrast (Enhanced) | AAA | Normal text / large text | 7:1 / 4.5:1 |
| 1.4.11 Non-text Contrast | AA | Icons, input borders, focus rings, chart lines | 3:1 against what is next to them |
Logos and brand names, disabled controls and purely decorative text are exempt. Text over a photo must meet the ratio against the part of the photo behind it; a dark overlay usually helps.
The maths
Each 0–255 channel is divided by 255, then turned back into linear light: values up to 0.04045 are divided by 12.92, larger ones become ((value + 0.055) ÷ 1.055)2.4. Relative luminance is 0.2126 × red + 0.7152 × green + 0.0722 × blue, reflecting how much brighter green looks than blue. The contrast ratio is (L1 + 0.05) ÷ (L2 + 0.05), where L1 is the lighter colour. Black on white scores 21:1; white on #767676, the darkest grey that is still often used, scores 4.54:1.
Contrast in dark mode
Dark designs need the same ratios. Pure white on pure black (21:1) can look harsh and blur for some readers; a light grey on a dark grey, such as #e5e5e5 on #1f1f1f, is easier on the eyes and still passes AAA comfortably. Check muted text, placeholders and borders separately, because those are the colours that most often fail.
Who needs to meet these rules
In the US, the Department of Justice’s 2024 rule under the Americans with Disabilities Act requires state and local government websites to meet WCAG 2.1 level AA, and courts often use the same standard for businesses. In the UK, public sector websites must meet WCAG 2.2 AA under the accessibility regulations, and the European Accessibility Act applies similar requirements to many products and services sold in the EU from June 2025. Even where no law applies, readable text helps everyone: people reading in sunlight, on a cheap screen, or with ageing eyes. Checking contrast takes a minute and fixing it usually means only a slightly darker shade.
Related tools
- Colour palette generator
- Colour palette from an image
- Colour picker from an image
- Email signature generator
Sources
Checked on November 26, 2026:
- WCAG 2.2: definitions of relative luminance and contrast ratio
- Understanding WCAG 2.2: 1.4.3 Contrast (Minimum)
- Understanding WCAG 2.2: 1.4.11 Non-text Contrast
- W3C CSS Color Module Level 4: OKLCH
Frequently asked questions
What contrast ratio do I need?
What counts as large text?
Is 4.49:1 close enough to pass?
How is the contrast ratio calculated?
How does the nearest passing colour work?
Does it check colour blindness?
Last updated: 2026-11-26