Home › Blog › Color Contrast and Readable Design: A Simple Guide to Accessible Text

Color Contrast and Readable Design: A Simple Guide to Accessible Text

Have you ever tried to read a phone screen in bright sunlight, or squinted at pale grey text on a white page? That is a contrast problem, and many readers face it every day. People with low vision or colour blindness, older readers and anyone on a poor screen all benefit when text is clearly visible. Good contrast makes a website easier for everyone.

What is contrast ratio?

Contrast ratio compares the brightness of two colours, usually text and its background. It ranges from 1 to 1 (no difference, for example white on white) to 21 to 1 (black on white). The calculation uses the relative luminance of each colour, as defined by the Web Content Accessibility Guidelines (WCAG).

WCAG targets

ContentLevel AALevel AAA
Normal text4.5 to 17 to 1
Large text (about 18 pt, or 14 pt bold)3 to 14.5 to 1
Interface parts such as input borders and icons3 to 1Not applicable

Level AA is the usual target for websites and is often required by accessibility rules and policies.

Examples

  • Black on white is 21 to 1.
  • Medium grey #767676 on white is about 4.54 to 1, just passing AA for normal text.
  • Slightly lighter grey #777777 on white is about 4.48 to 1, just failing.
  • Blue #2563eb on white is about 5.17 to 1.
  • Light grey-blue #94a3b8 on white is about 2.56 to 1, which fails for body text.

Common problems and fixes

Light grey text

Placeholder text, captions and footers are often set in pale grey that looks elegant but is hard to read. Darken it until it passes 4.5 to 1.

White text on bright colours

White on yellow, light green or orange often fails. Use dark text on bright backgrounds, or darken the background.

Text over photographs

Contrast varies across a picture. Put the text on a solid or semi-transparent panel, or darken the image under the text.

Buttons and links

Make sure button text and the button's outline can be seen against the page. Links inside paragraphs should not rely on colour alone; underline them.

Do not rely on colour alone

About 1 in 12 men and 1 in 200 women have some form of colour vision deficiency, and red and green are often hard to tell apart. Show errors with text or an icon, not only red. In charts, use patterns or labels as well as colours.

Other readability factors

  • Use a comfortable font size, with body text around 16 pixels or more.
  • Choose sufficient line spacing, about 1.5 times the font size.
  • Keep lines of text from becoming too long, roughly 60 to 80 characters.
  • Test the page in bright light and on a small screen.

Dark mode is not automatically accessible

Dark themes need contrast checks too. Pure white on pure black can be uncomfortable for some people, and dark grey with off-white text is often easier. Check the ratio.

Frequently asked questions

Does passing the checker make my site accessible?

No. Contrast is one part. Accessibility also includes keyboard navigation, alt text, headings, labels and clear language.

Do logos need to meet contrast rules?

Logos and decorative text are generally exempt, but legibility is still good design.

Try it yourself

Enter your text and background colours in the free Color Contrast Checker to see the ratio and whether it passes.