👁️

Contrast Ratio Checker

Test color combinations for WCAG accessibility compliance.

🎨 Choose Colors
Large Text Preview
This is how normal body text will look with your chosen color combination. Good contrast ensures readability for all users, including those with visual impairments.
21:1
Contrast Ratio
✅ WCAG Compliance Results
AA
Normal Text
Requires 4.5:1
AA
Large Text
Requires 3:1
AAA
Normal Text
Requires 7:1
AAA
Large Text
Requires 4.5:1
Text Luminance
0.000
Background Luminance
1.000
Text RGB
rgb(0, 0, 0)
Background RGB
rgb(255, 255, 255)

📖 Complete Guide to Color Contrast and Web Accessibility

Color contrast is a fundamental aspect of web accessibility that directly impacts whether users can read and interact with your content. Poor contrast makes text difficult or impossible to read for millions of people with visual impairments, and it affects everyone in certain conditions like bright sunlight or on poorly calibrated screens. This contrast ratio checker helps you ensure your color combinations meet accessibility standards and create a better experience for all users.

Understanding Contrast Ratio

Contrast ratio is a numerical measurement of the difference in perceived luminance between two colors. The ratio ranges from 1:1 (no contrast, such as white on white) to 21:1 (maximum contrast, black on white). The number represents how many times lighter the lighter color is compared to the darker color.

The calculation involves converting RGB color values to relative luminance using a formula that accounts for how human eyes perceive different wavelengths of light. Green light appears brighter to us than red light of the same intensity, which in turn appears brighter than blue. The formula weights these contributions accordingly: luminance equals 0.2126 times the red component plus 0.7152 times the green component plus 0.0722 times the blue component, after gamma correction.

Once you have the luminance values for both colors, the contrast ratio is calculated as the luminance of the lighter color plus 0.05, divided by the luminance of the darker color plus 0.05. The 0.05 values prevent division by zero when one color is pure black. This formula is defined in the Web Content Accessibility Guidelines (WCAG) and is the international standard for measuring color contrast accessibility.

WCAG Accessibility Standards Explained

The Web Content Accessibility Guidelines, developed by the World Wide Web Consortium (W3C), define three levels of conformance: A (minimum), AA (standard), and AAA (enhanced). Most accessibility laws and corporate policies require WCAG 2.1 Level AA compliance, making it the practical target for most websites.

WCAG Level AA Requirements

Level AA requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text. Normal text is defined as anything smaller than 18 points (24 pixels) or smaller than 14 points (18.66 pixels) when bold. Large text is 18 points or larger, or 14 points or larger when bold.

These thresholds were determined through research on readability for people with moderately low vision, defined as 20/40 visual acuity. At 4.5:1 contrast, users with this level of vision impairment can read text without assistive technology. The lower requirement for large text accounts for the increased legibility that comes with larger character sizes.

WCAG Level AAA Requirements

Level AAA raises the bar to 7:1 for normal text and 4.5:1 for large text. This level accommodates users with more significant visual impairments, approximately 20/80 visual acuity. While AAA is not required by most regulations, achieving it when possible provides an even better experience for users with visual difficulties.

Meeting AAA standards can be challenging for designs that rely on subtle color palettes or brand colors that do not provide sufficient contrast. In these cases, prioritize AAA compliance for body text and critical interface elements while accepting AA for less crucial text.

Legal Requirements for Accessibility

Web accessibility is not just good practice—it is increasingly a legal requirement. In the United States, the Americans with Disabilities Act (ADA) has been interpreted by courts to apply to websites, particularly for businesses that serve the public. Thousands of accessibility lawsuits are filed annually, with inadequate color contrast being a common complaint.

The European Union's Web Accessibility Directive requires public sector websites to meet WCAG 2.1 Level AA. Similar laws exist in Canada (Accessible Canada Act), the United Kingdom (Equality Act), Australia (Disability Discrimination Act), and many other countries. Organizations that operate internationally must comply with the strictest applicable requirements.

Beyond legal compliance, accessible design often improves usability for everyone and can positively impact search engine optimization. Google considers page experience factors in its ranking algorithms, and accessible sites tend to be more usable and better structured overall.

Common Contrast Problems and Solutions

Light Gray Text on White Backgrounds

One of the most common accessibility failures is using light gray text on white backgrounds. While this aesthetic choice might look elegant to some designers, gray text below about 595959 hex fails the 4.5:1 contrast requirement against white. Either darken the text to at least 767676 (which achieves exactly 4.5:1) or slightly tint the background to increase contrast.

Colored Text on Colored Backgrounds

Brand colors often create contrast problems when used together. A blue heading on a purple background, or orange text on yellow, might seem visually distinct but often fails contrast requirements. Always test brand color combinations with a contrast checker before using them for text.

Text Over Images

Text overlaid on photographs or background images presents unique challenges because the contrast varies across the image. Solutions include adding a semi-transparent overlay behind the text, using a solid-color text box, adding a text shadow, or ensuring the image has a consistently dark or light region where text will appear.

Placeholder Text in Form Fields

Form field placeholders often use light gray text to appear less prominent than user-entered text. However, placeholders must still meet contrast requirements because they convey important information about what to enter. Consider using labels outside the field instead of relying on placeholder text, or ensure your placeholder color meets at least 4.5:1 contrast.

Designing for Different Types of Vision

Color contrast requirements exist primarily to help people with low vision, but they also benefit users with color blindness, older adults experiencing age-related vision changes, and anyone viewing screens in suboptimal conditions.

Low vision affects approximately 246 million people globally. It includes conditions like macular degeneration, glaucoma, and diabetic retinopathy that reduce visual acuity or create blind spots. High contrast helps these users perceive text boundaries and distinguish characters.

Color blindness affects about 8% of men and 0.5% of women, primarily causing difficulty distinguishing red from green. While color blindness is technically about hue perception rather than contrast, ensuring sufficient luminance contrast means your design works even if users cannot perceive the color difference.

Age-related vision changes affect virtually everyone eventually. The lens yellows with age, reducing blue light perception. Contrast sensitivity decreases. Adaptation to changing light levels slows. Designing for older users by providing high contrast benefits a growing portion of the population as demographics shift.

Tools and Techniques for Maintaining Accessibility

Build Accessibility into Your Design System

Rather than checking contrast ad-hoc, define accessible color combinations in your design system or style guide. Create approved pairings for headings, body text, links, and buttons against each background color. This prevents accessibility failures before they reach implementation.

Test Throughout Development

Use browser developer tools with accessibility inspectors, automated testing tools like Axe or WAVE, and manual checking with tools like this contrast checker. Different tools catch different issues, so using multiple approaches provides the best coverage.

Consider Dark Mode

If your site offers a dark mode, test contrast in both modes. Colors that work well on white backgrounds may fail against dark backgrounds and vice versa. Pure white text on pure black backgrounds (21:1 contrast) can actually cause eye strain for some users—consider using off-white on off-black for dark mode instead.

Beyond Contrast: Comprehensive Accessible Design

While contrast is crucial, it is just one aspect of accessible design. Never use color as the only means of conveying information—add icons, patterns, or text labels. Ensure interactive elements have visible focus states. Provide sufficient text size and allow users to resize text. Consider reduced motion preferences for animations.

Accessibility benefits everyone. The curb cuts originally designed for wheelchair users help parents with strollers, travelers with luggage, and delivery workers with carts. Similarly, accessible web design creates better experiences for all users while ensuring no one is excluded from your content.