How WCAG contrast is measured
This desk uses the contrast formula in WCAG 2.1 and 2.2. Each 8-bit sRGB channel is linearized, relative luminance is L = 0.2126 R + 0.7152 G + 0.0722 B, and the contrast ratio is (L1 + 0.05) / (L2 + 0.05), with L1 the lighter of the two. Success criteria 1.4.3, 1.4.6, and 1.4.11 are the same in WCAG 2.2 as in 2.1.
The four badges on the checker map to those criteria. AA Normal Text requires 4.5:1. AA Large Text (18pt regular or 14pt bold) and non-text UI components under SC 1.4.11 require 3:1. AAA Normal Text requires 7:1. AAA Large Text requires 4.5:1.
Relative luminance
A channel C in the range 0–1 is linearized to C/12.92 when C is at most 0.04045, otherwise ((C + 0.055) / 1.055) raised to 2.4. The three linear channels are then weighted as above. Black on white is exactly 21.00:1. The mid grey #767676 on white is at least 4.54:1, which meets AA for normal text.
| Check | Level and criterion | Minimum ratio |
|---|---|---|
| AA Normal Text | AA · SC 1.4.3 | 4.5:1 |
| AA Large Text / UI | AA · SC 1.4.3 / 1.4.11 | 3.0:1 |
| AAA Normal Text | AAA · SC 1.4.6 | 7.0:1 |
| AAA Large Text | AAA · SC 1.4.6 | 4.5:1 |
How Auto-Fix works
Auto-Fix keeps the hue and saturation of the color you chose to adjust, and binary-searches lightness until the target ratio is met. It tries both darker and lighter directions and keeps the nearest lightness. If that color cannot reach the target, it automatically tries the other color in the pair. Some mid-tone pairs cannot reach 7:1 by lightness alone; the desk reports that instead of inventing a new hue.
WCAG 2.1 · WCAG 2.2 · Understanding SC 1.4.3 · Understanding SC 1.4.11
Questions
Why is large text allowed a lower ratio?
WCAG treats 18 point regular or 14 point bold as large text under SC 1.4.3, and allows 3:1 at AA. AAA large text still needs 4.5:1. UI component contrast is a separate 3:1 rule under SC 1.4.11.
Does rounding the displayed ratio change a pass?
No. The badges use the exact computed ratio. The large figure is shown to two decimal places only as a readout.