Does your text have enough contrast?
Give a text colour and a background colour as hex, rgb or hsl, or pick them. You get the contrast ratio, whether normal text, large text and interface parts pass WCAG 2.2 at AA and AAA, and the nearest colour that passes.
How it works
- The WCAG 2.2 formula. Each colour's relative luminance is 0.2126 R + 0.7152 G + 0.0722 B, after each sRGB channel is linearised (divided by 12.92 up to 0.04045, raised to the power 2.4 above it). The contrast ratio is (L1 + 0.05) / (L2 + 0.05), with the lighter colour on top, so it runs from 1:1 to 21:1.
- The thresholds. Success criterion 1.4.3 (AA) asks for 4.5:1 for text and 3:1 for large text. 1.4.6 (AAA) asks for 7:1 and 4.5:1. 1.4.11 (AA) asks for 3:1 for the parts of controls and graphics that people need to see.
- No rounding up. The W3C's explanation of 1.4.3 says the computed ratio should not be rounded, so 4.499:1 fails 4.5:1. The ratio shown here is cut to two decimals, never rounded up.
- Transparent colours. A background with transparency is blended over white, the default WCAG assumes, and transparent text over the background.
- The nearest colour that passes. It keeps the hue and saturation of your colour and changes only its lightness, by as little as it takes, then checks the result again as a hex value.
The formulas and thresholds come from the W3C's Web Content Accessibility Guidelines (WCAG) 2.2, its definitions of relative luminance, contrast ratio and large scale text, and Understanding SC 1.4.3, read in November 2026.
What it cannot see
It checks two colours, not your page. Text over a photo or a gradient has many backgrounds: test it against the lightest and the darkest point behind the letters.
It cannot judge the font. WCAG notes that very thin strokes are harder to read at lower contrast, so a pass with a light typeface may still be hard on the eyes.
Some things have no contrast requirement in WCAG: logos and brand names, text that is pure decoration, and controls that are switched off. Colour vision is a separate matter too: information should never depend on colour alone.
Questions
What counts as large text?
WCAG 2.2 says at least 18 point, or 14 point in bold. The W3C's explanation puts that at about 24 CSS pixels, or about 18.5 pixels in bold. Headings usually qualify; body text usually does not.
Should I aim for AA or AAA?
AA is WCAG's minimum for contrast and AAA the enhanced level. If no one has told you which to meet, make every piece of text pass AA and give long reading text AAA where your brand colours allow it.
Why does 4.49:1 fail when it is so close?
The thresholds are exact. The W3C's explanation of the success criterion says not to round the computed value, so anything under 4.5:1 fails AA for normal text.
Are my colours sent anywhere?
No. Everything is worked out inside your browser and the page sends nothing to a server.