The 4.5:1 rule explained: how WCAG actually measures color contrast

Why WCAG demands a 4.5:1 contrast ratio for body text, what 'large text' actually means in pixels, and which common color pairs quietly fail the rule.

Z.Tools8 min read
The 4.5:1 rule explained: how WCAG actually measures color contrast - og-image.png

Accessibility checkers report "4.5:1" because WCAG sets it as the pass line for normal text, using an algorithm published in 2008 with WCAG 2.0. The number is exact: a pair that measures 4.499:1 fails and a pair that measures 4.50:1 passes.

The WebAIM Million 2026 report found low-contrast text on 83.9% of home pages, averaging 34 distinct instances per page, and low contrast has been the most common failure in each report from 2019 to 2026. Failures like these are often ordinary choices, such as gray placeholder text or a light brand color on white, as the table below shows.

Where the 4.5:1 number comes from

WCAG 2.1, success criterion 1.4.3, defines contrast as a ratio between the relative luminance of two colors. Luminance is not the same thing as the lightness slider in your color picker. It is a weighted sum of how much your eye actually responds to each channel, and the weights are not equal. Green carries roughly 71% of the perceived brightness, red about 21%, and blue only 7%.

The full algorithm has three steps. Take a color in sRGB. For each of the three channels, divide by 255, then apply a small piecewise function that linearizes the gamma curve: if the value is at or below 0.03928, divide by 12.92; otherwise raise (value + 0.055) / 1.055 to the power of 2.4. Combine the three linearized channels with the weights 0.2126·R + 0.7152·G + 0.0722·B. That gives you L. Do the same for the second color. The ratio is (L_lighter + 0.05) / (L_darker + 0.05).

The +0.05 in numerator and denominator is what compresses the result into a clean 1:1 to 21:1 range. Pure black on pure white is exactly 21:1. Identical colors are exactly 1:1. The 4.5 figure was chosen so that text remains legible to a person with 20/40 vision (roughly age-related decline) without correction. The 7:1 AAA threshold targets 20/80 vision. This follows W3C's Understanding SC 1.4.3.

What the levels actually require

There are three contrast rules in WCAG 2.1 and 2.2, and they have not changed between the two specs.

  • 1.4.3 Contrast (Minimum), Level AA. Text and images of text need 4.5:1 against their background. Large text gets a relaxed 3:1.
  • 1.4.6 Contrast (Enhanced), Level AAA. Text needs 7:1. Large text needs 4.5:1.
  • 1.4.11 Non-text Contrast, Level AA. UI components and graphical objects need 3:1 against adjacent colors. That covers form-field borders, icon-only buttons, focus rings, and chart segments.

What "large text" means in pixels

WCAG defines large text in points, while most front-end work uses pixels.

Visual definition of WCAG large text: 18pt regular vs 14pt bold vs 16px body

The official definition is text at 18 point or larger, or 14 point or larger if it is bold. Translating to CSS, 1 pt is conventionally 1.333 px, so 18 pt is about 24 px and 14 pt is about 18.66 px. Rounded, that is 24 px regular or 18.5 px bold. Anything below those thresholds is "normal" text, for which 4.5:1 is the floor.

A 16-pixel paragraph is normal text. A 20-pixel subheading is normal text. A 24-pixel hero headline is large text. A 19-pixel bold metric on a dashboard card is large text. The cutoff depends on size and weight, not on what a design system calls a "headline" style.

A reference table of pairs you have seen before

These ratios were computed with the WCAG formula on 2026-11-10 for common pairs: Tailwind defaults, brand blues and the gray-on-white borderline cases. Two decimals, no rounding.

ForegroundBackgroundRatioAA normalAAA normal
#FFFFFF#00000021.00:1passpass
#0F172A (slate-900)#FFFFFF17.85:1passpass
#FFFFFF#1E40AF (blue-800)8.72:1passpass
#1D4ED8 (blue-700)#FFFFFF6.70:1passfail
#FF0000#0000005.25:1passfail
#6B7280 (gray-500)#FFFFFF4.83:1passfail
#767676#FFFFFF4.54:1passfail
#777777#FFFFFF4.48:1failfail
#3B82F6 (blue-500)#FFFFFF3.68:1failfail
#FFC745#007A783.33:1failfail
#9CA3AF (gray-400)#FFFFFF2.54:1failfail

A few rows worth pausing on. The gap between #777777 and #767676 against white is one hex point. The first fails AA normal at 4.48:1, the second passes at 4.54:1. The W3C does not round these numbers, so a checker that rounds 4.48 up to 4.5 and reports a pass is wrong. Tailwind's default blue-500 (#3B82F6) on white is 3.68:1, so a primary button label set in 16px regular weight is non-compliant out of the box. One fix is blue-700 for body-sized text, keeping blue-500 for large headings or for icons where the 3:1 non-text rule applies.

The #FF0000-on-black row is a useful warning. It clears AA at 5.25:1. For people with red-green color blindness (red-green color blindness; colour blindness overall affects about 1 in 12 men, per Colour Blind Awareness), pure red on black can still be hard to read, because the contrast formula uses luminance only and knows nothing about chromatic vision deficiencies.

A reference card showing measured contrast ratios for common color pairs

Why the rule is hard to satisfy with brand colors

A brand color picked for its look can land between 3:1 and 4:1 against white, below the 4.5:1 line for body text. Adjust the lightness of the foreground or the background until the ratio crosses the threshold while the hue stays recognizable.

Color Contrast Checker

Color Contrast Checker

Check WCAG accessibility compliance for text and background colors

In the Z.Tools color contrast checker, drop in a brand color and a background, watch the ratio update, then drag the luminance slider on whichever side is less constrained. The checker shows the AA, AA large, AAA and AAA large results and the 3:1 non-text check together, so you can see which targets you clear. The default sample (yellow #FFC745 on teal #007A78) lands at 3.33:1 — fails AA normal, fails AA large, useful only as a non-text accent. Nudge the yellow lighter or the teal darker and the ratio climbs.

Where teams quietly skip the check

Three places to check.

Placeholder text. Tailwind's gray-400 (#9CA3AF) and zinc-400 (#A1A1AA) are common placeholder grays, at 2.54:1 and 2.56:1 against white. Placeholder is not exempt from the contrast rule unless it is purely decorative. If users rely on the placeholder to remember what the field expects, it is text, and it needs 4.5:1.

Hover and disabled states. SC 1.4.3 exempts text in inactive user interface components, so a disabled label need not reach 4.5:1, but a label at #D1D5DB on white is 1.47:1 and effectively invisible, so consider whether the disabled state still has to convey information. Hover states are not exempt.

Charts and data visualization. Chart legends and axis labels are normal text. Pie slices, line strokes and area fills are graphical objects, and each pair of adjacent colors needs 3:1 to pass 1.4.11. Check your chart library's default palette against that bar.

Once a contrast ratio is the gating constraint on a brand color, rebuild the palette around it instead of tweaking ad hoc. A Tailwind palette generator gives you a full 50-to-950 ramp from one seed color, so you can pick the rung that hits 4.5:1 against your background instead of darkening by guesswork. A color wheel helps when the ratio is fine but the hue clashes; a gradient editor helps when the failing pair is a button background and you want a blend instead of a flat fill.

The formula has been unchanged since WCAG 2.0 in 2008. If a stakeholder disputes a contrast finding, compute the luminance ratio in front of them.

Color Contrast Checker

Color Contrast Checker

Check WCAG accessibility compliance for text and background colors

  • accessibility
  • wcag
  • color
  • design

Keep reading