My Color Palette Generator

Color Contrast Checker

Enter a text color and a background color to get the WCAG contrast ratio and AA/AAA results instantly.

Sample text at 16px and 24px large text

Contrast ratio: –

Last updated:

How to check color contrast

  1. Enter foreground and background. Type or pick two HEX colors: the text color and its background.
  2. Read the ratio. The tool shows the contrast ratio and AA/AAA pass or fail for normal and large text.
  3. Adjust the colors. Swap the colors or darken or lighten one of them until the pair passes, then open both in the palette generator.

WCAG 2 contrast requirements

LevelNormal textLarge text (18 pt / 14 pt bold)
AA4.5:13:1
AAA7:14.5:1

Neon accents on dark backgrounds often pass for large headings but fail for small body copy, so test both sizes. When text sits on a gradient, test it against the lightest and the darkest stop from the CSS gradient generator.

Open this pair in the palette generator →

Frequently asked questions

What contrast ratio do I need?

WCAG 2 level AA needs 4.5:1 for normal text and 3:1 for large text (18 pt, or 14 pt bold). Level AAA needs 7:1 for normal text and 4.5:1 for large text.

How is the contrast ratio calculated?

Each color's relative luminance is computed from its sRGB values, then the ratio is (lighter + 0.05) ÷ (darker + 0.05). It ranges from 1:1 (same color) to 21:1 (black on white).

Is this a full accessibility audit?

No. It checks contrast between two solid colors only. It does not test focus indicators, text over images or gradients, or other WCAG requirements.

Related tools