Bad color contrast examples, with the fixes

Bad color contrast examples with their measured WCAG ratios: grey text, white on orange, red on green, faint borders, and a passing fix for every pair.

Seven upright glass panes graded from frosted white to near-black, with an orange sphere resting in front of the second, palest pane

Bad color contrast is text or a control whose color sits too close to its background in lightness for many people to read. WCAG 2.2 measures it as a ratio and sets 4.5 to 1 for body text at Level AA. Below are a dozen real-world failures with their measured ratios, why each fails, and a fix that passes.

How bad contrast is measured

Contrast in WCAG is not a matter of taste or hue. It is a number computed from the relative luminance of the two colors, the lighter one first: (L1 + 0.05) / (L2 + 0.05). The WCAG 2.2 definition of contrast ratio gives the formula and notes that the result runs from 1 to 1, the same color twice, to 21 to 1, black on white. Every ratio on this page was computed with that formula from the hex values shown.

Two success criteria set the thresholds for text. Success Criterion 1.4.3, Contrast (Minimum), is Level AA, the level most teams aim for. Success Criterion 1.4.6, Contrast (Enhanced), is Level AAA.

TextLevel AA (1.4.3)Level AAA (1.4.6)
Normal text4.5 to 17 to 1
Large text: at least 18 point, or 14 point bold3 to 14.5 to 1
Logos, brand names, text in inactive controls, pure decorationNo requirementNo requirement

The numbers come from vision research, not from design convention. The W3C’s Understanding document explains that 4.5 to 1 compensates for the loss of contrast sensitivity that typically comes with visual acuity of about 20/40, and that 7 to 1 does the same for about 20/80. A pair that fails is not merely unfashionable. It is the pair that a reader with ordinary age-related vision loss cannot read comfortably.

Bad color contrast examples, with the fix for each

The pairs below are the ones that turn up again and again in audits: grey body text, brand colors used behind white labels, status colors, and the classic clashing pairs. Each row gives the failing pair, its ratio, and a fix that keeps the intent of the design. The verdict is for normal-size text unless the row says otherwise.

Bad pair (text on background)RatioWhy it failsFixFixed ratio
Light grey #999999 on white2.85 to 1Under 4.5 to 1; reads as disabledGrey #595959 on white7.00 to 1
Pale grey #cccccc on white, the usual placeholder grey1.61 to 1Placeholder text is still text the user needsGrey #767676 on white4.54 to 1
Grey #777777 on white4.48 to 1A near miss, and near misses failGrey #767676 on white4.54 to 1
White on bright orange #ff5b1f3.10 to 1Passes only as large textBlack on #ff5b1f, or white on #c2410c6.77 to 1, 5.18 to 1
White on yellow #ffff001.07 to 1Almost no difference in lightnessBlack on #ffff0019.56 to 1
White on sky blue #87ceeb1.74 to 1A light background behind light textWhite on #0369a15.93 to 1
Link blue #3b82f6 on white3.68 to 1A popular button blue that fails for linksBlue #2563eb on white5.17 to 1
Error red #ef4444 on white3.76 to 1The message the user most needs to readRed #dc2626 on white4.83 to 1
White on success green #22c55e2.28 to 1Bright greens are light, whatever their hueWhite on #15803d5.02 to 1
Red #ff0000 on green #0080001.29 to 1Two saturated colors of similar lightnessBlack on white, with the meaning in words21 to 1
Blue #0000ff on red #ff00002.15 to 1Vibrates, and is low contrast as wellPick one of the two, on white or black8.59 to 1 for blue on white
Grey #6b7280 on a light grey card #f3f4f64.39 to 1Passes on white, fails on the cardGrey #4b5563 on #f3f4f66.87 to 1

Three patterns account for most of the table. Greys are chosen by eye on a bright, calibrated monitor and fail on everyone else’s. Brand colors in the middle of the lightness range, oranges, bright greens, mid blues, sit near 3 to 1 against both white and black, so white labels on them fail. And the clashing pairs fail because hue does not count: red and green look very different, yet they can be almost the same lightness, which is all the ratio measures.

Why near misses and card backgrounds fail

The two hardest rows in the table are the quiet ones. Grey #777777 on white looks identical to #767676 on white, and only one of them passes. The Understanding document for 1.4.3 is explicit that the ratios are thresholds and must not be rounded: its own example is that 4.499 to 1 does not meet 4.5 to 1. A checker that displays two decimals and shows 4.5 for a pair of 4.48 is rounding, so read the unrounded value before calling a pair a pass.

The card row fails for a different reason. Contrast is measured against the background the text actually sits on, and the WCAG 2.2 definition adds that white is assumed when no background color is specified. A design system that checks its secondary grey against white, and then places the same grey on a tinted card, a table stripe or a hover state, ships a failure the design file never showed. The same happens with text over photographs and gradients: the ratio has to hold at the lightest point behind the text, not at its average.

Dark themes repeat the problem in reverse. Mid grey #808080 on black reaches 5.32 to 1 and passes Level AA, but light text set on a dark grey panel loses ratio quickly as the panel lightens, and secondary text in a dark theme is usually where it breaks.

