♿ Color Contrast Checker

Contrast Ratio
4.58:1

Preview Heading

This is how your text will look with these colors.

Small text example — The quick brown fox jumps over the lazy dog.

Understanding Color Contrast Accessibility

Color contrast is a fundamental aspect of web accessibility that determines how easily text and visual elements can be distinguished from their background. The Web Content Accessibility Guidelines (WCAG) define specific contrast ratio requirements that websites must meet to be considered accessible. These ratios are calculated using the relative luminance of both the foreground and background colors, taking into account how human eyes perceive different color wavelengths. A contrast ratio of 1:1 means both colors are identical, while 21:1 represents the maximum contrast between pure black and pure #1a1d2e. Meeting these standards is not just about compliance — it directly impacts the user experience for millions of people with visual impairments, color blindness, or those viewing screens in bright environments like sunlight. Studies consistently show that proper contrast improves readability and comprehension for all users, not just those with disabilities.

How to Use This Tool

Step 1: input Your Colors

Begin by entering the foreground (text) and background colors you want to test. You can input colors in multiple formats including HEX codes (like #1a1a2e), RGB values (rgb(26, 26, 46)), or HSL notation (hsl(240, 28%, 14%)). The tool also supports color picker inputs, allowing you to visually select colors from a palette. If you are testing an existing website, you can use browser developer tools to extract the exact color values being used. Enter the text color as the foreground and the element's background color as the background value. The tool will immediately calculate and display the contrast ratio between your chosen colors as soon as both values are provided, giving you instant feedback on your color combination's accessibility compliance.

Step 2: Review the Contrast Ratio

After entering both colors, the tool displays the calculated contrast ratio and a clear pass/fail indicator for each WCAG compliance level. WCAG 2.1 defines four main levels: AA Normal Text requires a minimum 4.5:1 ratio, AA Large Text (18px bold or 24px regular) requires 3:1, AAA Normal Text requires 7:1, and AAA Large Text requires 4.5:1. The tool shows which levels your color combination passes and which it fails, along with a visual preview showing how the text actually looks against the background. This visual preview is particularly valuable because numbers alone cannot convey the actual readability experience. You can also see how the combination looks to users with different types of color vision deficiencies such as protanopia, deuteranopia, and tritanopia.

Step 3: Adjust and Optimize

If your color combination does not meet the desired accessibility level, use the tool's adjustment features to find a compliant alternative. You can darken the text color or lighten the background color to increase contrast while maintaining your overall design aesthetic. The tool provides real-time ratio updates as you adjust colors, making it easy to find the perfect balance between accessibility and visual design. Many designers find that slightly adjusting the lightness value of one color while keeping the hue consistent provides the best results. Once you find a compliant combination, copy the color values and apply them to your CSS. Remember to test all text colors in your design system, including secondary text, placeholder text, and text on colored backgrounds or within cards and buttons.

Frequently Asked Questions

What is the difference between WCAG AA and AAA standards?

WCAG AA is the widely adopted minimum standard for web accessibility and is legally required for many government and public sector websites under regulations like Section 508 and the European Accessibility Act. AA requires a 4.5:1 contrast ratio for normal text and 3:1 for large text. AAA represents the highest level of accessibility compliance with stricter requirements of 7:1 for normal text and 4.5:1 for large text. While AAA provides the best user experience for people with visual impairments, it is often difficult to achieve with certain brand colors and design systems. Most organizations target AA compliance as their baseline, with AAA compliance applied to critical content like body text and navigation elements. The choice between levels should consider your audience, legal requirements, and design flexibility.

Do contrast ratios apply to icons and UI components?

Yes, the WCAG contrast requirements apply to all meaningful visual elements, not just text. Icons that convey important information, form fields without visible borders, focus indicators, and interactive component states like hover and active all need to meet contrast requirements. The WCAG 2.1 Success Criterion 1.4.11 specifically addresses non-text contrast, requiring a 3:1 ratio for user interface components and graphical objects. This means that icons used as navigation indicators, status symbols, and button boundaries must have sufficient contrast against their backgrounds. For decorative elements that do not convey information, contrast requirements do not apply. However, it is good practice to ensure all visual elements maintain reasonable visibility for a cohesive and inclusive user experience across all lighting conditions and display types.

How does color blindness affect contrast requirements?

Color blindness affects approximately 8% of men and 0.5% of women worldwide, making it essential to consider when designing accessible interfaces. Different types of color vision deficiency affect how users perceive different color wavelengths — red-green color blindness (protanopia and deuteranopia) is the most common, followed by blue-yellow (tritanopia) and complete color blindness (achromatopsia). Importantly, contrast ratios are calculated using luminance values that simulate how the human eye perceives brightness, which means high-contrast combinations generally remain readable even for users with color vision deficiencies. However, relying solely on color to convey information (like red for errors) is problematic — always pair color with additional visual cues such as icons, text labels, or patterns. This tool helps you verify that your designs remain accessible regardless of the user's color perception capabilities.