Accessora
Guides

Color contrast for accessibility: ratios, bad examples and fixes

The WCAG contrast ratios in plain terms, six bad color contrast examples with the exact colors that fix them, and a high contrast palette you can copy.

Customer Success Manager · 9 min read

Color contrast is the difference in lightness between text and the background behind it. For accessibility, WCAG measures it as a ratio from 1:1 (the same color) to 21:1 (black on white). Body text needs at least 4.5:1 to meet level AA. Large text, icons and the edges of buttons and fields need 3:1.

Low contrast is one of the most common problems automated scans find, and one of the easiest to fix. You usually change a hex value or two in your theme, and every page gets better at once. This guide covers the rules, six examples of bad color contrast with the exact colors that fix them, and a high contrast palette you can start from.

Why contrast matters, and for whom

Faint text is harder for everyone. It’s hardest for people with low vision, for many older readers, and for anyone with color blindness when the two colors differ only in hue. It also gets worse in ordinary situations: a phone in sunlight, a cheap laptop screen, a dimmed display at night.

Contrast is about lightness, not hue. Red on green looks bold, but the two colors are almost equally light, so the text barely stands out once you take hue away. That’s also why WCAG 1.4.1 says color should never be the only way you show something, such as an error or a sale price.

The contrast ratios WCAG asks for

1234.571015213:1 Large text, icons (AA)4.5:1 Body text (AA)7:1 Body text (AAA)1:1 same color21:1 black on white
The contrast ratio scale. Every common decision happens between 3:1 and 7:1.

Three success criteria cover it.

  • 1.4.3 Contrast (Minimum), level AA. Text needs 4.5:1 against its background. Large text needs 3:1. Large means at least 24px regular, or about 18.7px bold.
  • 1.4.11 Non-text Contrast, level AA. The visible parts of controls (a field’s border, a checkbox, a focus outline) and icons that carry meaning need 3:1 against what sits next to them.
  • 1.4.6 Contrast (Enhanced), level AAA. 7:1 for text and 4.5:1 for large text. Nice to reach for body copy, not something most sites commit to.

Logos and brand names are exempt, and so is text on a disabled control and text that’s pure decoration. Placeholder text inside a field is not exempt. If it carries information, it needs 4.5:1 like any other text.

  • 4.5:1Minimum for body text and links at level AA.WCAG 2.2, 1.4.3
  • 3:1Minimum for large text, icons, field borders and focus outlines.WCAG 2.2, 1.4.3 and 1.4.11
  • #767676The lightest gray that still passes as body text on white (4.54:1).Computed with the WCAG formula

That last number is worth remembering. Any gray lighter than #767676 on a white background fails as body text. A lot of themes ship with #999 or #aaa for “secondary” text, and both fail.

Bad color contrast examples, and the fix for each

These six pairs come up again and again in store and SaaS themes. Each one shows the failing colors, a fix that keeps the look, and the real ratio for both.

Light gray body textThe most common one. Looks calm in a mockup, fades on a phone in daylight.
BeforeFree returns2.52:1Fail#a3a3a3 on #ffffff
AfterFree returns7:1Pass#595959 on #ffffff
Placeholder as the labelPlaceholder gray is often lighter still, and it vanishes once someone types.
BeforeEmail address1.74:1Fail#c4c4c4 on #ffffff
AfterEmail address4.83:1Pass#6b7280 on #ffffff
White text on a pastel buttonBrand mint, sky blue or peach behind white text rarely gets past 2.5:1.
BeforeAdd to cart2.25:1Fail#ffffff on #7fb8a4
AfterAdd to cart7.95:1Pass#ffffff on #0f5c46
White on yellowYellow is the lightest hue. Put dark text on it instead.
BeforeSale ends today1.63:1Fail#ffffff on #f5c518
AfterSale ends today10.67:1Pass#1a1a1a on #f5c518
Red on greenTwo mid-tone colors of similar lightness. Fails for everyone, worst for red-green color blindness.
BeforeIn stock1.27:1Fail#e53935 on #43a047
AfterIn stock7.86:1Pass#ffffff on #1b5e20
Bright blue link on dark navyDark mode trap: a link color picked for white pages, reused on a dark footer.
BeforeShipping policy2.83:1Fail#2563eb on #1e293b
AfterShipping policy8.11:1Pass#93c5fd on #1e293b
Six common failing pairs and a passing replacement for each. Ratios are calculated from the hex values shown.

A few patterns sit behind most of them.

Gray used as decoration. Designers reach for light gray to make secondary text feel quiet. Quiet is fine. Pick a gray between #595959 and #767676 and use size or weight to show what matters less.

Brand colors that were never tested with text. A pastel brand color can work as a background for dark text and fail completely behind white text. Test both directions before you pick one. The palette below shows which text color each background takes.

Dark mode as an afterthought. A link color that passes on white often fails on a dark footer or a dark theme. Every background you use needs its own check.

Text on photos. A scanner can’t measure contrast on text that sits on an image, because the background changes pixel by pixel. Put a solid or semi-opaque panel behind the text, or move the text off the image. I covered more of what software can’t fix in widgets, overlays and real fixes.

Anne's takeAnne Joller, Customer Success Manager

When a client pushes back on darker text because it “looks heavy”, I show them the page on a phone outside. That ends the discussion faster than any ratio does.

What this looks like on a real product page

Numbers on swatches are one thing. Here is the same thing on a product page. Our demo store runs Shopify’s Horizon theme, and its default colors passed: an axe contrast scan of the home page, the catalog and a product page found no failures.

So we did what a lot of store owners do. We lightened the price, the description and the “More payment options” link to soft grays, and made the Add to cart button a pastel green. Then we scanned again.

