Color accessibility · Practical guide

How to check color contrast for text and interfaces

A contrast ratio helps you evaluate whether text stands out from its background. Check the actual foreground and background colors used in your design—not just the colors in isolation—and verify the result at the text size and weight you intend to ship.

What the contrast ratio means

The ratio compares the relative luminance of two sRGB colors and ranges from 1:1 (no luminance difference) to 21:1 (black against white). It is symmetric: swapping text and background does not change the ratio. A higher number indicates a larger luminance difference, but it does not measure every aspect of readability, such as font choice, anti-aliasing, surrounding colors, or whether color is the only cue conveying meaning.

WCAG 2.2 contrast thresholds

Text typeAA minimumAAA minimum
Normal text4.5:17:1
Large text3:14.5:1

WCAG defines large text as at least 18 pt (about 24 CSS px) regular, or at least 14 pt (about 18.66 CSS px) bold. These are contrast criteria, not a complete accessibility audit. User interface components and meaningful graphical objects have separate non-text contrast guidance.

Worked example: a gray on light-gray pair

The pair #737373 on #F5F5F5 has a ratio of 4.3492:1 in ColorStory's checker. That is below the 4.5:1 AA threshold for normal text, although it exceeds the 3:1 threshold for large text. A slightly darker foreground, #707070, measures 4.5423:1 against the same background and clears the normal-text AA contrast threshold. These values are reproducible in the app's color-engine tests.

Open this example in the Contrast Checker →

A repeatable contrast-checking workflow

  1. Choose the actual foreground and background pair from your component.
  2. Enter both HEX values in the checker and note the unrounded ratio and rating.
  3. Choose the threshold that matches the text size and conformance target.
  4. If the pair fails, adjust a color and recheck; do not rely on a rounded display alone.
  5. Review focus states, icons and other meaningful non-text elements separately.
  6. Test the component in context and do not use color as the only way to signal status.

The ColorStory checker can suggest a foreground adjustment in OKLCH. Treat the result as a starting point: verify the final rendered pair and ensure the resulting hue still fits your design system.