Skip to main content
TOP free online tools Your Workbench
English

Color Contrast Checker

Check WCAG color contrast ratios for accessibility compliance in your browser. Free, online, no upload, fully private.

Local browser processing — zero server uploads

Sample text preview

The quick brown fox jumps over the lazy dog.

Contrast ratio

21.00:1

✓ AA Normal (4.5:1)
✓ AA Large (3:1)
✓ AAA Normal (7:1)
✓ AAA Large (4.5:1)

How to Use

  1. Paste or type your two colors into the Color Contrast Checker input area above.
  2. Configure any format or mode options to generate the contrast ratio in real time.
  3. Review the generated output in the result panel above, or click Reset to start over.

What is Color Contrast Checker?

The Color Contrast Checker measures the luminance contrast ratio between foreground text and background hex colors against WCAG 2.1 accessibility standards. Designers and front-end engineers rely on contrast checking to keep text legible for users with low vision or color-vision deficiencies and meet legal accessibility guidelines.

How It Works

The tool accepts 3-digit or 6-digit hex values via color pickers or text inputs, expands shorthand hex, and converts RGB channels into sRGB relative luminance using the WCAG piecewise linearization formula (threshold 0.03928, exponent 2.4). It computes (L_lighter + 0.05) / (L_darker + 0.05) locally and evaluates four WCAG pass/fail thresholds with a live sample preview.

Common Use Cases

  • Auditing brand color pairs — verify whether primary buttons and body copy meet WCAG 2.1 AA 4.5:1 contrast
  • Designing dark and light UI themes — fine-tune muted text shades until AA Large (3:1) or AAA Normal (7:1) passes
  • Reviewing heading and badge legibility — preview bold 1.25rem and body text directly over the chosen background
  • Fixing accessibility audit failures — quickly iterate foreground hex codes in the browser without design software
Technical Details

Parses /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i, linearizes sRGB channels (c/255 <= 0.03928 ? c/255/12.92 : ((c/255+0.055)/1.055)^2.4), computes L = 0.2126*R + 0.7152*G + 0.0722*B, and checks AA Normal (>=4.5), AA Large (>=3), AAA Normal (>=7), and AAA Large (>=4.5) at 2 decimal places.

FAQ

Is my data uploaded?

No. Contrast calculation happens locally in your browser. Your color values never leave your device.

What WCAG levels are checked?

The tool checks against WCAG 2.1 AA (4.5:1 for normal text, 3:1 for large text) and AAA (7:1 for normal text) thresholds.