Color Contrast & Color Accessibility

Color Contrast Checker

Evaluate foreground and background color pairs against WCAG 2.2 Success Criteria 1.4.3 (Contrast Minimum), 1.4.6 (Contrast Enhanced), and 1.4.11 (Non-text Contrast) using exact sRGB relative luminance math.

Your files and content are processed locally in your browser. We do not upload your files to our servers.

What This Tool Does

  • Computes exact W3C relative luminance and contrast ratio from 1:1 to 21:1.
  • Accepts HEX, RGB, and HSL inputs with instant color swapping and live text previews.
  • Evaluates Normal Text AA (4.5:1), Normal Text AAA (7:1), Large Text AA (3:1), and UI Components (3:1).
  • Suggests the closest accessible lightness adjustment while preserving your brand hue.

Who Should Use It

  • UI/UX designers building design system color tokens.
  • Front-end developers verifying button, link, and body text legibility.
  • Accessibility auditors documenting contrast defects with exact ratios.

How to Use Color Contrast Checker

  1. Enter or pick a Foreground (text) color and Background color in HEX, RGB, or HSL.
  2. Review the real-time contrast ratio and Pass/Fail badges across AA and AAA levels.
  3. Use 'Suggest Accessible Fix' if a pair fails, or copy CSS variables directly.

Accessibility Principles & Technical Methodology

WCAG contrast is calculated from relative luminance rather than perceived brightness alone. Because human vision is more sensitive to green wavelengths than red or blue, the sRGB relative luminance formula weights green at 0.7152, red at 0.2126, and blue at 0.0722 after gamma linearization.

Technical Methodology

Applies the official WCAG 2.2 sRGB linearization threshold (0.04045) and relative luminance formula L = 0.2126*R + 0.7152*G + 0.0722*B, then computes (L1 + 0.05) / (L2 + 0.05).

Practical Examples

Accessible Primary Button Pair

White text (#FFFFFF) on Cobalt Blue (#2563EB) yields 5.17:1, passing WCAG AA for both normal and large text.

Avoid
color: #FFFFFF; background: #60A5FA; /* 2.54:1 - Fails AA */
Recommended
color: #FFFFFF; background: #2563EB; /* 5.17:1 - Passes AA */

Relevant WCAG 2.2 Criteria

  • 1.4.3 Contrast (Minimum) (AA)
  • 1.4.6 Contrast (Enhanced) (AAA)
  • 1.4.11 Non-text Contrast (AA)
Explore WCAG 2.2 Guide

Common Mistakes to Avoid

  • Using #9CA3AF or light slate gray text on white backgrounds (often under 2.6:1).
  • Testing only default state while forgetting :hover, :focus, or placeholder text contrast.
  • Assuming brand guidelines override minimum legibility requirements.

Color Contrast Checker — FAQs

Normal text under 18pt (24px) or under 14pt (18.67px) bold requires at least a 4.5:1 contrast ratio.

Color Contrast

WCAG AA Contrast Checker

Verify compliance with WCAG 2.2 Level AA thresholds (4.5:1 normal, 3:1 large & UI).

Open tool
Color Contrast

WCAG AAA Contrast Checker

Test high-legibility palettes against WCAG 2.2 Level AAA (7:1 normal, 4.5:1 large).

Open tool
Color Contrast

Color Blindness Simulator

Preview how color palettes and uploaded UI screenshots look under major CVDs.

Open tool