Glossary of web design terms you should know

Create your website in 60 seconds with AI. Start for free!

Generate a website
Back to glossary

Contrast ratio

In web design, contrast ratio refers to the level of difference in brightness between two colors – typically between text and its background.  It's a fundamental aspect of how easy your website is to read and use.

Imagine trying to read light gray words on a white page – it's straining, right? That's low contrast. A good contrast ratio ensures that your text stands out clearly against its backdrop. This is especially crucial for people with visual impairments or color blindness, but honestly, everyone benefits from well-defined text.

The Web Content Accessibility Guidelines (WCAG) provide specific recommendations for minimum contrast levels to make sure your content is accessible to the widest possible audience.

Why contrast ratio matters in web design

Poor color contrast can make your website difficult – or even impossible – to read. Think light gray text on a white background, or dark blue text on a black section. A strong contrast ratio improves readability, keeps visitors engaged, and helps your site meet accessibility standards.

It’s not just about compliance. It’s also good design. A site with the right color contrast feels clearer, more modern, and more thoughtful.

How contrast ratio is calculated

Contrast ratio is measured as a number ranging from 1:1 (no contrast at all) to 21:1 (maximum contrast – black text on a white background). The calculation considers the luminance (brightness) of both foreground and background colors.

For example:

  • Black on white has a contrast ratio of 21:1.
  • Medium gray on white might be 5:1.
  • Yellow on white is very low, often below 2:1, and hard to read.

You can check your contrast ratios using free tools like the WAVE Web Accessibility Tool or Color Contrast Checker by WebAIM.

WCAG contrast ratio standards

The Web Content Accessibility Guidelines (WCAG) outline the following minimum contrast requirements:

  • Normal text (under 18pt bold or 24pt regular): 4.5:1 contrast ratio minimum (Level AA)
  • Large text (18pt bold or 24pt+): 3:1 contrast ratio minimum (Level AA)
  • Enhanced accessibility (AAA): 7:1 for normal text, 4.5:1 for large text

Meeting these standards ensures your site is usable by people with a wide range of visual abilities.

Examples of contrast ratio in action

  • Good example: Black text on a white background → 21:1 (very accessible)
  • Bad example: Light gray text on a white background → Often under 3:1 (hard to read)
  • Accessible color pair: Navy blue text on a light yellow background → 12:1 (high readability)

Design systems like Google’s Material Design and Apple’s Human Interface Guidelines also emphasize strong color contrast for clarity and accessibility.

How to improve your site’s contrast ratio

If your site fails contrast tests, here’s how to fix it:

  • Darken text colors – Use deeper shades of gray or black for body copy.
  • Lighten backgrounds – Avoid layering text over dark images or colorful gradients.
  • Use bold or larger fonts – Larger text has slightly more flexible contrast rules.
  • Test early and often – Run contrast checks during the design phase, not just at the end.

FAQs about contrast ratio

What’s a good contrast ratio for websites?

Aim for at least 4.5:1 for standard text and 3:1 for large text to meet accessibility standards. For maximum readability, go even higher when possible.

How do I check contrast ratio?

Use tools like WebAIM’s Contrast Checker by entering your foreground and background color codes. Many design tools like Figma and Sketch also have built-in contrast checkers.

Does contrast ratio affect SEO?

Indirectly, yes. A poor contrast ratio can lead to a bad user experience, higher bounce rates, and lower engagement – all of which may negatively impact SEO over time.

What’s the highest contrast ratio?

The maximum is 21:1, which is black on white (or vice versa). Anything below 3:1 is generally considered too low for readability.

Build an intuitive website with B12

With B12’s AI-powered builder, you can automatically generate an intuitive website that helps engage your visitors from the get-go. No need to worry about picking the right shade; our tools do the heavy lifting. Launch your professional site today!

Draft your site in 60 seconds

Get an AI website made specifically for you that's free to launch.

Start for free ✨

No credit card required

Draft your website in 60 seconds

In just a few clicks, build a website with all the features you need to thrive online

Get started for free

Product

Customers

Helpful information and tools

© 2025 B12. All rights reserved.
PrivacyTerms of Service