Color contrast checker

Pick a text color and a background. You get the WCAG contrast ratio, a pass or fail for each level and, when it fails, the closest color that passes.

Every Motionmart pack accent is checked this way, on white and on dark.

Questions

What contrast ratio do I need?

WCAG 2.2 level AA asks for 4.5:1 for normal text and 3:1 for large text (24px, or 18.66px bold) and for icons and control borders. Level AAA asks for 7:1 and 4.5:1.

How is the ratio worked out?

Each color's relative luminance is calculated from its sRGB values, then (lighter + 0.05) ÷ (darker + 0.05). The result runs from 1:1 (same color) to 21:1 (black on white).

Why does my bright accent fail on white?

Yellow, lime and cyan are light colors, so their luminance is close to white. Use them as backgrounds with dark text on top, or darken the shade for text and thin lines.

Does a pass mean it is readable?

It means it meets the standard. Thin fonts, small sizes and busy backgrounds still read worse, so check the preview at the size you will use.

More free tools · Animation glossary