How to use it 01 Pick the pair. Set foreground and background with the color picker or by typing a HEX value; both fields accept 3- and 6-digit input. 02 Read the ratio. The card shows the contrast ratio to two decimals as N.NN : 1, and four badges mark AA and AAA for normal and large text separately. 03 Apply the fix. When AA normal fails, a suggestion appears with its HEX and the ratio it reaches. Clicking the swatch copies it into the foreground field. 04 Check the pair both ways. Swapping text and background cannot change the ratio; use the swap to sanity-check a dark-mode variant.
Worked readouts
Foreground
Background
The panel reads
#8a8a8a
#f2f2f2
3.08 : 1 — AA large passes, AA normal fails; suggestion #6e6e6e → 4.55 : 1
#a3a3a3
#ffffff
2.52 : 1 — all four badges fail
#004d99
#f2f2f2
7.44 : 1 — AA normal, AA large, AAA normal and AAA large all pass
#0b5cad
#ffffff
6.67 : 1 — AA normal and both large badges pass; AAA normal fails
#ffffff
#1f2937
14.68 : 1 — all four pass
Where the numbers come from Each sRGB channel is linearised first — divided by 12.92 at or below 0.04045, otherwise raised with ((v + 0.055) / 1.055)^2.4. Relative luminance then combines the channels as 0.2126 R + 0.7152 G + 0.0722 B, and the ratio is (L_light + 0.05) / (L_dark + 0.05). Hue and saturation never enter the formula: two very different colors with the same luminance score identically.
The suggestion keeps hue and saturation and walks lightness away from the original value until the ratio clears 4.5 : 1, so the fixed color reads as a darker or lighter version of the same hue rather than a hue change.
Assumptions and limits
sRGB pairs only. No wide-gamut profiles, no alpha compositing, no gradients or images. A translucent overlay has to be composited to a solid color before it can be checked. What it does not do: it does not scan a page, parse stylesheets or generate a design-system report. To build and preview whole palettes, including color-blind simulations, use the Palette panel ; to convert a value you just picked, use Convert .
The badge that reads 3.00 but fails The comparison uses the unrounded ratio, and that matters right at a threshold. #949494 on white reads 3.03 : 1 and passes AA large. #959595 reads 3.00 : 1 on the card yet fails AA large, because its true ratio is 2.9953 — the badge needs 3.0 exactly. The same effect exists at 4.5 : 1, where a pair printed as 4.50 can still fail. When the badge and the printed number disagree, the badge is right.
Where it helps Body text on tinted surfaces A gray #8a8a8a on an off-white #f2f2f2 card fails AA normal at 3.08 : 1 ; the suggested #6e6e6e fixes it at 4.55 : 1 . Re-check the same text against every surface it lands on, hover states and dark mode included.
Auditing a brand palette A deep blue like #004d99 clears even AAA normal on a light panel at 7.44 : 1 , while a lighter brand blue #0b5cad passes AA and misses AAA at 6.67 : 1 . Large headings can take the lower bar; body copy usually cannot.
Privacy Both colors and the whole calculation stay in your browser; nothing is uploaded and nothing leaves this device.
References
W3C, WCAG 2.2 — Contrast (Minimum) , w3.org (访问日期:2026-10-07)— the 4.5 : 1 text and 3 : 1 large-text thresholds.
W3C, WCAG 2.2 — relative luminance , w3.org (访问日期:2026-10-07)— the channel linearisation and the 0.2126 / 0.7152 / 0.0722 weights.
W3C WAI, Understanding SC 1.4.3: Contrast (Minimum) , w3.org (访问日期:2026-10-07)— large text defined as 18 pt regular or 14 pt bold, and the rule that computed ratios are not rounded.
Calculators in this hub
Hand-picked tools, one click away. The mini versions compute live and carry your values into the full calculator.
Sources & review
Reviewed by CalcX Editorial Team
Updated 2026-10-07