AccessibilityBy PaletteKey Team 7 min read

Color Contrast Ratio Explained: WCAG AA, AAA & 4.5:1

The relative luminance formula, contrast thresholds, and meeting WCAG 2.2 standards.

Key Technical Takeaway

Contrast ratio measures relative luminance difference between foreground text and background surface on a scale from 1:1 (invisible) to 21:1 (black/white). WCAG 2.2 AA mandates a minimum 4.5:1 ratio for body text.

The Mathematical Contrast Ratio Formula

Under WCAG 2.2 guidelines, contrast ratio is calculated using relative luminance values (L1 and L2):

Contrast Ratio = (L1 + 0.05) / (L2 + 0.05)

Where:
L1 = Relative luminance of the lighter color (0.0 to 1.0)
L2 = Relative luminance of the darker color (0.0 to 1.0)
0.05 = Ambient light compensation constant

Relative Luminance and Spectral Sensitivity

Relative luminance (L) evaluates human eye sensitivity across light wavelengths. The human retina is far more sensitive to green wavelengths than red or blue, as reflected in the sRGB linearized formula:

Linearized sRGB Component Calculation:
If C <= 0.04045 -> C_linear = C / 12.92
Else            -> C_linear = ((C + 0.055) / 1.055) ^ 2.4

Relative Luminance L = (0.2126 * R_linear) + (0.7152 * G_linear) + (0.0722 * B_linear)

WCAG 2.2 Compliance Benchmark Thresholds

WCAG 2.2 establishes distinct minimum compliance thresholds depending on text size, font weight, and element type:

WCAG LevelContent TypeMinimum RatioExample Font Criteria
Level AANormal Body Text4.5 : 1Text below 18pt (24px) or bold below 14pt (18.66px)
Level AALarge Heading Text3.0 : 1Text >= 18pt (24px) or bold >= 14pt (18.66px)
Level AAUI Controls & Icons3.0 : 1Form input borders, active icons, focus rings
Level AAANormal Body Text7.0 : 1Enhanced contrast for low-vision readers
Level AAALarge Heading Text4.5 : 1Enhanced contrast for large headings

Common Accessibility Pitfalls in Digital UI

Avoiding low-contrast defects requires testing active states and secondary UI elements:

  • Disabled buttons are exempt from WCAG contrast rules, but making them readable improves usability.
  • Placeholder text in input fields MUST meet the 4.5:1 ratio if critical instructions are conveyed.
  • Focus indicators and active state outlines require a minimum 3.0:1 contrast against adjacent background colors.

Put Theory into Practice with Free Color Tools

Apply the concepts from this guide directly in your web workflow with our interactive tools.