Soft grays

Product page for a linen shirt with a pale gray price, a light gray description, a faint payment options link and a mint green Add to cart button with white text.

Fixed colors

The same product page with a dark gray price and description and a deep green Add to cart button. The layout is unchanged.
The same product page with soft grays, and after changing four color values. Nothing else on the page moved.

The scan with soft grays found 8 contrast failures on that one page:

  • The price, #b5b5b5 on the cream background, at 1.93:1. The same gray repeated on four prices in the “You may also like” row.
  • Both description paragraphs, #a3a3a3, at 2.37:1.
  • The “More payment options” link, #9ca3af, at 2.39:1.

The scan didn’t flag the button at all, even though white on that mint green is 2.25:1. Scanners can miss a background they can’t resolve, which is why the spot check in the next section matters.

The fix was four color values: #374151 for prices (9.72:1), #4b5563 for the description (7.12:1), the theme’s darker link color, and a deep green button behind the white text. A rescan found 0 failures. The page still looks soft and calm. It’s just readable now.

A high contrast color palette you can start from

You don’t have to give up color to pass. Dark, saturated colors work as backgrounds for white text, and light ones work behind black text. The trouble is the middle, where neither black nor white reaches 4.5:1.

AaInk #1f2937White text 14.67:1
Black text 1.43:1
AaNavy #0b3d91White text 10.04:1
Black text 2.09:1
AaForest #0f5c46White text 7.95:1
Black text 2.63:1
AaBrick #b3261eWhite text 6.53:1
Black text 3.21:1
AaPlum #6b21a8White text 8.72:1
Black text 2.4:1
AaAmber #fbbf24White text 1.66:1
Black text 12.57:1
AaSky #bae6fdWhite text 1.32:1
Black text 15.82:1
AaPaper #fbf8f2White text 1.06:1
Black text 19.81:1
Eight colors with the text color that passes on each. Every pairing shown reaches at least 6.5:1.

Use it like this:

  • Text colors: Ink, Navy, Forest, Brick and Plum all pass on white and on the cream Paper background, so any of them can carry body text or links.
  • Button backgrounds: the same five take white text. Brick is the lowest at 6.53:1, which still clears AA with room to spare.
  • Highlights and badges: Amber and Sky take black text, never white. White on Amber is 1.66:1.

If your brand color sits in the middle, keep it for large shapes and borders, where 3:1 is enough, and use a darker shade of it for text and buttons. Most design tools can generate a darker step of the same hue.

How to check contrast on your own site

  1. Run a scan first. Our free accessibility checker runs 60+ WCAG checks on a page in under a minute, and low contrast is one of them. It lists each failing element, so you know which colors to change.
  2. Spot-check what looks pale. In Chrome DevTools, inspect the text and click the color swatch next to its color value. The picker shows the ratio and a line where AA and AAA pass. My guide to checking your website’s accessibility walks through it.
  3. Check every state. Hover, focus, visited links, error messages, sale badges, disabled buttons that aren’t really disabled. Scanners only see the state the page loads in.
  4. Check text on images by eye. Software can’t do this one for you.
  5. Fix it in the theme, not page by page. Change the color variable once and every page picks it up. Then scan again.

Contrast is one item on a longer list. Our WCAG 2.2 checklist has the rest of level AA.

Where Accessora fits

The Accessora checker finds contrast failures on any public page for free. With a paid plan, the dashboard audits scan your pages on a schedule and list every issue by WCAG criterion, so a color that drifts back into a theme update shows up again.

For visitors, the Accessora widget has a Colors section: High Contrast, Brightness, Invert Colors, Saturation, and color filters for grayscale and common types of color blindness. A visitor turns on what helps them, and the setting follows them from page to page.

The Colors section of the Accessora widget panel with High Contrast switched on, plus Brightness, Invert Colors, Saturation and color filters for Grayscale, Red/Green, Blue/Yellow and Green/Red.
The widget's Colors section on our demo store.

Those controls change how the page looks for one visitor. They don’t change your colors, so a scan still reports the same failures until you fix the theme. Do both: fix the colors, then let visitors adjust from there.

To try it, start a free trial. Every plan has a 7-day free trial. Shopify stores can add it from the Shopify App Store, where there is a Free plan.

Quick answers

What is a good contrast ratio for text?

At least 4.5:1 for body text and 3:1 for large text, to meet WCAG level AA. If you can reach 7:1 for body text, that meets AAA and reads well in harsh light.

Does color contrast apply to buttons and icons?

Yes. The text on a button needs 4.5:1 against the button color. The button’s shape, a field’s border and meaningful icons need 3:1 against the background next to them, under WCAG 1.4.11.

Is gray text on a white background accessible?

It can be. #767676 is the lightest gray that passes as body text on white. Anything lighter, such as the common #999999 (2.84:1), fails.

Color contrast, in short

  • Body text and links at 4.5:1 or more against their background
  • Large text, icons, field borders and focus outlines at 3:1 or more
  • No gray lighter than #767676 for text on white
  • Placeholder text passes too, or a real label sits above the field
  • Hover, focus, error and sale states checked, not just the default
  • Text on images has a solid panel behind it
  • Color never the only signal for errors, prices or status
  • Fixed in theme variables, then scanned again

Written by

Customer Success Manager, Accessora

Anne helps Accessora customers make their sites easier for everyone to use, and writes about where tech and AI help accessibility and where they still fall short.

[email protected]

See it on your own site.

Start a free trial, paste one script tag, and the widget shows up on your next page load. Audits and alt text live in the same dashboard.

Start free trial7-day free trial on every plan.
Try the widget