Contrast

Contrast is the difference between the lightness and darkness of two colors. Good color contrast makes content accessible by making text and controls easier to see and read.

Accessible contrast benefits people who have various types of colorblindness, have low vision, are neurodivergent, or are viewing content in different lighting conditions.

In digital design, the contrast between two color values can be calculated mathematically as a contrast ratio. Digital accessibility standards define the required minimum value for contrast in Success Criterion 1.4.3 Contrast (Minimum).

Best Practices

When selecting text and background, choose a dark text on light background, or light text on dark background. Neutral colors, including dark grays and off-whites, are good choices and can be less harsh than white on black.

Avoid text and background that are both strong colors, such as a bright blue and bright yellow. These color combinations usually have low contrast between them because neither is very dark or light.

Plan your design with accessible color combinations.

Check Color Contrast

When reviewing existing content, visually scan text and controls for low contrast. Any combinations that look low contrast should probably be improved.

To check the contrast value between two colors, use a color contrast checker. The checker will calculate the value and tell you if the combination passes or fails.

Examples

The examples below show good and bad contrast.

 

This is good color contrast

This is good contrast too

This is bad color contrast

This is also bad contrast
 

Note that there are different contrast requirements for different size text.

Text SizeDefinitionMinimum Contrast
Regular textLess than 18 points (24 pixels*) non-bolded, or less than 14 points (18 pixels) bolded4.5:1
Large text18 points (24 pixels*) or larger non-bolded, or 14 points (18 pixels) or larger bolded3:1

Some color combinations technically pass contrast requirements, but are still difficult to see or read for many people. Avoid combinations that look low contrast to you or your users. The examples below include combinations that pass the requirements but may be difficult (such as sample 4 and others).

  1. Sample 9.04:1
  2. Sample 18.06:1
  3. Sample 14.04:1
  4. Sample 6.03:1
  5. Sample 21:1
  6. Sample 2.67:1 (fail)
  7. Sample 1.1:1 (fail)
  8. Sample 2.09:1 (fail)
  9. Sample 21:1
  10. Sample 1.14:1 (fail)