In this article
What contrast ratio means
Contrast ratio compares the brightness (relative luminance) of two colours, from 1:1 (identical) to 21:1 (black on white). The Web Content Accessibility Guidelines (WCAG) set minimums so text is readable for people with low vision, and comfortable for everyone else, especially outdoors on phones.
The targets
| Content | Level AA | Level AAA |
|---|---|---|
| Normal text | 4.5 : 1 | 7 : 1 |
| Large text (18 pt / 24 px, or 14 pt / about 18.7 px bold) | 3 : 1 | 4.5 : 1 |
| Icons, input borders, button outlines | 3 : 1 | – |
AA is the level most organisations and many laws aim for.
Check a colour
- Open the Color Converter and enter a colour in HEX, RGB or HSL.
- See its contrast ratio with white and with black.
- Look at the row of lighter and darker shades and pick one that meets the target.
- Copy the values as HEX, RGB, HSL, HSV or CMYK.
Fixing a brand colour that fails
Many bright brand colours, orange, yellow, light green, sky blue, do not reach 4.5:1 with white text. You do not need to change the brand. Use:
- the original colour for large elements (big buttons, headings, backgrounds behind dark text),
- a darker shade of the same hue for small text and links,
- dark text instead of white on light brand colours.
Keeping the hue and changing only lightness, easy in HSL, preserves the brand feel.
Common contrast mistakes
- Grey placeholder text in forms that people mistake for filled-in values.
- Text on photos, add a dark overlay or a solid band behind the text.
- Colour alone to show meaning, like red for errors, add an icon or words for colour-blind users.
- Dark mode afterthoughts, check contrast in both themes.
Colour formats in brief
HEX and RGB describe colours for screens; HSL is easiest for creating variations; HSV or HSB is what many design apps show; CMYK describes ink for printing. Screen-to-print conversion is approximate, printers use colour profiles, so ask for a proof for important print jobs.
Testing with real people and devices
Numbers are a guide, not the whole story. Look at your pages on a cheap phone outdoors, with screen brightness low, and ask someone older or with glasses to read them. Browser developer tools can also simulate colour blindness, useful for checking charts and status colours.
Building a small palette
From one brand colour, pick: a dark shade for text and links, the brand colour for buttons, a very light tint for backgrounds and highlights, and neutral greys. Store them as CSS variables so the whole site stays consistent. To get the exact colour from a logo, use the Image Color Picker; for the tab icon, match it in the Favicon Generator.
Frequently asked questions
What contrast ratio is recommended?
WCAG asks for at least 4.5 to 1 for normal text and 3 to 1 for large text.
Is light grey text on white readable?
Often not. Many light greys fail contrast checks.
Does contrast matter on phones?
Yes. Screens outdoors and in bright light make low contrast text harder to read.
How do I check contrast?
Enter text and background colours into a contrast checker.
Does contrast affect SEO?
Indirectly. Readable pages keep visitors longer and support accessibility.
What contrast ratio is required for accessibility
WCAG level AA asks for 4.5 to 1 for normal text and 3 to 1 for large text. Level AAA asks for 7 to 1 and 4.5 to 1.
Is pure black on white best
It passes easily, but many designers use a very dark grey to soften glare. Either is fine as long as the ratio stays high.