Color tool

Color Contrast Checker

Compare two colors using the WCAG relative-luminance contrast formula.

The tool reports the contrast ratio and common WCAG text thresholds; context still matters for accessibility.

What this tool does

Contrast ratio compares the relative luminance of a foreground and background. WCAG uses this ratio for text and also defines a separate 3:1 requirement for many user-interface components and graphical objects.

Enter the values in the calculator above and choose Calculate. The calculation runs in your browser; the inputs are not intentionally sent to a Colormapped application server.

How it works

  1. Convert each sRGB channel to linear-light values using the WCAG transfer function.
  2. Combine linear red, green, and blue with the WCAG relative-luminance coefficients.
  3. Put the lighter luminance above the darker one in (L1 + 0.05) / (L2 + 0.05).
  4. Compare the ratio with the relevant text-size or non-text requirement for your use case.

Worked example

Input#111827 on #FFFFFF
Output17.74:1

This pair comfortably exceeds AA and AAA text thresholds. The tool still cannot decide whether color is being used as the only cue for meaning.

When to use it

  • Check body text and headings against their actual backgrounds.
  • Validate dark-mode and light-mode text pairs.
  • Screen candidate brand colors before assigning them to text or controls.

Accuracy and limits

  • Contrast ratio alone is not a complete accessibility audit.
  • Text size/weight, UI-component rules, focus states, gradients, transparency, and color-independent cues still matter.

Useful next steps