# WCAG contrast ratio explained: 4.5:1, 3:1 and the formula

What WCAG AA and AAA require for text and UI contrast, how relative luminance is calculated (worked through), what counts as large text, and why 4.47 fails.

- Author: AltFTool Editorial
- Published: 2026-12-04
- Category: Tools
- Tags: accessibility, web design, web development
- Canonical URL: <https://www.altftool.com/blogs/wcag-colour-contrast-ratio-explained>

---

WCAG 2 asks for a contrast ratio of at least 4.5:1 for normal text, 3:1 for large text, and 3:1 for the visible parts of controls and meaningful graphics. The enhanced AAA level raises this to 7:1 for normal text and 4.5:1 for large text. The ratio compares two colours' relative luminance and runs from 1:1 to 21:1.

This guide explains each rule, works through the luminance formula on a real brand colour, and covers the cases people get wrong: what counts as large text, why a ratio of 4.47:1 fails, and why passing contrast does not make a palette safe for colour-blind users. Every ratio below was computed with the AltFTool [colour contrast checker](https://www.altftool.com/tools/all/color-contrast-checker).

## The rules, in one table

The Web Content Accessibility Guidelines (WCAG) 2.2 set contrast requirements in three success criteria. Level AA is the baseline; AAA is stricter.

| Success criterion | Applies to | Level | Minimum ratio |
| --- | --- | --- | --- |
| 1.4.3 Contrast (Minimum) | Normal text and images of text | AA | 4.5:1 |
| 1.4.3 Contrast (Minimum) | Large text | AA | 3:1 |
| 1.4.6 Contrast (Enhanced) | Normal text | AAA | 7:1 |
| 1.4.6 Contrast (Enhanced) | Large text | AAA | 4.5:1 |
| 1.4.11 Non-text Contrast | UI component boundaries and states, meaningful graphics | AA | 3:1 |

*Text thresholds as applied by the colour contrast checker; criteria and the 1.4.11 threshold from WCAG 2.2.*

The text criteria have exceptions: text that is purely decorative, part of an inactive (disabled) control, invisible, part of a picture that contains significant other visual content, or part of a logo or brand name has no contrast requirement. Everything else a reader needs to read does.

Two details trip people up. First, the thresholds are minimums with no rounding. `#777777` on white works out at about 4.478:1, which looks as if it "rounds to 4.5", yet it fails AA for normal text. The checker deliberately rounds *down* when it displays a ratio, showing 4.47:1, so a fail never looks like a pass. Second, for solid colours the ratio does not care which colour is the text and which is the background. Light-on-dark and dark-on-light versions of the same pair have the same ratio.

## How the ratio is calculated, worked through

The formula has two parts: turn each colour into a **relative luminance** (0 for black, 1 for white), then compare the two luminances.

1. Divide each 8-bit channel (R, G, B, from 0 to 255) by 255 to get a value from 0 to 1.
2. Linearise each channel: if the value is 0.04045 or less, divide it by 12.92; otherwise compute ((value + 0.055) ÷ 1.055) raised to the power 2.4.
3. Weight and add the three linear channels: L = 0.2126 × R + 0.7152 × G + 0.0722 × B.
4. With L1 as the lighter colour and L2 the darker, the contrast ratio is (L1 + 0.05) ÷ (L2 + 0.05).

Here is that worked for AltFTool's own primary blue, `#1663D9`, against white:

| Channel | Hex → 0–255 | ÷ 255 | Linearised | Weight | Contribution |
| --- | --- | --- | --- | --- | --- |
| Red | 16 → 22 | 0.0863 | 0.00802 | 0.2126 | 0.00171 |
| Green | 63 → 99 | 0.3882 | 0.12477 | 0.7152 | 0.08924 |
| Blue | D9 → 217 | 0.8510 | 0.69387 | 0.0722 | 0.05010 |
| Total |  |  |  |  | L = 0.14104 |

*Intermediate values from the colour contrast checker's relativeLuminance function.*

White has a luminance of exactly 1. So the ratio is (1 + 0.05) ÷ (0.14104 + 0.05) = 1.05 ÷ 0.19104 ≈ 5.496, displayed as 5.49:1. That passes AA for all text sizes and AAA for large text, but not AAA for normal text (7:1).

Notice how heavily green is weighted: it carries about 72% of the luminance weight, and blue only about 7%. That is why a saturated blue can look vivid yet still be quite dark, and why yellow and light green on white so often fail.

Older copies of the formula give the linearisation threshold as 0.03928 instead of 0.04045; WCAG 2.2 notes the value was updated in May 2021. For ordinary 8-bit colours the two give identical results: 10 ÷ 255 is about 0.0392 and 11 ÷ 255 is about 0.0431, so no channel value from 0 to 255 falls between the two thresholds.

**Color Contrast Checker**

Test any text and background pair against WCAG AA and AAA, with the ratio rounded down so a borderline fail never looks like a pass.

[Open Color Contrast Checker](https://www.altftool.com/tools/all/color-contrast-checker)

## Grey on white: where the line falls

Mid-grey text on white is a frequent contrast failure, and the boundary is sharper than people expect.

| Text colour on white | Ratio | AA normal (4.5) | AA large (3) | AAA normal (7) |
| --- | --- | --- | --- | --- |
| #595959 | 7.00:1 | Pass | Pass | Pass |
| #767676 | 4.54:1 | Pass | Pass | Fail |
| #777777 | 4.47:1 | Fail | Pass | Fail |
| #949494 | 3.03:1 | Fail | Pass | Fail |
| #FF0000 (pure red) | 3.99:1 | Fail | Pass | Fail |

*All ratios computed with the colour contrast checker.*

`#767676` and `#777777` differ by one step in each channel, and the line between pass and fail runs between them. Pure red on white fails for body text; the same red on black reaches 5.25:1 and passes. If you are choosing a palette from scratch, the [colour picker](https://www.altftool.com/tools/all/color-picker) shows an AA badge as you adjust a colour, and the [colour converter](https://www.altftool.com/tools/all/color-conversions) translates the result between HEX, RGB and HSL.

## What counts as large text

WCAG defines large text in points: at least 18 point, or at least 14 point if bold. The Understanding document for 1.4.3 relates these to CSS pixels: 18pt is about 24px and 14pt is about 18.5px. Body copy at 16px therefore needs the full 4.5:1, even if it is bold.

Large text gets a lower threshold because bigger, heavier letterforms stay legible at lower contrast. But "large" is measured on the rendered text. A regular-weight heading that is 24px on desktop and shrinks to 20px on a phone is no longer large text on that phone, so it needs 4.5:1 there.

## Non-text contrast and colour-blind safety

Success criterion 1.4.11 extends contrast to things that are not text: the boundary of an input box, the state of a checkbox or toggle, a focus indicator, an icon that conveys meaning, and the parts of a chart a user needs to understand it. Each needs at least 3:1 against the colours next to it. A pale grey input border on white is a common failure: the text inside passes, but users cannot find the field.

Contrast is also not the same as colour-blind safety. Contrast measures luminance, the light–dark difference. Colour vision deficiencies mostly affect hue, especially the red–green distinction. A red and a green of similar luminance can be hard to tell apart for someone with red–green colour blindness. Pure red (`#FF0000`) and mid green (`#008000`) are a good example: each passes at least AA large-text contrast against white (3.99:1 and 5.13:1), but against each other they reach only 1.28:1, so they differ mainly in hue. That is why WCAG has a separate rule, 1.4.1 Use of Color: colour must not be the only way information is conveyed. Add text, icons, patterns or position. To see your design the way colour-blind users do, try the [colour blindness simulator](https://www.altftool.com/tools/all/color-blindness-simulator), and use the [colour-blind safe palette fixer](https://www.altftool.com/tools/all/colorblind-safe-palette-fixer) to repair chart palettes.

## What about APCA and WCAG 3?

WCAG 3 is a separate, much larger rewrite that the W3C is still developing, and it is not a finished standard. A newer contrast method called APCA has been discussed for it, but no final contrast algorithm or threshold has been adopted. For conformance today, and for any legal or contractual requirement that cites WCAG 2.x, the 2.x ratio described above is the one that counts. Keep an eye on the W3C's WCAG 3 pages rather than relying on early drafts.

## Frequently asked questions

### How do I check contrast for text over an image or gradient?

Check the text against the part of the background behind it that gives the lowest contrast, not an average. If that worst spot fails, add a solid or semi-transparent backing behind the text, or move the text to a calmer area of the image.

### Is 4.48:1 close enough to pass AA?

No. The thresholds are minimums and are not rounded. #777777 on white is about 4.48:1, which the checker displays as 4.47:1, and it fails AA for normal text; #767676 reaches about 4.54:1 and passes.

### Does bold 16px text count as large text?

No. Bold text qualifies as large from 14pt, which the W3C's Understanding document puts at roughly 18.5px in CSS, so 16px bold body text still needs 4.5:1. Regular-weight text needs to be about 24px (18pt) to count as large.

### Do hover and focus states need to meet contrast rules?

Yes, where they carry information. Text in any state needs text contrast, and under the non-text contrast criterion the visual change that shows a control is focused or selected needs at least 3:1 against the colours next to it.

### If my colours pass contrast, are they colour-blind safe?

Not necessarily. Contrast measures lightness difference; colour blindness mostly affects hue. Red and green with similar lightness can look the same to many colour-blind users, so never rely on colour alone to carry meaning.

### Do logos and disabled buttons need to meet contrast rules?

No. WCAG exempts text that is part of a logo or brand name, purely decorative text, and text in inactive (disabled) components from the text contrast requirements.

## Sources and notes

1. [Web Content Accessibility Guidelines (WCAG) 2.2](https://www.w3.org/TR/WCAG22/) — W3C
2. [Understanding Success Criterion 1.4.3: Contrast (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html) — W3C Web Accessibility Initiative
3. [Understanding Success Criterion 1.4.11: Non-text Contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html) — W3C Web Accessibility Initiative
4. [Understanding Success Criterion 1.4.1: Use of Color](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html) — W3C Web Accessibility Initiative
5. [WCAG 3 Introduction](https://www.w3.org/WAI/standards-guidelines/wcag/wcag3-intro/) — W3C Web Accessibility Initiative