Contrast beyond text: borders, icons and focus rings

Text is not the only thing that has to be seen. Success Criterion 1.4.11, Non-text Contrast, at Level AA, asks for at least 3 to 1 against adjacent colors for the visual information needed to identify user interface components and their states, and for the parts of graphics needed to understand the content.

Typical failures it catches:

  • Input borders in pale grey #d1d5db on white, at 1.47 to 1, when the border is the only thing that shows where the field is. A border in #949494 reaches 3.03 to 1, the same grey the W3C uses in its own passing example of a focus indicator against white.
  • Icon-only buttons drawn in a light tint, such as a close or search icon with no visible label.
  • Focus rings that are too faint to see when a keyboard user tabs through the page. The focus indicator entry in the glossary covers what a usable one looks like.
  • Chart lines and segments that can only be told apart by color, where each needs 3 to 1 against its neighbours or a second cue such as a pattern or a label.

Two cases are exempt, and they are often reported as bugs when they are not. A disabled control is not required to meet any contrast ratio, because it is not operable. And a control whose appearance is entirely the browser’s default, never restyled by the author, is outside the criterion as well.

When the problem is color itself, not contrast

Some color problems pass every ratio and still fail. Success Criterion 1.4.1, Use of Color, is Level A, the most basic level: color must not be the only visual means of conveying information, indicating an action or distinguishing an element. A form that marks invalid fields only by turning their borders red, a status column that says nothing but a green or red dot, or links set in a blue that differs from the body text only in hue, all depend on seeing color.

The fix is a second cue that does not depend on color: the word Error next to the field, a text label or an icon beside the dot, an underline on links within paragraphs. The red on green row in the table fails both ways at once, which is why it is the example people remember. It has almost no contrast, and it relies on the pair of colors that people with the most common color vision deficiencies confuse.

Finding and reporting contrast problems on a live site

Contrast is one of the few accessibility checks that can be measured exactly, so it is a good place to start an audit. The browser’s developer tools show the ratio of any text element: inspect it and open the color picker on its color property, as described in how to inspect element. Check every state, not only the default one: hover, focus, visited, error, disabled, and the dark theme if the site has one. Text over images needs a check at its lightest point.

Contrast is one item in a wider pass. The accessibility checklist runs it alongside keyboard, structure and form checks, and screen reader testing covers what a contrast check cannot, which is how the page is announced. The broader method is set out under accessibility testing.

A contrast bug is easy to fix and easy to lose, because a report that says the text is hard to read does not say which text, on which background, in which state. A useful report names the element, the two hex values, the measured ratio, the threshold it misses and the state it was in, with a screenshot of the page as the reporter saw it. Filed from the page with a feedback widget, the report carries the URL, the browser and the viewport as well, and evidence capture attaches the screenshot and the console, so the developer can reproduce the exact pair rather than guess at it.

Common questions

What is an example of bad color contrast?

Light grey text in #999999 on a white background is the most common example of bad color contrast on the web. Its contrast ratio is about 2.85 to 1, well under the 4.5 to 1 that WCAG 2.2 sets at Level AA for body text, so many readers with low vision struggle to read it. Darkening the grey to #595959 gives 7 to 1.

What contrast ratio does WCAG require for text?

WCAG 2.2 Success Criterion 1.4.3, at Level AA, requires a contrast ratio of at least 4.5 to 1 for text and 3 to 1 for large text, meaning at least 18 point, or 14 point bold. The Level AAA criterion, 1.4.6, raises these to 7 to 1 and 4.5 to 1. Logos and text in inactive controls have no requirement.

Is white text on an orange button accessible?

White text on a bright orange such as #ff5b1f has a contrast ratio of about 3.1 to 1, which passes only for large text and fails for normal button labels. Black text on the same orange reaches about 6.8 to 1. A darker orange such as #c2410c keeps white text at about 5.2 to 1, which passes Level AA at any size.

Can a contrast ratio of 4.49 to 1 be rounded up to pass?

A ratio of 4.49 to 1 cannot be rounded up to pass. The W3C's Understanding document for Success Criterion 1.4.3 says the thresholds are not to be rounded and gives 4.499 to 1 as an example that does not meet 4.5 to 1. Grey #777777 on white, at about 4.48 to 1, therefore fails, while #767676 passes.

Do icons and input borders need to meet a contrast ratio?

Icons and input borders need a contrast ratio of at least 3 to 1 against the colors next to them when they are needed to identify a control or understand the content. That is WCAG 2.2 Success Criterion 1.4.11, Non-text Contrast, at Level AA. Disabled controls and the browser's default, unstyled controls are exempt.

Why is red text on a green background a problem?

Red text on a green background fails twice. Pure red on a mid green such as #008000 has a contrast ratio of only about 1.3 to 1, and red and green are the pair people with the most common color vision deficiencies confuse. WCAG 2.2 Success Criterion 1.4.1 also forbids using color as the only way to show information.

The Notarus team

The people who build Notarus. We write up the decisions behind the product when the reasoning is worth more than the changelog line.

Keep reading

Reports with the evidence attached.

Start free, one script tag.

<script src="…/widget.js" data-key="pb_pub_…">