Work out colour contrast ratio instantly with clear inputs, formula shown and shareable results.
Each channel is linearised, combined into relative luminance with the 0.2126, 0.7152 and 0.0722 weights, and the ratio is the lighter luminance plus 0.05 over the darker plus 0.05. WCAG requires 4.5:1 for body text and 3:1 for large text, and the green-heavy luminance weighting is why green text on white often passes where red does not.
Relative luminance
L = 0.2126 R + 0.7152 G + 0.0722 B, using linearised channel values
Contrast ratio
ratio = (lighter L + 0.05) / (darker L + 0.05)
L = 0.2126 R + 0.7152 G + 0.0722 B, using linearised channel values. Each channel is linearised, combined into relative luminance with the 0.2126, 0.7152 and 0.0722 weights, and the ratio is the lighter luminance plus 0.05 over the darker plus 0.05.
WCAG requires 4.5:1 for body text and 3:1 for large text, and the green-heavy luminance weighting is why green text on white often passes where red does not.
Enter text colour (hex), background colour (hex). The defaults shown are a realistic worked example — swap in your own figures to get a result you can use.