Color Contrast Checker (WCAG AA/AAA)
Enter a text color and a background color to get their WCAG contrast ratio and see which accessibility levels they pass. If they fail, you'll get the nearest passing text color with the same hue.
Large heading text
Normal body text is checked against the stricter 4.5:1 rule. The quick brown fox jumps over the lazy dog.
Small print, captions and labels.
Button outlineContrast ratio
4.83:1
Good
Pass
WCAG AA · Normal text
needs 4.5:1
Pass
WCAG AA · Large text
needs 3:1
Fail
WCAG AAA · Normal text
needs 7:1
Pass
WCAG AAA · Large text
needs 4.5:1
Pass
WCAG AA · UI components & graphics
needs 3:1
Suggested text colors (same hue)
#525866
7.10:1 · passes AAA
Make sure everyone can read your text
Light grey text on white, white text on a pastel button, a subtle placeholder in a form field — low-contrast color choices are among the most common accessibility problems on the web. They make content hard to read for people with low vision or color blindness, for older users, and for anyone looking at a phone in bright sunlight. The Web Content Accessibility Guidelines (WCAG) set minimum contrast ratios, and many laws and procurement rules reference them. This checker tells you in a second whether a color pair passes.
How to check contrast
- Enter the text color and the background color — HEX, RGB and HSL all work — or use the color pickers.
- Read the contrast ratio and the live preview with large text, body text, small print and a button outline.
- Check the pass/fail result for each WCAG level.
- If a check fails, click “Use” on a suggested color to switch to the nearest passing shade with the same hue.
- Use Swap to test the reverse combination, such as light text on a dark background.
WCAG contrast requirements
| Content | Level AA | Level AAA |
|---|---|---|
| Normal text | 4.5:1 | 7:1 |
| Large text (24px, or 18.66px bold) | 3:1 | 4.5:1 |
| UI components and graphics | 3:1 | — |
Level AA is the standard most organizations aim for and the level referenced by most accessibility regulations. AAA is stricter and useful for long-form reading. The UI component rule (WCAG success criterion 1.4.11) covers things like input borders, focus indicators, icons and chart lines that people need to see to use a page.
How the ratio is calculated
WCAG compares the relative luminance of the two colors — how bright they appear, weighted for the eye’s sensitivity to red, green and blue. The ratio is (L1 + 0.05) ÷ (L2 + 0.05), where L1 is the lighter color. It ranges from 1:1 for identical colors to 21:1 for black on white. Because thresholds are strict, this tool rounds the ratio down, so a pair that measures 4.499:1 is correctly shown as failing 4.5:1. Semi-transparent text colors are blended with the background first.
Fixing a failing color pair
You rarely need to abandon a brand color. Usually a slightly darker text shade on light backgrounds, or a lighter one on dark backgrounds, is enough. The suggestions keep your color’s hue and change only its lightness, in small steps, until it passes AA or AAA — choosing whichever direction needs the smaller change.
Build an accessible palette with the Tailwind Color Shades Generator, convert colors between formats with the Color Converter, or pull colors from a photo with the Color Palette from Image tool.
Frequently asked questions
What contrast ratio does WCAG require?
WCAG 2.2 Level AA requires at least 4.5:1 for normal text and 3:1 for large text and for user interface components and graphics. Level AAA requires 7:1 for normal text and 4.5:1 for large text.
What counts as large text?
Text that's at least 18 point (usually 24px) regular, or at least 14 point (about 18.66px) bold.
How is the contrast ratio calculated?
Each color's relative luminance is calculated from its red, green and blue values, then the ratio is (lighter + 0.05) ÷ (darker + 0.05). It ranges from 1:1 (identical colors) to 21:1 (black on white).
Why is the ratio rounded down?
WCAG thresholds are strict, so a ratio of 4.499 doesn't pass 4.5:1. Rounding down avoids showing a pass for a color pair that technically fails.
How do the suggested colors work?
The tool keeps your text color's hue and saturation and makes it lighter or darker, in small steps, until it reaches 4.5:1 (AA) or 7:1 (AAA) — whichever direction needs the smaller change.
Related tools
Tailwind Color Shades Generator
Turn one brand color into a full 50–950 Tailwind palette and export the config.
Color Converter
Convert colors between HEX, RGB, HSL, HSV and CMYK, with shades and opacity.
Color Palette from Image
Extract 3–10 dominant colors from any image and export them as CSS variables.