Skip to content
SEO Optimizer is live, Audit on page SEO and AI-search readiness. Try it free

How to Fix Low Color Contrast (WCAG 4.5:1)

Low color contrast is one of the most common accessibility failures on the web. Light gray text on white, white text on a pale brand color and faint placeholder text are hard to read for people with low vision, for older users and for anyone using a phone in sunlight. The good news is that it is also one of the easiest problems to measure and fix. This guide shows how to fix color contrast issues step by step, using the ratios WCAG requires.

The WCAG Contrast Ratios

Contrast is measured as a ratio between the lighter and darker color, from 1:1 (no contrast) to 21:1 (black on white).

WhatLevel AALevel AAAWCAG criterion
Normal text4.5:17:11.4.3 / 1.4.6
Large text (24px, or 18.66px bold, and up)3:14.5:11.4.3 / 1.4.6
Buttons, input borders, icons, focus indicators3:13:11.4.11
Logos and purely decorative textNo requirementNo requirement
Disabled controlsNo requirementNo requirement

Most laws and policies require Level AA, so 4.5:1 for normal text is the number to remember. The WCAG 2.2 checklist lists every related criterion.

Step 1: Find the Failing Colors

  • Run the page through the color contrast checker or a full accessibility audit. Both test the page in a real browser, so they measure the colors as actually rendered, including text over CSS backgrounds.
  • Check pages while you build with the accessibility extension for Chrome, which also works on pages behind a login.
  • Check the states tools often miss: hover and focus styles, error messages, placeholder text, text on images or gradients, and dark mode.

Automated tools reliably fix color contrast problems in solid text, but they cannot always measure text on photos, gradients or video. Check those by eye with a color picker.

Step 2: Fix Color Contrast in Text

Usually the fastest fix is to darken the text, not change the background.

styles.cssDarker grays that pass on white
/* Before: #9ca3af on white is about 2.5:1, fails */
.muted { color: #9ca3af; }

/* After: #6b7280 is about 4.8:1, passes AA for normal text */
.muted { color: #6b7280; }

/* Placeholder text needs 4.5:1 too */
input::placeholder { color: #6b7280; }
  • Gray text: on a white background, the lightest gray that passes 4.5:1 is around #767676.
  • Brand colors: keep the hue and change the lightness. A darker shade of the same blue or green usually passes and still looks on-brand. Save it as a separate "text" token in your design system.
  • White text on buttons: if your brand color is light, such as yellow or light green, use dark text on it instead of white.
  • Text on images: add a dark overlay or a solid background behind the text, rather than relying on the photo.

Step 3: Fix Contrast in Controls and Icons

WCAG 1.4.11 asks for 3:1 for the parts of a control that you need to see to use it: input borders, checkbox outlines, toggle tracks, icon buttons and the focus ring. Pale gray input borders are a frequent failure. Darken the border, or give the field a visible background, and make sure the focus indicator stands out against both the control and the page.

styles.cssVisible input borders and focus ring
input, select, textarea {
  border: 1px solid #6b7280; /* 4.8:1 on white */
}
:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

Step 4: Do Not Rely on Color Alone

Contrast is not the only color rule. WCAG 1.4.1 says color cannot be the only way information is shown. Links inside a paragraph need an underline or another visual cue besides color, and error fields need an icon or text, not just a red border.

Step 5: Check Dark Mode and Every Theme

Dark themes fail contrast as often as light ones, usually with mid-gray text on dark gray. Test each theme separately and keep separate tokens for each.

Step 6: Retest

Run the accessibility audit again and confirm the color contrast findings are gone. When you fix color contrast through design tokens instead of one element at a time, the fix carries over to every page and every new component. Contrast is often the most frequent finding in an audit, so it is a quick win for compliance with the European Accessibility Act and the ADA. For a wider view of testing, see the accessibility testing guide.

FAQ

よくある質問

At Level AA, 4.5:1 for normal text, 3:1 for large text (24px, or 18.66px bold, and up) and 3:1 for user interface components and graphics such as input borders and icons.

Yes. Placeholder text is text, so it needs 4.5:1 at Level AA. Better still, use a visible label above the field and keep placeholders for examples only.

Keep the hue and adjust the lightness. A darker shade of your brand color for text, or dark text on light brand backgrounds, usually passes while still looking on-brand.

No. Logos and brand names in a logo are exempt, and so is purely decorative text and text in disabled controls.

They reliably find contrast problems in normal text on solid backgrounds. Text on images, gradients or video often needs a manual check.

無料 - 登録不要

Check this on your own site

Run a free scan and see exactly where you stand - no sign-up required.

無料監査を実行