Colour contrast for websites: ratios, tools and quick fixes

What the 4.5:1 and 3:1 contrast ratios mean, how to test them, and how to fix low-contrast text without a redesign.

Low contrast is the most common issue automated scans find. Light grey text, pastel buttons and text over photos are hard to read for people with low vision, older visitors, and anyone looking at a phone in sunlight.

The numbers

How to test

Use a contrast checker (WebAIM's is free): paste the text colour and background colour. Browser developer tools also show the ratio when you inspect text. For text on photos, test against the lightest part of the image behind the text.

Quick fixes

.hero { position: relative; }
.hero::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.hero > * { position: relative; }

Don't forget

Placeholder text, disabled-looking links, footer text and cookie banners are frequent offenders.

Related guides

All guides

This guide is general technical information, not legal advice. Following it does not certify ADA or any legal compliance. Automated checks find only part of accessibility barriers.

Check your own site

Run a free homepage snapshot to see your top 3 issues in about a minute, or order the $149 Fix-Pack for up to 10 pages with copy-paste fixes for your platform.

Get my free snapshot