Color Contrast & Color Accessibility

Contrast Ratio Calculator

Built for engineers and accessibility specialists who want transparent math: view linearized sRGB channel values, exact relative luminance L1/L2, and the resulting contrast ratio.

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

What This Tool Does

  • Displays relative luminance values for both colors to 4 decimal places.
  • Converts simultaneously between HEX, RGB, and HSL formats.
  • Calculates exact contrast ratio without rounding shortcuts.

Who Should Use It

  • Design token engineers
  • Automated test suite authors
  • Accessibility auditors

How to Use Contrast Ratio Calculator

  1. Paste any HEX, rgb(), or hsl() value into either color input.
  2. Read the L1/L2 luminance breakdown and full precision ratio.

Accessibility Principles & Technical Methodology

Knowing the exact L1 and L2 luminance values helps explain why two colors that appear equally bright to the eye can produce very different contrast ratios.

Technical Methodology

Implements WCAG 2.2 Definition of Relative Luminance with gamma 2.4 exponentiation above 0.04045.

Practical Examples

Pure Black vs Pure White

L1 = 1.0000, L2 = 0.0000 -> (1.05)/(0.05) = 21.00:1.

Relevant WCAG 2.2 Criteria

  • 1.4.3 Contrast (Minimum) (AA)
  • 1.4.6 Contrast (Enhanced) (AAA)
Explore WCAG 2.2 Guide

Common Mistakes to Avoid

  • Using outdated 0.03928 threshold instead of the updated 0.04045 sRGB breakpoint.

Contrast Ratio Calculator — FAQs

21:1 between pure white (#FFFFFF) and pure black (#000000).
Color Contrast

Color Contrast Checker

Measure exact WCAG 2.2 luminance contrast for text, headings, and UI components.

Open tool
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