Skip to main content

WCAG Accessible Color Generator

Create accessible color combinations that meet WCAG standards.
Get auto-suggested colors and copy CSS custom properties.

Sample Text

The quick brown fox jumps over the lazy dog.

This is an example of body text to help you visualize how your color combination will look in real content.

Contrast Ratio
17.40:1
Passes WCAG AAA

WCAG Compliance

AA Normal Text
Requires 4.5:1
PASS
AA Large Text
Requires 3:1
PASS
AAA Normal Text
Requires 7:1
PASS
AAA Large Text
Requires 4.5:1
PASS

Large text is defined as 18pt (24px) or 14pt (18.5px) bold. Normal text is anything smaller.

:root {
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  /* Contrast ratio: 17.4:1 - Passes WCAG AAA */
}

Understanding WCAG Contrast Requirements

Level AA (Minimum)

  • 4.5:1 for normal text (under 18pt or 14pt bold)
  • 3:1 for large text (18pt+ or 14pt+ bold)
  • Required for WCAG 2.0/2.1 Level AA compliance

Level AAA (Enhanced)

  • 7:1 for normal text
  • 4.5:1 for large text
  • Highest level of accessibility compliance

How the WCAG Formula Works

The contrast ratio is calculated by comparing the relative luminance of both colors. Luminance values range from 0 (black) to 1 (white). The formula is:(L1 + 0.05) / (L2 + 0.05)where L1 is the lighter color's luminance and L2 is the darker color's luminance.