Contrast Ratio Calculator
Compute WCAG contrast ratio between two luminance values.
Description
Compute WCAG contrast ratio between two luminance values.
Contrast Ratio Calculator: Compute WCAG contrast ratio between two luminance values.
When to use Contrast Ratio
Use this color calculation to reproduce a defined sRGB compositing, blending, luminance, or accessibility-contrast operation with explicit color inputs.
- Luminance 1
- Required number input.
- Luminance 2
- Required number input.
How Contrast Ratio works
Compute WCAG contrast ratio between two luminance values. The tool evaluates the supplied inputs together and returns the named outputs below; it does not infer omitted operating conditions or change the units shown.1
- Contrast ratio
- The resulting contrast ratio returned as a number.
Limitations and assumptions
- Results depend on color space, transfer function, alpha convention, rounding, display profile, and the precise accessibility formula. Numeric contrast does not by itself establish readability for every user or interface state.
- Use finite inputs in the displayed units and preserve more precision than the final presentation requires. Independently verify safety-critical, financial, compliance, or production decisions.
Alternative or Complementary approaches
Verify the color-space and alpha assumptions, inspect the rendered result, and test relevant foreground, background, hover, disabled, and focus states. Pair contrast checks with broader accessibility review.
References
-
Web Content Accessibility Guidelines — Wikipedia contributors
Similar or alternative tools
- Relative Luminance Calculator
Compute WCAG relative luminance from RGB values 0-255.
- Delta E 76 Color Difference
Compute the CIE76 (Delta E 1976) difference between two sRGB hex colors via CIELAB.
- Color Blend Calculator
Blend two hexadecimal sRGB colors by interpolating their channels.