Home › Guides › Digital skills guides
Color Contrast Explained: Making Text Readable
What contrast ratios mean, the WCAG pass levels for text and interface elements, worked examples and practical design tips.
Pale grey text on a white background may look elegant on a designer's monitor, but for many readers it is hard or impossible to read. Contrast ratios give a simple, objective way to check whether your colours work.
What is a contrast ratio?
A contrast ratio compares the brightness of two colours, such as text and its background. It is written from 1:1 (no difference, for example white on white) to 21:1 (the maximum, black on white).
The calculation in brief
Each colour is converted to a value called relative luminance, which weights red, green and blue by how bright they appear to the human eye (green counts most, blue least). The ratio is then:
(lighter luminance + 0.05) ÷ (darker luminance + 0.05)
You do not need to do this by hand, but it shows why two colours that look different in hue can still have poor contrast.
The WCAG targets
The Web Content Accessibility Guidelines (WCAG) set minimum ratios:
| Content | Level AA | Level AAA |
|---|---|---|
| Normal text | 4.5:1 | 7:1 |
| Large text | 3:1 | 4.5:1 |
| Interface parts such as buttons and form borders | 3:1 | – |
Large text means at least 24 px (18 pt), or at least about 18.66 px (14 pt) when bold. Most legal accessibility requirements point to level AA.
Worked examples
- Black (#000000) on white: 21:1, passes everything.
- Grey #767676 on white: about 4.54:1, just passes AA for normal text.
- Grey #777777 on white: about 4.48:1, narrowly fails AA for normal text.
- Light grey #AAAAAA on white: roughly 2.3:1, fails.
Notice how a tiny change in a grey value crosses the pass line. That is why checking with a tool is better than judging by eye.
Practical design tips
- Check every text colour, including placeholder text, captions and links.
- Do not rely on colour alone to convey meaning. Add an icon, underline or label, because some people cannot distinguish certain colours.
- Test states, such as hover, focus, disabled and error messages.
- Check both light and dark themes if your site has them.
- Be careful with text over images. Add a solid or semi-transparent layer behind the text, then measure the contrast against it.
- Avoid very thin fonts in light colours, since thin strokes lower the effective contrast.
Who benefits?
People with low vision or colour blindness benefit most, but good contrast also helps everyone reading in bright sunlight, on a dim screen or when tired.
Where to learn more
The official guidance is published by the World Wide Web Consortium at w3.org/TR/WCAG21.
Our contrast checker calculates the ratio, shows pass or fail for each level and previews your text on the background, all inside your browser.
Common brand colors measured against white
These ratios were calculated with the WCAG formula. They show how often popular "bright" colors fail for body text and how a darker shade of the same hue fixes it.
| Color on white | Contrast ratio | Normal text (AA) |
|---|---|---|
| Bright blue #3b82f6 | 3.68:1 | Fail (large text only) |
| Deeper blue #1d4ed8 | 6.70:1 | Pass |
| Amber #f59e0b | 2.15:1 | Fail |
| Dark amber #b45309 | 5.02:1 | Pass |
| Sky blue #0ea5e9 | 2.77:1 | Fail |
| Dark sky blue #0369a1 | 5.93:1 | Pass |
| Green #22c55e | 2.28:1 | Fail |
| Dark green #15803d | 5.02:1 | Pass |
| Red #ef4444 | 3.76:1 | Fail (large text only) |
| Dark red #b91c1c | 6.47:1 | Pass |
How to fix a failing color
Keep the same hue and make the color darker for text on a light background, or lighter on a dark background. Changing lightness, not hue, preserves the feel of your brand while meeting the ratio. Bright colors can still be used for large headings, icons and decoration where the lower 3:1 threshold applies, as long as the meaning is not carried by color alone.
A simple testing workflow
- List the text and background colors in your design.
- Check each pair with a contrast tool.
- Fix failures by adjusting lightness.
- Re-check hover, focus, disabled and error states.
- Test again in dark mode and on a real phone outdoors.
Frequently asked questions
Is a 4.5:1 ratio a legal requirement?
Many accessibility laws and procurement rules refer to WCAG 2.x level AA, which includes 4.5:1 for normal text. Check the rules that apply to your country and sector.
Do logos need to meet contrast ratios?
Text that is part of a logo or brand name is exempt from the minimum contrast requirement, but the rest of your page is not.
Does decorative text have to pass?
Purely decorative content and inactive controls are exempt. If the text carries information or can be used, it should meet the ratio.