← All tools

Color contrast checker (WCAG)

Pick a text color and a background color to see the contrast ratio and the WCAG criteria at once. It runs in your browser and nothing is sent to a server.

Type HEX (#3b82f6), rgb(), hsl() or a color name (blue). Click any swatch below to select that color.

Tints and shades

Complementary color

Analogous colors

Triadic harmony

How to use it

  1. Choose the text color and the background color or type their codes.
  2. The contrast ratio and the preview update at once.
  3. In the table, see whether AA and AAA pass for normal text, large text and UI components.

Frequently asked questions

How is the contrast ratio calculated?

The relative luminance of each color is calculated, then the ratio (luminance of the lighter color + 0.05) / (luminance of the darker color + 0.05) is found. The ratio ranges from 1:1 (same color) to 21:1 (black on white).

What ratios does WCAG require?

For WCAG 2 AA, normal text needs at least 4.5:1 and large text at least 3:1. For AAA, normal text needs 7:1 and large text 4.5:1. For non-text UI components (button borders, icons) at least 3:1 is recommended.

What counts as large text?

In WCAG, text of at least 18 point (about 24 pixels), or at least 14 point (about 18.7 pixels) when bold, counts as large.

How are semi-transparent colors handled?

If the text color is semi-transparent it is blended over the chosen background and the ratio is calculated for the resulting opaque color.

Related guide

Related tools