How it works
Each color’s relative luminance is calculated per the WCAG formula, which weights red, green and blue by how sensitive human vision is to each. The contrast ratio compares the lighter color’s luminance to the darker one’s, giving a value from 1:1 (identical colors) to 21:1 (black on white).
Reading the results
WCAG 2.1 defines two conformance levels. AA is the baseline most accessibility guidelines and regulations require: at least 4.5:1 for normal text, or 3:1 for large text. AAA is a stricter, optional target of 7:1 and 4.5:1. Large text is defined as 18pt (24px) or larger, or 14pt (about 18.5px) bold or larger — big enough that lower contrast is still legible.
This checks color alone
Contrast ratio is one piece of text legibility, not the whole picture. Font weight, letter spacing, and surrounding visual noise all affect how readable text actually is, even at a ratio that technically passes.