Color contrast that passes WCAG 2.2

Low contrast is the most common accessibility failure on small sites, and the easiest to fix. WCAG 2.2, the current W3C standard, sets three numbers worth knowing.

The three numbers

What Minimum contrast (level AA)
Body text 4.5:1
Large text: 24px and up, or about 18.7px and up in bold 3:1
Buttons, form field borders, icons and focus indicators 3:1 against what’s next to them

Contrast runs from 1:1 (the same color) to 21:1 (black on white). Logos and purely decorative text are exempt. Placeholder text, disabled-looking labels and text on photos are not.

How to check

Pick the foreground and background colors and run them through a contrast checker. Browser developer tools show the ratio when you inspect text. Check every pairing your design actually uses, including:

  • link color against the page background
  • white text on your brand color button
  • gray helper text under form fields
  • text over images or gradients, at the lightest point behind the text

Where sites usually fail

Light gray text. A gray that looks elegant on a bright monitor often lands around 3:1. For body text, darken it until it reaches 4.5:1.

Brand colors on buttons. Mid-tone oranges, yellows and light blues rarely reach 4.5:1 with white text. Use dark text on the button, or a darker shade of the brand color for the button and keep the original for larger accents.

Input borders. A pale border around a form field has to reach 3:1 against the background, or people with low vision can’t find the field.

Focus rings. Keyboard users need to see where they are. A focus outline needs 3:1 contrast too. Removing it with outline: none and adding nothing back fails outright.

Dark mode

Pure white text on pure black passes easily but can cause halos for some readers. A slightly gray text on a near-black background is gentler and still clears 4.5:1. Recheck every pairing in both themes, since a color that works on white often fails on black.

Published . All posts

Sources

  1. Understanding Success Criterion 1.4.3: Contrast (Minimum), W3C
  2. Understanding Success Criterion 1.4.11: Non-text Contrast, W3C
  3. Web Content Accessibility Guidelines (WCAG) 2.2, W3C