sRGB Contrast Check

Accessible design

How sRGB Contrast Check works

Check solid foreground and background sRGB colors against WCAG 2.2 text contrast thresholds without rounding the pass/fail decision.

Convert sRGB to luminance

Normalize each channel to 0–1. Convert encoded sRGB channels to linear values using the 0.04045 breakpoint, then combine red, green and blue with the WCAG luminance weights.

Use the unrounded ratio

Divide the higher relative luminance plus 0.05 by the lower relative luminance plus 0.05. WCAG 2.2 AA calls for at least 4.5:1 for ordinary text or 3:1 for qualifying large text. AAA uses 7:1 and 4.5:1 respectively.

Review rendered text and context

Large text has a defined WCAG size and weight; a heading is not automatically large text. This calculator evaluates two opaque solid sRGB colors, not gradients, opacity, images, interactive states or full-page accessibility. See the W3C WCAG 2.2 standard and contrast guidance.

Worked example

Black on white has a 21:1 contrast ratio. #767676 on white is approximately 4.54:1 and meets the AA ordinary-text threshold; #777777 on white is about 4.48:1 and does not.

Try the calculator

About the method

This tool uses the stated arithmetic and assumptions. Test the worked example and confirm the inputs before using the result.

Reference material