What is a color contrast ratio?
It compares how light two colors are, from 1:1 (no difference) to 21:1 (black on white). Hue hardly matters: it measures the light-dark difference that people with low vision or weak contrast perception need to read text.
What are the Web Content Accessibility Guidelines (WCAG) contrast rules?
WCAG 2.2 sets three contrast rules. Level AA is the one most sites aim for; AAA is stricter. Large text means at least 18 point (24px), or 14 point bold (about 18.5px).
| Check | Minimum | Your colors |
|---|---|---|
| AA normal text | 4.5:1 | Pass |
| AA large text | 3:1 | Pass |
| AAA normal text | 7:1 | Pass |
| AAA large text | 4.5:1 | Pass |
| AA icons, borders, charts | 3:1 | Pass |
The ratios are thresholds and are not rounded up: 4.499:1 does not meet 4.5:1. That is why this checker shows the ratio rounded down. Logos, pure decoration and disabled controls have no contrast requirement.
WCAG 2.2 adds new rules to WCAG 2.1 without changing these three, so a site that meets 2.2 also meets 2.1.
Source W3C · WCAG 2.2, Success Criterion 1.4.3 Contrast (Minimum) ↗W3C · WCAG 2.2, Success Criterion 1.4.6 Contrast (Enhanced) ↗W3C · WCAG 2.2, Success Criterion 1.4.11 Non-text Contrast ↗W3C · Understanding Success Criterion 1.4.3: Contrast (Minimum) ↗W3C · WCAG 2.2, New features in WCAG 2.2 ↗
How to calculate color contrast
First find each color’s relative luminance, how much light it gives off from 0 (black) to 1 (white). Divide each of red, green and blue by 255, then make it linear: values up to 0.04045 are divided by 12.92, larger ones become ((value + 0.055) ÷ 1.055) to the power 2.4. Then:
Here it is with your numbers:
- Text #595959: red 89, green 89, blue 89. Each ÷ 255, then made linear: 0.0999, 0.0999, 0.0999.
- Text luminance: 0.2126 × 0.0999 + 0.7152 × 0.0999 + 0.0722 × 0.0999 = 0.0999.
- Background #FFFFFF: red 255, green 255, blue 255. Each ÷ 255, then made linear: 1.0000, 1.0000, 1.0000.
- Background luminance: 0.2126 × 1.0000 + 0.7152 × 1.0000 + 0.0722 × 1.0000 = 1.0000.
- Ratio: (1.0000 + 0.05) ÷ (0.0999 + 0.05) = 7.00, rounded down and worked from the unrounded values.
It means #595959 on #FFFFFF is 7.00:1: enough for any text at the strictest level.
Source W3C · WCAG 2.2, definition of relative luminance ↗W3C · WCAG 2.2, definition of contrast ratio ↗
Color contrast examples
Tap a pair to check it. Ratios are for the text color on the background shown.
| Colors | Ratio | Normal text |
|---|---|---|
| Black on white | 21.00:1 | Pass AAA |
| This page’s grey | 7.62:1 | Pass AAA |
| Grey | 7.00:1 | Pass AAA |
| Lighter grey | 4.54:1 | Pass AA |
| Light grey | 3.03:1 | Fail |
| White on blue | 5.16:1 | Pass AA |
| Red | 4.82:1 | Pass AA |
| Green | 3.29:1 | Fail |
| Amber | 2.14:1 | Fail |
#767676 is the lightest grey that passes AA on white; #777777 just misses at 4.47:1. Our own grey text, #57534E, is 7.62:1 on white.
FAQs
How to check for color contrast?
Work out the contrast ratio of the text color and its background with the WCAG formula (the lighter color’s relative luminance + 0.05, divided by the darker one’s + 0.05), then compare it with the minimum: 4.5:1 for normal text and 3:1 for large text at level AA. The checker above does both.
Source W3C · WCAG 2.2, Success Criterion 1.4.3 Contrast (Minimum) ↗
How can I check the contrast of a color online?
Type the text and background colors into a contrast checker as hex codes. Take the colors from the page’s code or style sheet, not from a screenshot: W3C says to use the colors the browser is told to use, because smoothing at the edges of letters makes them look fainter on screen.
Source W3C · Understanding Success Criterion 1.4.3: Contrast (Minimum) ↗
What does 4.5:1 contrast ratio mean?
The lighter color’s relative luminance plus 0.05 is 4.5 times the darker color’s plus 0.05. It is the minimum for normal-size text at level AA, and the AAA minimum for large text. Ratios run from 1:1 (the same color) to 21:1 (black on white).
Source W3C · WCAG 2.2, Success Criterion 1.4.3 Contrast (Minimum) ↗
Is WCAG 2.1 or 2.2 required?
In the US, the Department of Justice’s rule for state and local government websites and apps names WCAG 2.1 Level AA, from April 26, 2027 for governments serving 50,000 or more people and April 26, 2028 for smaller ones.
Sources
- W3C: WCAG 2.2, definition of contrast ratio
- W3C: WCAG 2.2, definition of relative luminance
- W3C: WCAG 2.2, Success Criterion 1.4.3 Contrast (Minimum)
- W3C: WCAG 2.2, Success Criterion 1.4.6 Contrast (Enhanced)
- W3C: WCAG 2.2, Success Criterion 1.4.11 Non-text Contrast
- W3C: Understanding Success Criterion 1.4.3: Contrast (Minimum)
- W3C: WCAG 2.2, New features in WCAG 2.2
- U.S. Department of Justice: Fact Sheet: New Rule on the Accessibility of Web Content and Mobile Apps