UK web hosting · 24/7 live chat Black Friday + Cyber Monday: hosting + free domain £19.99 Open a ticket Client login

Guide

Website colour contrast: the ratios you need and how to check them

By Limitless Hosting · 5 min read · Updated 18 November 2026

For WCAG Level AA, normal text needs a contrast ratio of at least 4.5 to 1 against its background, and large text needs at least 3 to 1. Large text means about 24 pixels or 18.66 pixels if bold. You can check a pair of colours with a free contrast checker in seconds, and fixing low contrast is usually as simple as making the text darker.

See the plans

The basics

What contrast ratio means

Contrast ratio is a number that compares how bright two colours are. Black on white is 21 to 1, the maximum. Two identical colours are 1 to 1. The higher the number, the easier the text is to read, especially for people with low vision, people with colour vision differences, and anyone reading a screen in bright sunlight.

Low contrast is one of the most common accessibility failures on the web. Pale grey text on white, light text over photos and brand colours picked for looks rather than legibility are the usual causes.

The rules apply to text and also to important parts of the interface, such as the border of a form field or the icon on a button. Those need at least 3 to 1 against the colours around them.

The numbers

The contrast ratios for WCAG AA and AAA

WhatAA minimumAAA minimum
Normal text4.5 to 17 to 1
Large text (24 px, or 18.66 px bold)3 to 14.5 to 1
Icons, borders and focus outlines that carry meaning3 to 1Not set
Logos and purely decorative textNo minimumNo minimum

Aim for AA. Reaching AAA for all text is not required for whole sites.

Checking

How to test your colours

Pick the colours

Find the text colour and the background colour as hex codes, such as #555555 and #FFFFFF. Your theme settings or browser developer tools show them.

Use a free checker

Type both codes into a contrast checker such as the WebAIM Contrast Checker. It gives the ratio and tells you whether it passes AA and AAA.

Check the browser

Chrome and Firefox developer tools flag low contrast when you inspect an element, which saves guessing.

Test text on images

Text over a photo changes with the picture. Add a solid or semi-transparent panel behind it, or darken the image.

Check states

Test hover, focus and disabled states of buttons and links, not only the normal look.

Fixes

Easy ways to fix low contrast

Darken the text

Moving light grey text from #999999 to #595959 on white is enough to pass AA.

Keep your brand colour

Use a bright brand colour for large shapes and a darker shade of it for small text and links.

Do not rely on colour alone

Underline links and show errors with an icon and words as well as red, so colour-blind visitors can tell.

Limit light weights

Thin, light fonts need more contrast than bold ones. Use a regular weight for body text.

Offer a dark mode carefully

If you add one, check the contrast again, as colours that pass on white may fail on black.

Check after every redesign

New themes and plugins can undo your good work, so retest key pages after each change.

Worked example

A worked example: fixing a brand colour

Imagine a small business with a bright orange brand colour, #FF8A00. They use it for button backgrounds with white text, and for headings on a white page. A contrast checker shows white text on that orange is only about 2.2 to 1, and orange text on white is the same. Both fail.

The fix does not mean abandoning the brand. Use a darker shade of the same hue, such as #B45309, for text and for button backgrounds that carry white text. That darker orange gives a ratio above 4.5 to 1 against white, so it passes AA. Keep the bright orange for large decorative shapes, borders and illustrations, where the rules are looser.

You end up with a site that is still recognisably orange, but a visitor with low vision can read every word. Many brands do this: a bright primary colour for the look, and a deeper "text-safe" variant for anything that has to be read.

Common mistakes

Places contrast problems hide

Contrast failures are not only in body text. Look at the footer, where grey text on a dark background is often too faint. Check placeholder text in form fields, which is commonly a pale grey that fails. Check link colours inside paragraphs, which need to stand out from the surrounding text by more than colour alone.

Disabled buttons are exempt from the rules, but many sites mark buttons as disabled when they are not. If a button looks faded but still works, it needs enough contrast.

Text on photographs is the most unpredictable. A heading over a hero image may be fine on your desktop and unreadable on a phone where the crop differs. Add a darker overlay behind the text, or place the text on a solid panel.

Finally, test in both themes if your site offers light and dark modes, and test on a real phone outdoors if you can. Glare reduces effective contrast, so a ratio that only just passes indoors may fail in sunlight.

Before you publish

A contrast checklist

  • Body text passes 4.5 to 1 against its background
  • Large headings pass 3 to 1
  • Link text can be told apart from surrounding text
  • Button text and background pass the ratio
  • Form field borders pass 3 to 1
  • Placeholder text is dark enough to read
  • Text over images sits on an overlay or panel
  • Footer text on dark backgrounds has been checked
  • Errors use an icon and words as well as colour
  • Hover and focus states have been tested

Beyond the ratio

Contrast is not the whole story

A passing ratio does not guarantee comfortable reading. Very small text, thin fonts, tight line spacing and long lines all make text harder to read even when the colours pass. Use at least 16 pixels for body text, generous line height and a sensible line length.

Also think about the people the numbers miss. Some visitors with dyslexia or light sensitivity find pure black on pure white harsh. A very dark grey on off-white often reads better while still passing comfortably. Offer that option in your design from the start.

A fast, secure home for an accessible site

UK servers in London, free SSL and live chat open 24/7 on every plan, from 84p a month (£10.03 billed yearly).

See the plans

FAQ

Common questions

What contrast ratio does WCAG AA require?

4.5 to 1 for normal text and 3 to 1 for large text. Icons and form borders that carry meaning need 3 to 1.

What counts as large text?

About 24 pixels, or about 18.66 pixels if it is bold.

Does my logo have to pass?

No. Logos and purely decorative text are exempt, but your readable text still has to pass.

Is white text on a pink button accessible?

It depends on the exact colours. Test the pair with a checker. A mid-tone pink often fails with white text, while a darker shade passes.

Do I need to test every page?

Test your theme colours once, then check pages with images behind text or unusual colours.

Which free tools can I use?

The WebAIM Contrast Checker, the contrast checks in Chrome and Firefox developer tools, and the WAVE browser extension all work well. Use one to test your text and background pairs, note any that fail, and darken the text until the ratio passes. It takes minutes and needs no special skills.

Launch an accessible site on UK hosting

Free SSL and live chat on every plan, with a 15-day money-back guarantee.

See the plans .co.uk and .uk domains £9.99

From 84p a month, billed yearly
15-day money back
Get started