pttooz
← Blog

WCAG Color Contrast Ratio: AA and AAA Requirements Explained

WCAG 2.1 level AA requires a contrast ratio of at least 4.5:1 between normal text and its background, and 3:1 for large text. Level AAA raises the bar to 7:1 for normal text and 4.5:1 for large text.

Large text means 18 point (24 px) regular or 14 point (about 18.7 px) bold. Everything smaller counts as normal text.

WCAG contrast requirements at a glance

Level Normal text Large text Icons and UI parts
AA 4.5:1 3:1 3:1
AAA 7:1 4.5:1 —

The Web Content Accessibility Guidelines (WCAG) set these ratios so that people with low vision or color blindness can read text on screen. Many accessibility laws point to WCAG AA as the standard.

How the contrast ratio is calculated

The ratio compares the relative luminance of the 2 colors:

Contrast ratio = (L1 + 0.05) ÷ (L2 + 0.05)

L1 is the luminance of the lighter color and L2 the darker one. Luminance runs from 0 for black to 1 for white, so ratios run from 1:1 (same color) to 21:1 (black on white).

Luminance weights the 3 channels by how bright each looks to the eye:

L = 0.2126 × R + 0.7152 × G + 0.0722 × B

Green counts for 72% of perceived brightness and blue for 7%. That’s why pure blue (#0000FF) is dark enough for white text, and bright green is not.

Real color examples

Color On white On black Better text color
Gray #777777 4.48:1 · fails AA 4.69:1 · AA Black
Gray #767676 4.54:1 · AA 4.62:1 · AA Either
Gray #595959 7.00:1 · AAA 3.00:1 · AA Large White
Blue #0000FF 8.59:1 · AAA 2.44:1 · fails White
Blue #2563EB 5.17:1 · AA 4.06:1 · AA Large White
Red #FF0000 4.00:1 · AA Large 5.25:1 · AA Black
Pink #EC4899 3.53:1 · AA Large 5.95:1 · AA Black
Green #16A34A 3.30:1 · AA Large 6.37:1 · AA Black

2 results surprise most designers:

  • #777777 fails and #767676 passes on white. 1 step of gray makes the difference.
  • Pure red (#FF0000) needs black text, not white, to pass AA for normal text.

How to fix a failing color

There are 3 ways to fix a pair of colors that fails:

  1. Switch the text color. The pttooz Color Studio shows the ratio for both white and dark text, so you can see which one passes.
  2. Darken or lighten the background. Move 1 or 2 steps along the 50–950 shade scale and check again. Hue stays the same, so the brand still looks like the brand.
  3. Use the color for large text only. A color that reaches 3:1 works for headings at 24 px and up, and for icons and button borders.

Contrast is one part of accessibility

Passing AA or AAA covers text contrast only. An accessible page also needs keyboard navigation, visible focus states, alt text on images, labelled form fields and a logical heading order. Don’t use color as the only signal either: an error message needs text or an icon, not just red.

Check your own colors

Open the Color Studio, type a HEX code or drag on the color wheel. The Accessibility panel shows the ratio against white and dark text with AA, AAA and AA Large results, and every value copies to CSS with 1 click.