AnsRioSmart tools. Clear answers.
Home / Web & design / Color contrast ratio
Web & design

Color contrast ratio

Color contrast ratio: WCAG relative luminance: linearize sRGB, L=0.2126R+0.7152G+0.0722B; ratio=(lighter+.05)/(darker+.05)

Make it your own ⌁ Runs on your device

Your inputs are processed locally and are not added to analytics or saved history.

YOUR RESULT
Ready when you are.

Enter your values, then select Calculate.

How it works

WCAG relative luminance: linearize sRGB, L=0.2126R+0.7152G+0.0722B; ratio=(lighter+.05)/(darker+.05)

Input definitions

Text color (#RRGGBB)
Enter the value in the labeled unit.
Background color (#RRGGBB)
Enter the value in the labeled unit.

A worked example

Text color (#RRGGBB)
#000000
Background color (#RRGGBB)
#ffffff
21

Assumptions & limits

Uses the stated input units. Results are rounded for display; keep additional precision for subsequent calculations.

Sources & review

Maintained by AnsRio. Methods and examples use automated checks; this does not imply independent professional certification.

Method updated 2026-10-17. Content checked against the stated method and examples. Our verification approach.

Common questions

Does generated CSS or a color result guarantee an accessible design?

No. Test the result in its real layout, including text contrast, browser zoom, focus and responsive behavior. A code generator only covers its documented property or color operation.

How does the Color contrast ratio tool work?

WCAG relative luminance: linearize sRGB, L=0.2126R+0.7152G+0.0722B; ratio=(lighter+.05)/(darker+.05).

What are the assumptions and limits of Color contrast ratio?

Uses the stated input units. Results are rounded for display; keep additional precision for subsequent calculations.

↗
Made for the question in front of you.

No sign-up. Tool inputs stay on your device.

How we work