Free, independent guides since 2010

Accessibility

Colour contrast and accessible use of colour

How to meet colour contrast requirements: WCAG contrast ratios for text and interface elements, testing tools, brand colours that fail, not relying on colour alone, and dark mode.

<guide section="Accessibility" type="article" read="1 min"/>

Low contrast is one of the most common accessibility problems on the web – light grey text on white is everywhere. It affects people with low vision, colour vision deficiencies and anyone reading in sunlight. See choosing a colour palette for the design side.

The requirements (WCAG AA)

ElementMinimum contrast
Normal text4.5:1
Large text3:1
Icons and graphical objects needed to understand content3:1
Borders of form fields and buttons, focus indicators3:1 against adjacent colours
Logos and decorative elementsNo requirement

Testing

  • Our free contrast checker.
  • Browser developer tools show contrast ratios when inspecting text.
  • Automated tools flag low contrast across pages (see testing tools).
  • Test text on images and gradients at the worst point.

Do not rely on colour alone

ProblemBetter
Required fields only in redAdd “(required)” or an icon with a text alternative
Links only distinguished by colourUnderline links in body text
Chart lines in red and greenAdd labels, patterns or markers
Error state only a red borderAdd an error message text

States and themes

Check hover, focus, disabled and visited states, and repeat everything for dark mode. Respect user settings such as forced colours (Windows high contrast) by using real borders and outlines rather than background tricks.

Frequently asked questions

What counts as large text?

Roughly 18 point (24 CSS pixels) regular text, or 14 point (about 18.7 CSS pixels) bold text and larger.

My brand colour fails contrast – what now?

Use it for large elements and backgrounds with dark or white text that passes, and create a darker or lighter shade of the brand colour for small text and links.