All tools Developer

Contrast Checker

Check the contrast ratio of two colors against WCAG AA and AAA.

Contrast ratio

—

The quick brown fox jumps over the lazy dog

Runs in your browser. Nothing you open or type here is uploaded.

How to use

  1. Enter a text color and a background color.
  2. Read the contrast ratio and the AA and AAA pass or fail marks.
  3. Check the preview line in your two colors.
  4. Use Swap colors to test the reverse pairing.

Details

The checker computes the contrast ratio between two colors from their relative luminance, following the WCAG formula: 1:1 is no contrast and 21:1, black on white, is the maximum. WCAG AA requires 4.5:1 for normal text and 3:1 for large text; AAA requires 7:1. The page shows the ratio, a pass or fail mark for each level, and a preview sentence set in your colors.

  • Large text means roughly 24 px, or 19 px bold; body text needs the full 4.5:1 to pass AA.
  • Check pairs as they will actually appear: a color that passes on white can fail on a light grey background.

Common questions

What ratio should I aim for?

4.5:1 for normal text (WCAG AA), 3:1 for large text. 7:1 reaches AAA.

How is the ratio calculated?

Relative luminance per the WCAG formula, computed locally in your browser.