Color Contrast Checker
Check text-vs-background contrast against WCAG AA & AAA — with a live preview.
Pick a text and background color to see the contrast ratio and WCAG pass/fail. Free. No sign-up. Runs in your browser, nothing is uploaded.
Text color
Background
Almost before we knew it
we had left the ground — the quick brown fox jumps over the lazy dog.
Set a text color and a background, by picker or by typing a hex code, and the checker shows the contrast ratio, a live preview with sample text, and a pass or fail for each of the four WCAG levels: normal and large text, AA and AAA. Ratios run from 1:1 (same color) to 21:1 (black on white).
The four WCAG thresholds
| Level | Normal text | Large text (24 px, or 18.66 px bold) |
|---|---|---|
| AA | 4.5:1 | 3:1 |
| AAA | 7:1 | 4.5:1 |
The same 3:1 also applies, under WCAG 2.1, to non-text elements people need to see: input borders, focus rings, icons that carry meaning and chart lines. Placeholder text in a form field is text, so it needs 4.5:1 if it says something important.
Which grey text passes on white?
Light grey on white is the most common contrast failure on the web. Here are the ratios:
| Text color | On white #FFFFFF | On light grey #F5F5F5 |
|---|---|---|
#595959 | 7.00:1 (AAA) | 6.42:1 (AA) |
#666666 | 5.74:1 (AA) | 5.26:1 (AA) |
#767676 | 4.54:1 (AA) | 4.16:1 (large only) |
#777777 | 4.47:1 (large only) | 4.10:1 (large only) |
#888888 | 3.54:1 (large only) | 3.25:1 (large only) |
#999999 | 2.84:1 (fails) | 2.61:1 (fails) |
#AAAAAA | 2.32:1 (fails) | 2.13:1 (fails) |
#767676 is the lightest neutral grey that passes AA on pure white, and it already fails on a slightly grey card. One hex step lighter, #777777, fails. If your design uses tinted background panels, check the text against the panel, not the page.
Button colors: white text or black text?
Brand colors often look strong but fail with white labels. Ratios for some popular UI colors:
| Button color | White text | Black text |
|---|---|---|
Blue #2563EB | 5.16:1 | 4.06:1 |
Blue #007BFF | 3.97:1 | 5.27:1 |
Red #DC2626 | 4.82:1 | 4.34:1 |
Pure red #FF0000 | 3.99:1 | 5.25:1 |
Green #16A34A | 3.29:1 | 6.37:1 |
Orange #F97316 | 2.80:1 | 7.49:1 |
Purple #7C3AED | 5.69:1 | 3.68:1 |
Mid-tone greens and oranges almost never work with white text at normal size. You have three options: darken the button until white passes, switch to dark text (orange with black text clears even AAA), or keep the color only for large text such as a big hero button.
How the ratio is calculated
Each color's relative luminance is computed with the WCAG formula: the red, green and blue channels are converted from sRGB to linear light, then weighted 21.26% red, 71.52% green and 7.22% blue, because the eye is far more sensitive to green. The ratio is then
(lighter luminance + 0.05) ÷ (darker luminance + 0.05)
The 0.05 accounts for ambient light reflected off a screen. It's also why white on black reaches 21:1 and not infinity.
Contrast isn't the whole story
- Hue alone isn't enough. A red and a green can have a perfectly fine contrast ratio against white and still be confused with each other by people with red-green color blindness. Check that separately with the Color Blindness Simulator.
- Thin fonts read weaker. A light 300-weight font at 4.6:1 is harder to read than a regular weight at the same ratio. The formula doesn't see font weight, so give thin type extra margin.
- Text on images changes from pixel to pixel. Check the lightest part of the image behind the text, or put a solid or semi-opaque layer under the text.
If your colors come as RGB or HSL, convert them to hex first with the Color Converter. If a brand color fails, the Color Shade Generator gives you darker and lighter steps of the same hue to test here until one passes.
Frequently asked questions
Related tools
All Color tools →- Color ConverterConvert any color between HEX, RGB and HSL instantly — pick, preview and copy in one place.
- CSS Gradient GeneratorBuild linear and radial CSS gradients with two colour stops, an angle slider and a live preview — then copy the code.
- Image Color Palette ExtractorPull the dominant color palette out of any image — right in your browser.
