Color Contrast Checker
Check the contrast ratio between a text color and a background color against WCAG 2.2 AA and AAA. See what passes for normal text, large text and UI components, and get a fix.
Large text sample
Normal body text sample. The quick brown fox jumps over the lazy dog.
Button outline
| AA | Normal text (4.5:1) | |
|---|---|---|
| AA | Large text (3:1) | |
| AAA | Normal text (7:1) | |
| AAA | Large text (4.5:1) | |
| UI | Icons, borders and graphics (3:1) |
| AA (4.5:1) | | |
|---|---|---|
| AAA (7:1) | |
Only the lightness of the text color is changed, so it keeps the same hue.
Check Color Contrast for WCAG Accessibility
Text that is too light for its background is hard to read for many people, including those with low vision, color blindness or a phone screen in sunlight. This color contrast checker calculates the contrast ratio of any two colors and tells you whether they meet the WCAG 2.2 accessibility guidelines.
You see the result for normal text, large text and UI components at the AA and AAA levels, a live preview of your colors and, when a pair fails, the closest text color that passes. Transparent text colors are blended with the background first, just like on screen.
How to check color contrast
- Enter the text color and the background color as HEX, RGB, HSL or OKLCH, or pick them with the color squares.
- Read the contrast ratio, from 1:1 (no contrast) to 21:1 (black on white).
- Check the results for normal text, large text and UI components at the AA and AAA levels.
- Fix a failing pair by clicking Use next to a suggested text color, then copy the new code.
WCAG contrast requirements
| Content | Level AA | Level AAA | WCAG criterion |
|---|---|---|---|
| Normal text | 4.5:1 | 7:1 | 1.4.3 / 1.4.6 |
| Large text | 3:1 | 4.5:1 | 1.4.3 / 1.4.6 |
| UI components and graphics (icons, input borders, focus rings, chart lines) | 3:1 | – | 1.4.11 |
AA is the level most laws and accessibility policies require, including the European Accessibility Act and the ADA in the US, which refer to WCAG AA. Logos and purely decorative text are exempt.
What counts as large text?
WCAG defines large text as at least 18 point (24 px) in regular weight, or at least 14 point (about 18.66 px) in bold. Headings often qualify; body text, captions and labels usually do not. When in doubt, use the normal-text requirement.
How the contrast ratio is calculated
The contrast ratio compares the relative luminance (perceived brightness) of the two colors. Each RGB channel is converted to linear light, then luminance is L = 0.2126 × R + 0.7152 × G + 0.0722 × B. The ratio is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color.
Green contributes most to brightness and blue the least, which is why white text on blue usually passes while white text on green or yellow often fails. The ratio shown here is rounded down, so 4.499 is shown as 4.49 and fails, exactly as the guideline requires.
Contrast ratios of common color pairs
| Text | Background | Ratio | Normal text AA |
|---|---|---|---|
#111827 (near black) | #F9FAFB | 16.97:1 | Pass |
#000000 | #FFD700 (gold) | 14.97:1 | Pass |
#FFFFFF | #4F46E5 (indigo) | 6.28:1 | Pass |
#FFFFFF | #2563EB (blue) | 5.16:1 | Pass |
#6B7280 (gray 500) | #FFFFFF | 4.83:1 | Pass |
#767676 | #FFFFFF | 4.54:1 | Pass (lightest passing gray) |
#FFFFFF | #EF4444 (red) | 3.76:1 | Fail (large text only) |
#9CA3AF (gray 400) | #FFFFFF | 2.53:1 | Fail |
#FFFFFF | #10B981 (green) | 2.53:1 | Fail |
#FFFFFF | #F59E0B (amber) | 2.14:1 | Fail |
How to fix low contrast
- Darken the text or lighten the background (or the other way round on dark themes). The suggestions above change only lightness, so your brand hue stays the same.
- Make the text larger or bolder so the 3:1 large-text rule applies, for example for headings.
- Avoid light gray text for body copy. On white,
#767676is the lightest gray that passes AA. - Check every state: hover, focus, disabled-looking but active buttons, placeholders and text over images.
Frequently Asked Questions
Common questions about color contrast and WCAG.
At least 4.5:1 for normal text and 3:1 for large text and UI elements to meet WCAG AA. 7:1 or more meets the stricter AAA level.
4.5:1 for normal text, 3:1 for large text (24 px, or 18.66 px bold) and 3:1 for icons, input borders and other UI components.
Enter white as the text color and your brand color as the background. White on #4F46E5 (indigo) is 6.28:1 and passes AA; white on #10B981 (green) is 2.53:1 and fails.
It compares the relative luminance of the two colors: (lighter + 0.05) / (darker + 0.05). The result ranges from 1:1 to 21:1.
Yes. A transparent text color is blended with the background first, so the ratio matches what people see.
No. The contrast requirements (1.4.3, 1.4.6 and 1.4.11) are the same in WCAG 2.0, 2.1 and 2.2.
APCA is a newer contrast method being explored for the future WCAG 3. It is not a requirement yet, so laws and audits still use the WCAG 2 ratio shown here.
Yes. Paste the hex value of the Tailwind color, for example #6B7280 for gray-500 in Tailwind CSS v3. You can look up values in the Tailwind CSS color palette.