Color contrast checker
Pick a text color and a background color to see their contrast ratio and whether they pass WCAG AA and AAA. When they fail, get the closest color that passes.
Body text at 16 pixels, the size most of a page is read in. If this is hard to read, so is your page.
ButtonSmall print, 13 pxHow to check color contrast
- Enter the text color and the background color as HEX, RGB or HSL, or pick them with the color pickers.
- Read the ratio and the five checks: AA and AAA for normal text, AA and AAA for large text, and AA for buttons, icons and form borders.
- If a check fails, use the suggested color: the closest one, with the same hue, that passes.
WCAG contrast levels
| Check | Minimum ratio | Applies to |
|---|---|---|
| AA, normal text | 4.5 : 1 | Body text under 24 px (or under 18.66 px bold) |
| AA, large text | 3 : 1 | Text of 24 px and up, or 18.66 px bold and up |
| AAA, normal text | 7 : 1 | The stricter level for body text |
| AAA, large text | 4.5 : 1 | The stricter level for large text |
| AA, UI parts | 3 : 1 | Icons, input borders and focus rings |
Checking contrast on a real page
Text often sits on a gradient, a photo or a see-through layer, which makes its real background hard to know. The Design Toolkit inspector shows the contrast of any text against what is really behind it, with its WCAG level, when you hover it on the live page.
Check contrast on any live page. Hover any text with the Design Toolkit inspector to see its contrast against its real background, with the WCAG level. How it works
Questions
What is a good contrast ratio?
At least 4.5 : 1 for normal text and 3 : 1 for large text meets WCAG AA. 7 : 1 for normal text meets the stricter AAA level.
What counts as large text?
Text of 24 pixels and up, or bold text of about 18.66 pixels and up.
How do I fix a color that fails?
Use the suggested color. It keeps the same hue and changes only the lightness, just enough to pass.
Do buttons and icons need contrast too?
Yes. WCAG asks for 3 : 1 for the parts people need to see to use a page, such as icons, input borders and focus rings.