Normal text needs a contrast ratio of at least 4.5:1 against its background. Large text needs 3:1. A stricter level asks for 7:1 on normal text. Black on white scores the maximum, 21:1.

A ratio is just a way to measure how different two colors are in lightness. This page explains the three numbers, shows how to check your own colors, and covers the traps: light gray text and busy backgrounds.

What a contrast ratio is

A contrast ratio compares the lightness of two colors. WCAG 2.2 defines it with the relative luminance of the lighter color and of the darker color. The ratio runs from 1 to 21, written 1:1 to 21:1.

At 1:1 the two colors are the same, so the text vanishes. At 21:1 you have pure black on pure white.

The method looks at lightness, not hue. The WCAG page for this criterion says contrast is calculated so that color is not a key factor. A pale yellow on white fails for the same reason a pale gray does. Both are too close in lightness.

The three numbers

Each number belongs to a level of WCAG 2.2. Level AAA is the stricter one.

RatioApplies toLevel
4.5:1Normal textAA
3:1Large textAA
7:1Normal textAAA
4.5:1Large textAAA

WebAIM adds that WCAG 2.1 asks for at least 3:1 for graphics and user interface components, such as form input borders.

The thresholds are exact. The WCAG page says computed values should not be rounded. A ratio of 4.499:1 does not meet 4.5:1.

Logos and brand names have no contrast requirement. Neither does text that is purely decorative.

What counts as large text

The lower ratio applies to large text. WCAG defines large text as 18 point or larger, or 14 point bold or larger. The WCAG page says 18 and 14 points are roughly 24 and 18.5 pixels. WebAIM gives 18.66 pixels for 14 points.

The WCAG page explains the reason. Larger text with wider strokes is easier to read at lower contrast. That is also why the extra room only applies to big text, such as a page title.

Most body text sits below that size. When in doubt, test against 4.5:1.

Checking your own colors

You can test a pair of colors in a minute. WebAIM's Contrast Checker takes a foreground and a background color in hexadecimal form. It reports the ratio and shows pass or fail for normal and large text. The color picker has an eye dropper that can take a color from any element on screen.

This table shows gray text on a white page. The ratios were calculated with the WCAG formula and rounded to two places. Confirm any pair in the checker before you use it.

Text colorRatio on whiteMeets 4.5:1Meets 7:1
#00000021:1YesYes
#33333312.63:1YesYes
#5959597.00:1YesYes
#6666665.74:1YesNo
#7676764.54:1YesNo
#7777774.48:1NoNo
#9999992.85:1NoNo
#CCCCCC1.61:1NoNo

Notice how little separates #767676 from #777777. One step in the hex code is the difference between pass and fail. That is why you should test instead of guessing by eye.

Before you finish a page, run this checklist.

  • Body text meets 4.5:1 against its real background.
  • Large headings meet at least 3:1.
  • Borders of form fields and buttons meet 3:1.
  • Gray hint text and captions were tested, not assumed.
  • Text over an image or colored panel was tested at its worst spot.

Light gray text and tricky backgrounds

Light gray is a very common mistake. It looks calm and modern on a designer's bright screen. On a dim laptop or a printed copy, it fades.

Before: Light gray text (#999999) on a white page. The ratio is 2.85:1, below the 4.5:1 minimum.

After: Dark gray text (#595959) on the same page. The ratio is 7.00:1, which meets even the stricter 7:1 level.

Backgrounds cause the second trap. Text on a photo or a pattern changes contrast from word to word. The WCAG page lists "background images that do not provide sufficient contrast" as a known failure. The fix is to put the text on a solid panel. Test at the lightest and darkest spot behind the words.

Colored panels need testing too. White on a mid-orange such as #E8590C gives 3.58:1. That is fine for a large heading and too low for body text.

Thin fonts need extra care. The WCAG page says that very thin or unusual fonts may render fainter than their code color. It encourages a font with stronger lines or a ratio above the minimum.

The Easy-Read Editor offers contrast themes, so you can see your own text in a different pairing. For text on a dark background, see dark mode and reading.

Common mistakes

  • Trusting your eyes on your own bright screen.
  • Choosing light gray for hint text, captions or footnotes.
  • Placing text directly over a photo.
  • Testing the text color but not the button or border color.
  • Treating a "close enough" ratio such as 4.4:1 as a pass.
  • Forgetting that a printed copy can look weaker than the screen. See printing in black and white.

FAQ

Is 4.5:1 enough for everyone?

It is the minimum, and it guarantees nothing. The stricter 7:1 level is also available. Choosing darker text is usually easy, so aim above the minimum when you can.

Does black text on white give the best result?

It gives the highest ratio, 21:1. Some designers soften it with a very dark gray. Dark gray such as #333333 still scores 12.63:1.

Do I need to test placeholder and hint text?

Yes. Hint text is still text. If a reader needs to read it, it must meet the same ratio.

Where can I run a broader check?

The article on a quick accessibility check covers ten minutes of simple tests.

Sources

Each page below was opened and read on the date shown. Where a fact comes from one of them, the guide says so.

This guide gives general information about readability. See the Disclaimer. To report a mistake, use the Corrections page.