WCAG color contrast: the ratios, the rules and how to fix low contrast
What 4.5:1 and 3:1 mean, which text and UI elements they apply to, the most common contrast mistakes on websites and how to fix them without redesigning.
Updated
Low color contrast is the most frequent accessibility problem on the web — light gray text, pale buttons, prices in a soft brand color. It affects people with low vision, color blindness and older eyes, and everyone reading a phone in sunlight. The good news: it's usually a handful of color values in your theme.
The contrast ratios in WCAG
- Normal text: at least 4.5:1 (WCAG 1.4.3, level AA).
- Large text: at least 3:1. Large means from 24 px regular, or about 18.7 px (14 pt) bold.
- Buttons, form field borders, icons and focus indicators: at least 3:1 against what's next to them (WCAG 1.4.11, level AA).
- Enhanced (AAA): 7:1 for normal text and 4.5:1 for large text — recommended, not required by most laws.
- Exceptions: disabled controls, decorative text, logos and text that's part of a photo.
The ratio compares the relative brightness of two colors and ranges from 1:1 (same color) to 21:1 (black on white). Pure gray #767676 on white is exactly the 4.5:1 limit — anything lighter fails for normal text.
Where contrast usually fails
- Light gray secondary text: dates, captions, helper text, “was” prices, footer links.
- Placeholder text used as the only label in form fields.
- White text on brand colors like light green, orange or yellow buttons.
- Text on images in hero banners and slideshows — the contrast changes with the photo.
- Links only distinguished by color inside paragraphs (they also need an underline or 3:1 contrast to the surrounding text).
- Input borders and icon buttons in very light gray.
How to fix it without a redesign
- Find your theme's color settings (Shopify: Theme settings → Colors; WordPress: Customizer or theme.json; or your CSS variables).
- Darken the text color, not the whole palette: one step darker is often enough — e.g.
#9ca3af(2.5:1) →#6b7280(4.8:1). - For colored buttons, darken the button background until white text reaches 4.5:1, or switch to dark text.
- For text on images, add a solid or semi-transparent dark overlay behind the text, or move the text below the image.
- Re-test every color pair you changed, including hover and focus states.
/* before: fails */
.price-was { color: #a1a1aa; } /* 2.6:1 on white */
/* after: passes AA */
.price-was { color: #52525b; } /* 7.7:1 on white */Check your page in seconds
Free, no signup: enter two colors and see if they pass WCAG AA and AAA — with an accessible color suggestion.
Check your colors with the free contrast checker →