Design

Colour Contrast Explained for Readable Text

What colour contrast ratios mean, the WCAG AA and AAA targets, how to test your colours, and practical fixes for low-contrast text on websites, slides and documents.

Light grey text on a white background looks elegant on a designer's bright monitor. On a phone in sunlight, or for someone with weaker eyesight, it can be impossible to read. Colour contrast is the difference in brightness between text and its background, and it is one of the simplest ways to make a website, a presentation or a document usable by more people. This article explains what contrast ratios mean, what targets to aim for, and how to fix common problems.

Why contrast matters

Many people read text in difficult conditions: small screens, glare, dim rooms, tired eyes. Millions of people also have low vision or colour-vision differences. Low-contrast text makes all of them work harder, and many will simply leave. Good contrast helps everyone read faster and with less strain. It also helps with search and sales, because a page that people can read is a page they stay on.

What a contrast ratio is

A contrast ratio compares the brightness of two colours and gives a number from 1 to 1 (identical colours) up to 21 to 1 (black on white). The calculation uses a measure called relative luminance, which reflects how bright a colour looks to the human eye. You do not need to do the maths by hand. A checker such as the free Colour Contrast Checker gives the ratio and tells you whether it passes.

The WCAG targets

The Web Content Accessibility Guidelines, or WCAG, set the commonly used standards. In their 2.2 version, the main text rules are:

  • Level AA, normal text: at least 4.5 to 1.
  • Level AA, large text: at least 3 to 1. Large means about 24 pixels or 18.66 pixels in bold, roughly 18 point or 14 point bold.
  • Level AAA, normal text: at least 7 to 1.
  • Level AAA, large text: at least 4.5 to 1.
  • User interface parts and graphics that carry meaning, such as an input border or an icon: at least 3 to 1 against what is next to them.

Level AA is the usual goal for websites and the level most organisations aim for. AAA is stricter and suits long reading material or audiences with low vision.

Test your colours step by step

  1. Open the Colour Contrast Checker.
  2. Enter the text colour and the background colour, as HEX codes or with the picker. If you do not know the codes, the Colour Picker can take a colour from an image or your screen and show it in HEX, RGB and HSL.
  3. Read the ratio and the pass or fail marks for AA and AAA, for normal and large text.
  4. Look at the live preview and judge it yourself, since numbers and your eyes should agree.
  5. If it fails, use the suggested colour, or darken the text or lighten the background until it passes.

A worked example

A popular choice for body text is a mid-grey. The HEX code #767676 on a white background has a ratio of about 4.54 to 1, which just meets the AA requirement for normal text. A slightly lighter grey, #777777, gives about 4.48 and technically fails. The difference is almost invisible, yet it moves from pass to fail. Now consider a brand colour: white text on a bright orange button might give around 2.9 to 1, which fails even for large text. Darkening the orange a few steps, or switching to dark text on the orange, brings the ratio over the line. The checker lets you try the changes and see the effect immediately.

Common contrast problems and fixes

  • Light grey placeholder and caption text. Darken it until it reaches 4.5 to 1.
  • Text on images. Add a solid or semi-transparent overlay behind the text, or move the text to a plain area.
  • Coloured buttons. Check the label against the button colour and the button against the page background.
  • Links in body text. Make them distinguishable from the text by more than colour alone, for example by underlining.
  • Charts. Do not rely on colour alone to separate lines or bars. Add labels, patterns or direct annotations.
  • Dark mode. Test both modes. A palette that passes on white can fail on dark backgrounds.

Colour is not the only signal

About one in twelve men and a smaller share of women have some form of colour-vision difference. Red and green are often confused. Do not use colour alone to show meaning, for example a red error and a green success with no icon or text. Add words, icons or patterns so the message survives without colour.

Contrast beyond websites

The same ideas apply to slides, posters, spreadsheets and printed documents. Projectors wash colours out, so use darker text and stronger contrast in presentations. For printed materials, light colours may print paler than they appear on a screen. If you save images for the web, our guide to image formats will help you keep text in graphics sharp.

Practical habits

  • Choose a palette with contrast in mind before you design.
  • Keep a short list of approved colour pairs for text and backgrounds.
  • Check each new colour pair when it is added, not at the end.
  • Use a minimum body text size of about 16 pixels on web pages.
  • Test on a phone outdoors and with brightness turned down.

What contrast checkers cannot tell you

A passing ratio does not guarantee that text is comfortable. Thin fonts, tight spacing and long lines also hurt readability. Treat the ratio as a floor, not a finish line, and read your design on a real device.

Summary

  • Aim for at least 4.5 to 1 for normal text and 3 to 1 for large text.
  • Check interface parts and icons at 3 to 1.
  • Do not rely on colour alone to carry meaning.
  • Test your palette in light and dark modes.

Check your colours in seconds with the free Colour Contrast Checker.

Keep reading

Productivity

JPG vs PNG vs WebP: Which Format to Use?

The real differences between JPG, PNG and WebP, when each one is the best choice, and how to convert between them without wasting quality or file size.

4 min read