Color Contrast Checker

Enter a text colour and a background colour as hex codes to see the WCAG 2 contrast ratio and a pass or fail for each level, with a sample.

Use the tool

Loading the tool…

About Color Contrast Checker

Check the contrast between a text colour and a background colour, to see whether the text is readable. Enter both as hex codes.

Worked example

Enter black text (#000000) on a white background (#ffffff). The contrast is at its highest.

Limits

The check compares two colours only. Check the result for the text size and weight you use, because the accessibility rules set different minimums for different text.

How to use Color Contrast Checker

  1. Enter the text colour and the background colour as hex codes.
  2. Read the ratio and the pass or fail for each level.
  3. Change the colours until the level you need passes.

Good to know

  • The ratio runs from 1:1 (no contrast) to 21:1 (black on white).
  • AA needs 4.5:1 for normal text and 3:1 for large text and interface parts. AAA needs 7:1 for normal text and 4.5:1 for large text.
  • Large text means at least 24 px, or 18.66 px in bold.
  • This checks two solid colours only. Test the real page, because images, thin fonts and colour blindness are not covered.

Frequently asked questions

Why is the ratio cut off instead of rounded?

WCAG says a ratio must not be rounded up to pass. A ratio of 4.499 shows as 4.49 and fails the 4.5 limit.

Does it work with transparent colours?

No. Use solid colours with 3 or 6 hex digits. Mix a transparent colour with its background first.

Is anything I type saved or sent?

No. The work happens in your browser on this page, and nothing is stored or sent to us.