What Is the WCAG Contrast Ratio?

WCAG AA requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (18px+ bold or 24px+ regular). WCAG AAA requires 7:1. The contrast ratio formula is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color's relative luminance and L2 is the darker color's relative luminance.

WCAG Contrast Levels

Level Normal Text Large Text
AA (minimum) 4.5:1 3:1
AAA (enhanced) 7:1 4.5:1

How the Formula Works

The contrast ratio ranges from 1:1 (no contrast, same color) to 21:1 (maximum contrast, black on white). To compute it:

  1. Convert each color from hex to linear RGB by dividing each channel by 255 and applying the sRGB transfer function.
  2. Calculate relative luminance: L = 0.2126 * R + 0.7152 * G + 0.0722 * B
  3. Compute the ratio: (L_lighter + 0.05) / (L_darker + 0.05)

What Counts as Large Text?

Large text is 18pt (24px) or larger at regular weight, or 14pt (approximately 18.66px) or larger at bold weight. Large text has a relaxed contrast requirement because its size already improves readability.

Practical Examples

Use the gen8x color contrast checker to test your own color combinations against WCAG standards.

Related Questions