Productive Toolbox

Color Palette Contrast Grid

Check the WCAG contrast of every text and background combination in a color palette at once, and see which pairs pass AA and AAA.

Color Palette

Presets

Settings

Contrast Grid (20)

AAA
AA
Large
Fail
Sample Text
AAA
21.00:1
Sample Text
AAA
21.00:1
Sample Text
AAA
12.29:1
Sample Text
AAA
12.29:1
Sample Text
AA
6.87:1
Sample Text
AA
6.87:1
Sample Text
AA
4.66:1
Sample Text
AA
4.66:1
Sample Text
AA
4.50:1
Sample Text
AA
4.50:1
Sample Text
AA Large
3.05:1
Sample Text
AA Large
3.05:1
Sample Text
Fail
2.63:1
Sample Text
Fail
2.63:1
Sample Text
Fail
1.78:1
Sample Text
Fail
1.78:1
Sample Text
Fail
1.70:1
Sample Text
Fail
1.70:1
Sample Text
Fail
1.47:1
Sample Text
Fail
1.47:1

Export Palette

WCAG Contrast Requirements

The Web Content Accessibility Guidelines set minimum contrast ratios so that text stays readable for people with low vision or color blindness, and for everyone on a phone in bright sunlight. Most accessibility laws and policies, including the ADA in the US and the European Accessibility Act, point to WCAG level AA.

ContentLevel AALevel AAA
Normal text4.5:17:1
Large text (โ‰ฅ 24px, or โ‰ฅ 18.7px bold)3:14.5:1
UI components and graphics3:1โ€“

contrast = (Llighter + 0.05) รท (Ldarker + 0.05)

L = 0.2126 R + 0.7152 G + 0.0722 Bย ย (linearised sRGB)

Common Colors on White

Text colorSampleRatioResult
#595959 Dark graySample text7.00:1AAA
#767676 Mid graySample text4.54:1AA
#777777 One step lighterSample text4.47:1AA large text only
#1A73E8 Google blueSample text4.50:1AA
#34A853 Google greenSample text3.05:1AA large text only
#FF0000 Pure redSample text3.99:1AA large text only

Ratios are rounded down, so a pair shown at 4.50:1 really passes 4.5:1.

How to Use the Contrast Grid

  1. 1Enter your palette: Add your brand or design colors as HEX codes, start from a preset such as Material or Tailwind, or generate a random palette.
  2. 2Read the grid: Each cell shows one color as text on another as background, with its contrast ratio and WCAG level.
  3. 3Filter the results: Show only pairs that pass AAA or AA, only failing pairs, or sort from highest to lowest contrast.
  4. 4Export: Click a pair to copy its CSS, or export the whole palette as CSS custom properties or SCSS variables.

Frequently Asked Questions

What contrast ratio does WCAG require?

WCAG 2.1 level AA asks for at least 4.5:1 between text and its background, and 3:1 for large text (18pt, about 24px, or 14pt bold, about 18.7px). Level AAA asks for 7:1 and 4.5:1. Icons, input borders and other parts of controls need 3:1 against what is next to them.

How is the contrast ratio calculated?

From the relative luminance L of each color: (L1 + 0.05) รท (L2 + 0.05), with the lighter color on top. Luminance weights the linearised red, green and blue channels by 0.2126, 0.7152 and 0.0722, because our eyes are most sensitive to green. The ratio runs from 1:1 (same color) to 21:1 (black on white).

Why use a grid instead of checking pairs one by one?

A palette of 6 colors has 30 possible text and background pairs. The grid shows them all at once, so you can see which combinations are safe for body text, which only work for headings, and which to avoid, before they end up in a design.

What is the lightest gray that passes on white?

#767676, at 4.54:1. One step lighter, #777777, gives 4.47:1 and fails AA for normal text. That is why this tool rounds ratios down: a value shown as 4.5:1 always passes.

Does passing the contrast check make a design accessible?

It covers one important criterion. Also make sure color is not the only way information is shown (add labels or icons to red and green states), that focus outlines are visible, and that text can be resized.