Legal

Color Contrast and WCAG: Complete Designer's Guide

Alexander Xrayd

Alexander Xrayd

Accessibility Expert

Read time

5 min

Published

Nov 20, 2025

Color swatches and design sketches

Poor contrast is the single most common accessibility failure on the web. According to WebAIM's annual analysis of a million websites, over 80% have contrast problems. That's an enormous number of users struggling to read text every day.

The problem is often that contrast is checked too late in the process. Designers choose colors based on aesthetics, developers implement them, and only at review is it discovered that white text on light green background doesn't work. By then it's expensive to redo.

In this guide, we cover exactly what WCAG requires, what exceptions exist, and how to build contrast thinking into your design process from the start.

The magic numbers (AA level)

WCAG defines contrast as the ratio between foreground and background color's relative luminance. A ratio of 1:1 means identical colors (no contrast), while 21:1 is maximum (black against white).

To meet legal requirements (WCAG 2.1/2.2 Level AA), the following applies:

Normal text: At least 4.5:1 against background
Large text: At least 3:1 – text that is 18pt (24px) or larger, or 14pt (18.5px) bold
Graphical objects and UI components: At least 3:1 (new in WCAG 2.1, criterion 1.4.11)

If you aim for AAA level (recommended for maximum readability), requirements increase to 7:1 for normal text and 4.5:1 for large text.

When contrast requirements DON'T apply

There are situations where contrast requirements aren't mandatory. Knowing these exceptions helps avoid unnecessary work:

1. Logos and brand text – Text that's part of a logo or brand name has no minimum requirement. Your company logo doesn't need to change.

2. Inactive elements – Buttons or form fields that are disabled and can't be interacted with are exempt. But be careful – don't overuse this!

3. Purely decorative text – Text that doesn't convey information, such as background patterns with repeated words.

4. Text in images containing other visual information – If an image shows a photo of a sign, and there's alt text describing the content, the text on the sign is exempt.

Important: Exceptions are narrow. If unsure, assume the requirement applies.

A common mistake: Placeholder text in forms is NOT exempt. It must also meet 4.5:1 – which often doesn't happen with standard gray.

Tools for testing contrast

There are many ways to check contrast. Here are the most used:

Design tools:

Stark (Figma/Sketch plugin) – Checks contrast directly in design software
Contrast (Figma plugin) – Free alternative with similar functionality

Web-based tools:

WebAIM Contrast Checker – Simple and reliable, enter two hex colors
Coolors Contrast Checker – Nice visualization and suggestions for adjustments

Automated scanners:

Xrayd – Scans entire site and finds all contrast problems
axe DevTools – Browser extension for manual testing
Lighthouse – Built into Chrome DevTools

Remember that automated tools miss contrast on images, gradient backgrounds, and dynamically generated content. Manual review is always needed as complement.

Practical tips for designers

1. Test early in process. Before presenting a design to client, run contrast through a tool. Takes 30 seconds and saves hours later.

2. Build color pairs, not individual colors. Define which combinations are allowed: 'Primary blue text on white background: OK. Primary blue text on light gray: NOT OK.'

3. Keep text off images. Text over photographs is almost always problematic because background varies. Place text on a solid surface instead.

4. Be extra careful with gray. Gray shades are tricky – they often look like they have sufficient contrast but rarely meet 4.5:1 against white. #767676 is the limit.

5. Document approved combinations. Create a contrast matrix in your design system showing which colors can be combined.

Contrast for graphical elements (WCAG 2.1)

WCAG 2.1 introduced criterion 1.4.11 requiring 3:1 contrast for graphical elements necessary to understand content. This includes:

Form fields – The border of a text field must be visible against background
Buttons – If button doesn't have clear background, border must have contrast
Icons – Icons that convey information (not just decoration)
Charts and graphs – Lines, bars, and data points must be visible
Focus indicators – Outline around focused element

A common miss: Minimalist forms with just an underline as field marker. If underline is light gray on white background, it's barely visible.

Test your site's accessibility

Free scan, no signup required

WCAG 2.1 AA check
2-minute scan
Actionable report

Frequently Asked Questions

Do contrast requirements apply to hover states?+
Yes, text and interactive elements must have sufficient contrast in all states: default, hover, focus, and active. It's common for hover states to have worse contrast than default.
Do I need to change my brand color if it doesn't meet contrast?+
Not necessarily. You can use the color differently: as background with dark text, as accent on large areas, or in a slightly darker variant for interactive elements.

Related Articles

View all
Person working with tablet and color swatches on desk
Guides4 min

Creating Accessible Text Colors: Design System Guide

Read article
Computer screen with code and checklist
Tech5 min

The Ultimate WCAG 2.2 Checklist for Developers (AA & AAA)

Read article
Person using laptop with accessible interface
Guides6 min

What is Web Accessibility? Complete Beginner's Guide

Read article
Screen showing SEO analysis and graphs
Tips4 min

Web Accessibility and SEO: How They Work Together

Read article