Enter the relative luminance of the lighter color and relative luminance of the darker color into the calculator to determine the contrast ratio.

Contrast Ratio Formula

The following formula is used to calculate a contrast ratio.

cr = (L1+.05) / (L2 + .05) 
  • Where cr is the contrast ratio
  • L1 is the relative luminance of the lighter color
  • L2 is the relative luminance of the darker color

The relative luminance of the lighter color refers to the brightness of the color in relation to a reference white.

Relative luminance of the darker color refers to the perceived brightness of a color compared to a darker color within the same context.

What is a Contrast Ratio?

The contrast ratio measures the difference between the brightest white and the blackest black that a display can produce. It is a critical specification for displays, such as televisions and computer monitors, as it directly affects the quality and clarity of the visual experience.

A high contrast ratio is essential because it allows for better differentiation between dark and light areas on the screen. This means images and videos will appear more vibrant and realistic, with enhanced details and depth. A display with a low contrast ratio, on the other hand, may result in washed-out or dull visuals, where darker areas may appear gray or lack definition.

Example Problem

How to calculate contrast ratio?

  1. First, determine the relative luminance of the light color.

    The relative luminance is found to be .215.

  2. Next, determine the relative luminance of the darker color.

    For this example, the luminance is found to be .125.

  3. Finally, calculate the contrast ratio.

    Using the formula, the contrast ratio is found to be (.215+.05) / (.125 + .05 ) = .220/.130 = 1.692 : 1.

contrast ratio calculator
contrast ratio formula