Color Contrast Checker
Beta: this tool hasn't been fully reviewed yet. Double-check results before relying on them.
Inputs
Any CSS color: hex, rgb(), hsl(), oklch() or a name.
Results
Enter two colors this tool can read, such as #767676 and #ffffff.
- Contrast ratio
- —
- —AA, normal text (4.5 : 1)
- —AA, large text (3 : 1)
- —AAA, normal text (7 : 1)
- —AAA, large text (4.5 : 1)
- —Icons, borders, controls (3 : 1)
Nearest text color that passes
- AA · 4.5 : 1
— - AAA · 7 : 1
—
Same hue as your text color, only lighter or darker, as little as needed.
Your input is too long to share as a link, so the page address no longer includes it.
Text needs enough contrast with its background to be read comfortably, including by people with low vision and on screens in sunlight. The Web Content Accessibility Guidelines (WCAG) measure it as a ratio from 1 : 1 (no difference) to 21 : 1 (black on white) and set the minimums that accessibility laws usually refer to.
How to use it
- Enter the text color and the background color (type them or use the pickers).
- Read the contrast ratio and which WCAG levels it passes.
- If it fails, click Use next to the suggested color.
Examples: gray #767676 on white is 4.54 : 1, the lightest gray that passes AA for normal text. #777777, one step lighter, is 4.48 : 1: it fails AA for normal text but passes for large text.
Questions and answers
What counts as large text?
In WCAG, text of at least 18 point (24 CSS pixels), or 14 point (about 18.7 CSS pixels) when bold. Large text can get by with 3 : 1 for AA and 4.5 : 1 for AAA.
Why does 4.48 : 1 fail when it rounds to 4.5?
WCAG compares the exact ratio with the minimum, without rounding up. So this tool never rounds a ratio up to a minimum it doesn’t reach: 4.496 shows as 4.49.
What about see-through text colors?
A color with transparency is blended onto the background first, and the contrast is checked for the color you’d actually see.
Does passing guarantee the text is readable?
It’s the agreed minimum, not a guarantee: font weight, size and thin strokes matter too. When in doubt, aim higher than the minimum.
Link with pre-filled values
Add # and these parameters to the end of this page's address to open the tool with values already filled in.
| Parameter | What it sets |
|---|---|
fg | Text color, any CSS notation (write # as %23 in a link). |
bg | Background color. |
Example: https://toolabelle.com/contrast-checker/#fg=%23767676&bg=%23ffffff