Developer

Color Contrast Checker

Pick foreground and background colors to compute the WCAG contrast ratio from relative luminance. See pass/fail badges for AA and AAA at normal and large text sizes, plus a live preview swatch with sample text.

Examples

Input
#1a1a1a on #ffffff
Output
≈ 17.4:1 — passes AA and AAA

How it works

The ratio follows the WCAG 2 formula. Each colour’s red, green and blue values are converted to linear light, weighted (red 0.2126, green 0.7152, blue 0.0722) and added up to give its relative luminance. The ratio is then (lighter + 0.05) ÷ (darker + 0.05), which runs from 1:1 for identical colours to 21:1 for black on white.

Minimum ratios the tool checks
LevelNormal textLarge text
AA4.5:13:1
AAA7:14.5:1

WCAG counts text as large from 24px regular or about 18.66px bold. Swapping foreground and background gives the same ratio. Colours are entered as 3- or 6-digit hex with no transparency, so a semi-transparent colour has to be flattened onto its background before you test it.

How to use Color Contrast Checker

Pick your colors
Set the text and background colors with the pickers or hex inputs.
Read the ratio
See the contrast ratio computed from WCAG relative luminance.
Check compliance
Review pass/fail badges for AA and AAA at normal and large sizes.

Why use this tool

Computes accurate WCAG contrast ratios
Pass/fail badges for AA and AAA, normal and large text
Live preview swatch with real sample text
Accepts 3- or 6-digit hex and color pickers

Frequently asked questions

It uses the WCAG formula based on relative luminance of the two colors.

AA requires 4.5:1 for normal and 3:1 for large text; AAA requires 7:1 for normal and 4.5:1 for large text.

Found a bug or have an idea?

ToolOrbit is actively developed — feedback directly shapes what gets built next.

Send feedback