Design & CSS Tools

Color Contrast Checker

Test whether text and background colors are readable and meet WCAG rules.

Large text sample (24px bold)

Normal body text sample. The quick brown fox jumps over the lazy dog.

—
Contrast ratio (from 1:1 to 21:1)
—AA normal text (4.5:1)
—AA large text (3:1)
—AAA normal text (7:1)
—AAA large text (4.5:1)

Why color contrast matters

Text that does not stand out clearly from its background is hard to read, especially on a phone in sunlight, for older readers and for the roughly 1 in 12 men with some form of color blindness. The Web Content Accessibility Guidelines (WCAG) set minimum contrast ratios so that text is readable for as many people as possible. Good contrast also makes pages look sharper and more professional for everyone.

How to check contrast

  1. Choose the text color and the background color, or type their HEX codes.
  2. Read the contrast ratio and see whether it passes each WCAG level.
  3. If it fails, make the text darker or the background lighter (or the reverse) until it passes. Use Swap colors to test light text on a dark background.

WCAG contrast requirements

LevelNormal textLarge text*
AA (minimum, most laws and standards)4.5 : 13 : 1
AAA (enhanced)7 : 14.5 : 1

*Large text means at least 24 px regular, or about 18.66 px bold. Icons and the borders of form fields need at least 3 : 1.

How the ratio is calculated

Each color is converted to its relative luminance (L), a measure of how bright it appears to the human eye. Green counts most and blue least:

L = 0.2126 × R + 0.7152 × G + 0.0722 × B (after gamma correction)
contrast = (Llighter + 0.05) / (Ldarker + 0.05)

Black on white gives the maximum, 21 : 1. Two identical colors give 1 : 1. The popular grey #64748B on white is about 4.76 : 1, which passes AA but not AAA.

Frequently asked questions

Is AA enough?

AA is the level required by most accessibility laws and is a good target for any website. Aim for AAA for long articles and important information.

Does contrast apply to placeholder text?

Yes. Light grey placeholder text often fails. Make sure it reaches at least 4.5 : 1.

How can I build a whole accessible palette?

Start with the Color Palette Generator, then test each text and background pair here.