Home › Developer & Design › Color Contrast Checker
Color Contrast Checker
See whether your text colour is readable on its background.
Large sample heading
This is how normal sized text looks with these colours.
How to check two colours
- Enter hex codes or use the colour pickers.
- Look at the sample text.
- Read the ratio and the pass or fail results.
Understanding the ratio
The ratio runs from 1:1, for identical colours, to 21:1 for black on white. It uses the relative brightness of the colours as defined in the Web Content Accessibility Guidelines (WCAG).
Minimum ratios
| Level | Normal text | Large text |
|---|---|---|
| AA | 4.5:1 | 3:1 |
| AAA | 7:1 | 4.5:1 |
Large text generally means at least 18 point (about 24 pixels), or 14 point (about 18.7 pixels) when bold. The tool rounds the displayed ratio down, so a borderline pair is not shown as higher than it is.
Improving a weak pair
Darken the darker colour or lighten the lighter one. Changing only the hue often has little effect. Light grey text on white is a frequent problem.
Beyond the numbers
- Check links, buttons, placeholder text and disabled states.
- Do not use colour alone to show errors or status.
- Test text over photographs at its weakest point.
- Try the design on a phone in bright light.
Example
Black on white gives the maximum 21:1. A mid grey such as #777777 on white is just under 4.5:1, so it fails Level AA for normal text although it passes for large text. Darkening it slightly to #767676 reaches the AA threshold. Small differences like this are why measuring is more dependable than judging by eye.
Why contrast matters
Text that is hard to read excludes people: those with low vision, older readers, anyone using a phone in bright sunlight. Good contrast is also good design, as pages are quicker to scan. The Web Content Accessibility Guidelines (WCAG) set minimum contrast ratios between text and background colours.
The usual targets
- Normal text: a ratio of at least 4.5 to 1 for level AA.
- Large text (about 18 point, or 14 point bold, and above): at least 3 to 1.
- Level AAA asks for 7 to 1 for normal text and 4.5 to 1 for large text.
- User interface parts, such as input borders and icons that carry meaning: at least 3 to 1.
Fixing a failing pair
Darken the text or lighten the background until the ratio passes. Light grey text on white is a common failure. A small change to the lightness often fixes it without changing the brand colour much.
Do not rely on colour alone
Red and green are hard to tell apart for people with colour-blindness. Show errors with an icon or text as well as colour, and underline links inside paragraphs.
Our guide colour contrast and readable design explains these ideas with examples. A passing ratio is a strong start, but real testing with real users is better still.
Frequently Asked Questions
Does passing make a website accessible?
No. Contrast is one requirement among many.
Can I enter short codes?
Yes. #fff is read as #ffffff. Transparent colours are not supported.
What contrast ratio should I aim for?
For normal text, aim for at least 4.5 to 1. For large text, at least 3 to 1.
Does passing the checker guarantee accessibility?
No. Contrast is one part of accessibility, alongside font size, layout, keyboard use and clear language.
How do I check text over an image?
Test against the lightest and darkest parts of the picture behind the text, or add a solid or semi-transparent panel behind the words.