About this tool
Enter a text color and a background color to get the contrast ratio and a pass or fail against all four WCAG 2.1 thresholds: 4.5:1 for normal text at AA, 7:1 at AAA, and 3:1 and 4.5:1 for large text — which means 18pt and above, or 14pt and above when bold. A live sample renders the pairing so you can see the result, not just the number, and a swap button flips foreground and background, because the same ratio can be a good decision in one direction and a poor one in the other.
The ratio is computed with the WCAG relative-luminance formula, the same one automated accessibility checkers use, so a pass here is a pass in an audit. Colors are accepted as HEX, rgb() or hsl().
Two honest limits. Contrast is only part of legibility — weight, size and letter-spacing matter too, and a passing ratio in a hairline font can still be hard to read. And alpha is ignored: if your text sits on a translucent overlay, check the composited color rather than the one with transparency.