A designer hands you a pale gray caption on white. It looks elegant on a big monitor, but on a phone in sunlight it disappears. Accessibility checks put a number on that problem: the contrast ratio. This guide explains what the numbers in the Color Contrast Checker mean, how to read a fail, and how to adjust a color just far enough to pass without wrecking your design.
What the tool shows
You enter a Text color and a Background color, either by picking or by pasting a HEX code. The tool shows the contrast ratio and four checks: AA normal text, AAA normal text, AA large text and AAA large text. A Preview shows the pair as an article, a card or buttons, so you can judge it in context. A swap option exchanges the two colors, which is handy when you want to try light text on dark.
The thresholds
| Level | Normal text | Large text |
|---|---|---|
| AA | 4.5 : 1 | 3 : 1 |
| AAA | 7 : 1 | 4.5 : 1 |
The ratio is calculated from the relative luminance of the two colors, from 1:1 (identical) to 21:1 (black on white). In WCAG, "large" text means roughly 18 point or larger, or 14 point and bold. Most body text is normal, so aim for 4.5:1 as the minimum. A ratio of exactly 4.5 passes AA, which is how this tool compares it.
Real pairs, real results
These are calculated with the standard WCAG formula, so you can try them in the tool:
| Text on white background | Ratio | Verdict |
|---|---|---|
| #999999 (light gray) | 2.85 : 1 | Fails AA for any text size |
| #777777 | 4.48 : 1 | Just misses AA for normal text, passes large |
| #767676 | 4.54 : 1 | Passes AA normal |
| #595959 | 7.00 : 1 | Passes AAA normal |
| #ff6600 (orange) | 2.94 : 1 | Fails; fine only as a decoration |
The step between #777777 and #767676 shows how small a change can be: one shade darker flips a fail into a pass.
How to fix a failing pair
- Decide which color is allowed to move. Usually the text moves, because the background carries the brand feel.
- Darken the text on a light background, or lighten it on a dark one. Change the lightness, not the hue, so it still looks like the same color family. For an orange like #ff6600, a darker burnt orange such as #cc4f00 gets to 4.48:1, and a slightly darker one passes.
- Re-check after each nudge. Paste the new HEX code into the tool and read the ratio. Stop as soon as it passes; you do not need to go further than the target.
- If the text color must not change, move the background. White text on #3b82f6 gets 3.68:1, which fails for normal text. White on #2563eb gets 5.17:1 and passes. The same blue family, one shade deeper.
- Make the text larger or bolder if the design allows. Large text only needs 3:1, which opens up more color pairs.
Colors that can never work
Some combinations cannot be saved by small tweaks. Yellow on white is around 1.2:1; no amount of fine-tuning will fix it. Use a very dark text color on a yellow background instead, which reaches a high ratio. When a pair is far from the target, switch roles rather than inching toward it.
Where contrast matters most
- Body text and captions, especially small gray ones.
- Text on images and gradients, where the background changes under the words. Test the lightest and the darkest area.
- Button labels and placeholder text in form fields.
- Links inside paragraphs; they need to be distinguishable from surrounding text.
Limits of a ratio
A passing ratio is the minimum, not a guarantee. People with color blindness may still confuse pairs that have good contrast but differ only in hue, such as red and green. Do not rely on color alone to carry meaning; add an icon, underline or label. The tool measures two flat colors; it cannot judge text over a photo or a gradient, so test those at the worst point. A transparent color is also ignored, since only the color values are compared.
Related tools
If you are building a palette from scratch, see random colors to a usable palette. To read a color from a screenshot, use the Color Picker.
A worked example: a gray caption under a photo
A caption is set in #999999 on white. The tool reports 2.85:1, which fails AA for any size. You try #777777 and get 4.48, which is close but still just short for normal text. One more step to #767676 reaches 4.54 and passes AA. You like the lighter look, so you accept it for captions, and for body paragraphs you choose #595959, which reaches 7.00 and passes AAA. The whole fix took three tries and the design still looks soft and gray. The point is that you rarely need black; you only need to cross the line, and the tool tells you exactly when you have.
Contrast for buttons and links
Buttons deserve the same check as paragraphs. A white label on a brand-colored button is normal text unless it is large and bold, so the 4.5:1 threshold applies. Links inside body text are best distinguished by an underline as well as color, since a color change of small contrast is easy to miss. Disabled controls are exempt from the rule, but making them extremely faint also makes it hard for people to understand what they are looking at. When in doubt, check the pair, and prefer to pass.
FAQ
Which level should I target?
AA is the common legal and practical target for body text. AAA is stricter and is worth aiming for on long reading content.
Do logos need to pass?
The WCAG text rules exempt logos and purely decorative text, but readability still helps.
Why does the ratio ignore my opacity?
The tool compares solid colors. If your text is semi-transparent, work out the blended color and check that instead.
Is anything uploaded?
No. The check runs in your browser.