Tools

Pick a text colour and a background colour to get the contrast ratio and a pass or fail against the WCAG 2 levels for normal text, large text and UI components. The live preview shows exactly how the pairing reads.

Colours

Contrast ratio

7.90:1

  • Normal text, AAPass · needs 4.5:1
  • Normal text, AAAPass · needs 7:1
  • Large text, AAPass · needs 3:1
  • Large text, AAAPass · needs 4.5:1
  • UI components and graphicsPass · needs 3:1

Preview

Large text looks like this

Normal body text at 16px. The quick brown fox jumps over the lazy dog, then checks whether anyone could actually read about it.

Small print at 14px, the hardest to read.

A button outline

CSS

color: #4338ca;
background-color: #ffffff;
/* contrast ratio 7.90:1 */

Frequently asked questions

What contrast ratio do I need?
WCAG 2 level AA requires 4.5:1 for normal text and 3:1 for large text (at least 24px, or 19px bold) and for UI components and graphics. Level AAA raises those to 7:1 and 4.5:1.
How is the contrast ratio calculated?
Each colour is converted to relative luminance, then the ratio is (lighter + 0.05) / (darker + 0.05). Black on white gives the maximum, 21:1; identical colours give 1:1.
Does contrast matter for people without visual impairments?
Yes. Low contrast is hard to read on a phone in sunlight, on a cheap monitor or for anyone as their eyes age. Good contrast helps everyone.

quick question

Was this tool helpful?