What is color contrast?

DEFINITION

Color contrast is the difference in brightness between text or interface elements and their background, which determines how easily people can read and see them.

In web accessibility, color contrast is measured as a ratio between the relative luminance of two colors, ranging from 1:1, where there is no difference, to 21:1 for black on white. The Web Content Accessibility Guidelines (WCAG) set minimum ratios so text and essential interface parts remain readable for people with low vision or color vision deficiencies, and for anyone reading on a dim screen or in bright sunlight.

Contrast depends on brightness difference, not on hue alone. Red and green of similar lightness can have very poor contrast.

Why color contrast matters

Low-contrast text, like light gray on white, is a very common accessibility problem on websites. It makes content harder to read for many visitors and can exclude some entirely. Accessible contrast is part of WCAG conformance, which many organizations use as their accessibility standard and which is referenced in accessibility laws and procurement rules in various countries. It also simply improves readability for everyone.

How to check and fix contrast

Under WCAG 2 level AA, normal body text needs a ratio of at least 4.5:1, large text (about 24 pixels regular or 18.5 pixels bold and above) needs 3:1, and essential interface components and graphics, like input borders and icons, need 3:1 against adjacent colors. A designer testing a brand's pale orange button with white text finds it fails, so they darken the orange slightly until the ratio passes, keeping the brand feel intact.

Best practices

  • Test every text and background pairing in your palette with a contrast checker.
  • Check text placed over images and add an overlay or solid background if needed.
  • Include focus outlines, input borders and icons in your contrast checks.
  • Never use color alone to convey meaning; add text, icons or patterns.

Common mistakes

  • Using light gray placeholder or body text that fails minimum ratios.
  • Testing only the default state and forgetting hover, disabled and dark mode colors.
  • Assuming colors that look fine on a high-end monitor will look fine everywhere.
Try it free: Color Contrast CheckerCheck text and background colour contrast against WCAG 2.1 AA and AAA instantly, with a live preview. Make your website readable for everyone.

Frequently asked questions

What is a good color contrast ratio?

For WCAG 2 level AA, aim for at least 4.5:1 for normal text and 3:1 for large text and important interface components. Level AAA raises text requirements to 7:1 for normal text and 4.5:1 for large text. Higher contrast generally improves readability, though extreme contrast is not always necessary.

Does disabled button text need to meet contrast requirements?

WCAG exempts text in inactive or disabled interface components from contrast requirements. Even so, disabled elements should still be recognizable as present but unavailable, and you should explain why an action is disabled when it is not obvious. Purely decorative text and logos are also exempt.

How do I test contrast on my website?

Use a contrast checker tool to enter foreground and background colors and see the ratio and pass or fail result. Browser developer tools can show contrast for selected text, and automated accessibility scanners flag many failures. Manually check text over images and gradients, which automated tools often miss.

Need help with this?

UI/UXデザイン by VYZEON — ひと目でわかり、使うほど好きになるインターフェースを。

Fixed packages from $199. Written scope, no surprises.

See UI/UXデザイン

Related terms

More Design & branding terms