Most teams check one contrast ratio — body text against its background — and call the page accessible. There are at least three ratio rules, and the two people forget are where audits fail.

Contrast is the accessibility rule teams think they've handled. Someone runs the body text through a checker, it clears 4.5:1, and the page gets marked compliant. Then an external audit finds the button nobody checked, the focus ring that's invisible, the placeholder text that fails. Contrast compliance isn't one number. It's a small set of ratio rules, applied to every state of every component, and the ones people skip are exactly where the failures cluster.

Which WCAG, as of November 2026

A quick orientation first, because version numbers cause confusion. WCAG 2.1 introduced the non-text contrast rule discussed below. WCAG 2.2 is the current W3C Recommendation (the edition we read is dated 12 December 2024), and the W3C states that content conforming to 2.2 also conforms to 2.0 and 2.1. The contrast thresholds didn't change between 2.1 and 2.2. WCAG 3.0 exists only as a Working Draft (10 September 2026 at the time of writing). So in practice: build to WCAG 2.2 AA, and you satisfy anyone still asking for 2.1 AA.

The three ratio rules

WCAG defines contrast as a ratio between two relative luminances. The guideline text is precise about the thresholds:

"The visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for the following:... Large-scale text and images of large-scale text have a contrast ratio of at least 3:1."

— W3C, "Understanding SC 1.4.3: Contrast (Minimum)"

So: normal text needs 4.5:1, large text (the W3C's guide uses 18 point, or 14 point bold) needs 3:1, and — the one most designers never learned — user interface components and meaningful graphics need 3:1 as well, under SC 1.4.11 Non-text Contrast. Three rules. Most teams remember one.

How the ratio is calculated

The number isn't a matter of taste; it's arithmetic you can check. Each colour's sRGB channels are converted to linear light, weighted (0.2126 red, 0.7152 green, 0.0722 blue) and summed into a relative luminance between 0 and 1. The ratio is then (L1 + 0.05) ÷ (L2 + 0.05), lighter over darker, so it runs from 1:1 (identical colours) to 21:1 (black on white). We ran that formula, exactly as WCAG 2.2 defines it, over some colours that show up in real interfaces:

Foreground on backgroundRatioNormal text (4.5:1)Large text / UI (3:1)
#767676 grey on white4.54:1passpass
#777777 grey on white4.48:1failpass
#949494 grey on white3.03:1failpass
#cccccc border on white1.61:1failfail
#8a8a8a border on white3.45:1failpass
white on #0969da blue5.19:1passpass
white on #58a6ff lighter blue2.53:1failfail

The first two rows are one hex step apart and land on opposite sides of the line. That's not a rounding quirk you can argue with: the W3C's guidance says computed values "should not be rounded (e.g., 4.499:1 would not meet the 4.5:1 threshold)". If a checker displays "4.5" for #777777, look at more decimal places.

What counts as a "UI component"

This is the rule that trips audits. Buttons, form-field borders, checkboxes, toggle states, and focus indicators are all user interface components, and the visual information needed to identify them and their states needs 3:1 against the adjacent colours. A text input with a pale-grey border sitting on white at 1.6:1 fails — the field itself is close to invisible to a low-vision user even if the text inside it passes. Swap #cccccc for #8a8a8a and the same border clears 3.45:1. People check the words and forget the box the words live in.

Placeholder text is the other common miss. It's text a user may need to read, so the text thresholds apply to it, and a light grey such as #949494 (3.03:1 in the table) is enough for a border, not for words.

The hover and focus trap

Contrast has to hold in every state, not just at rest. Look at the two blues in the table: a white label on #0969da passes comfortably at 5.19:1. If the hover state lightens the button to #58a6ff, the same white label drops to 2.53:1 and fails even the 3:1 large-text bar. Interactive states are exactly when contrast tends to slip, because designers pick hover colours for "feel" rather than running them through a checker. If you change a colour on interaction, both the resting and the changed colour have to pass.

Focus indicators deserve their own check. The W3C's example in the 1.4.11 guidance uses a grey focus outline, #949494 on white, at 3:1 — just enough. Anything paler, and keyboard users lose track of where they are on the page. WCAG 2.2 also added focus-related criteria (Focus Not Obscured at AA, Focus Appearance at AAA), so a visible focus ring that's then hidden under a sticky header is a separate failure.

The exemptions, correctly understood

WCAG exempts logotypes, purely decorative text, and inactive (disabled) components from the contrast rules, and this exemption is widely misread in both directions. Yes — your brand wordmark can use its official colours even if they'd fail as text, because it's a logo. No — that exemption does not extend to your headings, buttons, or body copy just because they use brand colours. The carve-out is narrow: the logo itself, incidental or decorative text, and genuinely disabled controls. Everything a user is meant to read or operate is in scope.

Contrast is necessary, not sufficient

Passing every ratio still doesn't mean the page works for everyone, because contrast and colour-differentiation are different problems. In our table's terms, a red error message (#d32f2f, 4.98:1 on white) and a green success message (#2e7d32, 5.13:1) both pass — and can still look alike to someone with red-green colour vision deficiency. MedlinePlus Genetics, from the US National Library of Medicine, reports that red-green colour vision deficiency occurs in about 1 in 12 men and 1 in 200 women among people with Northern European ancestry. Contrast handles "can they see it against the background"; it says nothing about "can they tell these two states apart." That's why never relying on colour alone — add an icon, a label, a pattern — sits right alongside the ratio rules.

Where this is heading: WCAG 3 and APCA

WCAG 2's luminance-ratio formula is a simplification: human contrast perception isn't a clean ratio, and the formula treats a pair of colours the same way whichever one is the text. One alternative you'll see discussed is APCA, the Accessible Perceptual Contrast Algorithm. It's important to be accurate about its status: the current WCAG 3.0 Working Draft does not adopt APCA. Its text-contrast requirements say the measure is still to be decided, with an editor's note that "The contrast algorithm used in WCAG 3 is yet to be determined." So today you build to WCAG 2.2 AA, and treat any newer model as a second opinion rather than a compliance test.

Check every state, not just the text

Make contrast checking mechanical and complete. Run text and, crucially, UI-component and focus-state colours through a WCAG contrast checker — every state, not just the resting one, and note the third decimal when a pair is close to a threshold. Preview the interface under different colour-vision types with your browser's colour-vision emulation (Chrome DevTools has one under Emulate vision deficiencies in its Rendering tab) to catch the red-green failure that a passing ratio hides. For charts, badges, and text baked into images, sample the actual rendered colours rather than trusting the CSS. Compliance is three rules across every state — not one number on the body copy.

← All articles