Tool

Color Contrast Checker

Check whether a text color is readable on a background color, using the WCAG contrast formula.

The quick brown fox jumps over the lazy dog.

    How to use it

    Pick or type the color of your text and the color behind it. The sample and the results update as you type.

    What the numbers mean

    The ratio runs from 1:1, where both colors are identical, to 21:1 for black on white. The Web Content Accessibility Guidelines ask for at least 4.5:1 for normal text at level AA, and 3:1 for large text, meaning about 24 pixels, or about 19 pixels when bold. Level AAA raises those to 7:1 and 4.5:1.

    How it is calculated

    Each color channel is converted from its sRGB value to linear light, then weighted: 0.2126 for red, 0.7152 for green and 0.0722 for blue. The result is the relative luminance. The ratio is the lighter luminance plus 0.05, divided by the darker luminance plus 0.05. The displayed number is rounded down, so a color pair never appears to pass when it falls just short.

    Contrast is one part of readability. Font weight, size and busy background images matter too.

    More tools