Contrast ratio and readable text
Grey #767676 on white has a contrast ratio of 4.54:1 and passes the WCAG minimum for body text; one step lighter, #777777 gives 4.48:1 and fails.
Drag to turn. Scroll or pinch to zoom.
Relative luminance
To decide whether text can be read, the Web Content Accessibility Guidelines do not use hue or HSL lightness. They use relative luminance, a number from 0 for black to 1 for white that tracks how much light a colour sends to the eye. WCAG 2.2 defines it in two steps. First, each channel is turned into a number from 0 to 1 by dividing by 255 and then undoing the sRGB curve: if the value is at most 0.04045, divide it by 12.92; otherwise compute ((value + 0.055) / 1.055) to the power 2.4. Second, the three results are weighted and added: L = 0.2126 R + 0.7152 G + 0.0722 B.
The weights explain a lot. Green carries more than 70% of the total, blue barely 7%. That is why pure blue #0000ff has a luminance of only 0.0722 and pure yellow, red plus green, has 0.9278. The specification also records a small history: before May 2021 the threshold was written 0.03928, copied from an older document. It was corrected to 0.04045, and WCAG notes that this has no practical effect on the results.
Contrast ratio
The contrast ratio compares two luminances: (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter colour and L2 the darker. The 0.05 stands for a little stray light that always reaches the eye, and it keeps the ratio finite for black. Ratios run from 1:1, a colour against itself, to 21:1, black against white: (1 + 0.05) / (0 + 0.05) = 21. For #767676 on white the luminance is 0.1812, so the ratio is 1.05 / 0.2312 = 4.54.
Here is the whole calculation for the blue #2273c3 used in unit 2, rgb(34 115 195). Divided by 255, the channels are 0.1333, 0.4510 and 0.7647. All three are above 0.04045, so each goes through the power formula, giving 0.0160, 0.1714 and 0.5457. Weighted, they become 0.0034 from red, 0.1226 from green and 0.0394 from blue, and the sum is a luminance of 0.1654. Against white the ratio is 1.05 / 0.2154 = 4.87, so this blue passes AA for body text on a white page. Against black it is 0.2154 / 0.05 = 4.31, just short.
The thresholds
WCAG 2.2 turns the ratio into pass or fail lines. Success criterion 1.4.3, at level AA, asks for at least 4.5:1 for normal text and 3:1 for large-scale text. Large-scale means at least 18 point, or 14 point bold; WCAG notes this is roughly 1.5 em and 1.2 em bold for common body fonts. Criterion 1.4.6, at level AAA, raises the bar to 7:1 and 4.5:1. Criterion 1.4.11 asks for 3:1 for the parts of buttons, form fields and icons that people need to see. Pure red #ff0000 on white gives 4.00:1, which is fine for a large heading but fails for body text. Blue #0000ff on white gives 8.59:1 and passes everything.
One more useful fact falls out of the formula. A colour with luminance about 0.179 has the same contrast against white and against black, about 4.58:1. Darker than that, white text reads better on it; lighter than that, black text does. The panel under the model shows both ratios and names the better choice.
Contrast ratio = (L1 + 0.05) / (L2 + 0.05). Body text needs 4.5:1, large text 3:1, AAA body text 7:1.
| AA, normal text (1.4.3) | 4.5:1 |
| AA, large text (1.4.3) | 3:1 |
| AAA, normal text (1.4.6) | 7:1 |
| Icons and form borders (1.4.11) | 3:1 |
| Large-scale text | 18 pt, or 14 pt bold |
| Black on white | 21:1, the maximum |
- Relative luminance: linearise each channel, then 0.2126 R + 0.7152 G + 0.0722 B.
- Contrast ratio = (L1 + 0.05) / (L2 + 0.05), from 1:1 to 21:1.
- AA: 4.5:1 body text, 3:1 large text and UI parts. AAA: 7:1 body text.
- #767676 on white is 4.54:1 and passes; #ff0000 on white is 4.00:1 and fails for body text.
- What is the contrast ratio of black on white?
- What is the lowest possible contrast ratio?
- Contrast ratio of #767676 on white, to 2 decimal places? (Its luminance is 0.1812.)
- What minimum contrast does WCAG 2.2 AA ask for normal body text?
- Contrast ratio of pure red #ff0000 on white, to 2 decimal places? (Luminance 0.2126.)
- Red #ff0000 on white (4.00:1) is suitable for...
- Large headings only
- Body text at AA
- Body text at AAA
- Nothing at all
- Which channel has the biggest weight in relative luminance?
- Green
- Red
- Blue
- All equal
- Which counts as large-scale text in WCAG?
- 18 pt, or 14 pt bold
- 12 pt bold
- 16 px regular
- Any heading
- What ratio does WCAG ask for icons and form field borders (1.4.11)?
- Yellow #ffff00 text on white has a ratio of about 1.07:1. What does that mean?
- It is almost unreadable
- It passes AA
- It passes AAA
- It is the best possible
- Before May 2021, what threshold did the WCAG luminance formula use instead of 0.04045?
- 0.03928
- 0.05
- 12.92
- 0.055
Sources for this course (14)
- W3C, Web Content Accessibility Guidelines (WCAG) 2.2, relative luminance (0.04045 threshold, note on the pre-May-2021 value 0.03928)
- contrast ratio (L1 + 0.05) / (L2 + 0.05)
- range 1:1 to 21:1, SC 1.4.1 Use of Color, 1.4.3 Contrast (Minimum) 4.5:1 and 3:1 for large-scale text (18 pt, or 14 pt bold)
- 1.4.6 Contrast (Enhanced) 7:1 and 4.5:1, 1.4.11 Non-text Contrast 3:1, WCAG 2.1 published June 2018 (w3.org/TR/WCAG22/)
- W3C, CSS Color Module Level 4, hex notation, hsl with 0deg red, 120deg green, 240deg blue, hsl(60deg 100% 50%) yellow vs hsl(240deg 100% 50%) blue at the same HSL lightness, hue spacing not perceptually uniform, HSL as a cylindrical model (w3.org/TR/css-color-4/)
- OpenStax College Physics 2e, 26.3 Color and Color Vision: about 6 million cones of three types, red + green gives yellow, no unique set of primaries (openstax.org/books/college-physics-2e/pages/26-3-color-and-color-vision)
- OpenStax Introduction to Behavioral Neuroscience, 6.2 The Retina: RGB pixels, CMY inks plus black, red-green colour blindness in about 8% of males (openstax.org/books/introduction-behavioral-neuroscience/pages/6-2-the-retina)
- Smithsonian Libraries, Color in a New Light, The Science of Color: Newton's prism experiments from the 1660s, Opticks 1704, Le Blon's Coloritto (London, about 1722) and the distinction between material colours and coloured light (library.si.edu/exhibition/color-in-a-new-light/science)
- The Newton Project (University of Oxford)
- Opticks 1704, Book I Part II Prop. VI: colour circle divided into seven parts in musical proportion, white at the centre (newtonproject.ox.ac.uk/view/texts/normalized/NATP00034)
- History of Information and Wikimedia Commons file record, Maxwell's 1861 Royal Institution demonstration, tartan ribbon photographed by Thomas Sutton through red, green and blue filters and projected together (historyofinformation.com/detail.php?id=3666)
- LibreTexts, Coalinga College Drawing Basics 8.4 Color Theory: complementary, analogous, split-complementary, triadic, tetradic (human.libretexts.org)
- RMIT Colour Theory, Interactive colour wheel and colour relationships (rmit.pressbooks.pub/colourtheory1)
- University of Delaware Library, Graphic Design guide, Color Schemes, 60/30/10 rule (guides.lib.udel.edu/design/color).
Checked: 2026-10-17