A contrast ratio of at least 4.5:1 between text and its background is required by WCAG 2.2 for normal text to be accessible to users with low vision or color blindness. This ratio ensures that text remains readable even in less-than-ideal viewing conditions, such as bright sunlight or low-resolution screens. The Web Content Accessibility Guidelines (WCAG) define specific contrast thresholds for different text sizes and weights: 4.5:1 for normal text, 3:1 for large text (18.66px and bold or 24px and regular), and higher ratios for enhanced compliance (AAA level). Meeting these standards is not just a best practice—it’s a legal requirement under laws like the Americans with Disabilities Act (ADA) and Section 508 of the Rehabilitation Act. For designers, developers, and content creators, manually calculating these ratios can be time-consuming and error-prone, especially when working with multiple color combinations or iterative design changes.

This is where a Color Contrast Checker becomes invaluable. Unlike manual methods, which require referencing complex formulas or relying on guesswork, this tool provides instant feedback on whether your color pair meets WCAG AA or AAA standards. You simply input the foreground (text) and background colors using a color picker or hex code, and the tool displays the contrast ratio along with clear pass/fail indicators. This eliminates the need for trial and error, allowing you to focus on refining your design while ensuring accessibility. Whether you’re designing a website, mobile app, or digital document, the tool helps you comply with accessibility standards without sacrificing creativity or efficiency.

how to check color contrast
how to check color contrast

Why Color Contrast Matters for Accessibility

Color contrast is a cornerstone of digital accessibility because it directly impacts how easily users can read and interact with content. Poor contrast—such as light gray text on a white background—can make text invisible to people with low vision, color blindness, or even those viewing a screen in bright light. According to the World Health Organization, approximately 2.2 billion people worldwide have a vision impairment, many of whom rely on high-contrast text to navigate digital content. Beyond vision impairments, low contrast can also affect users with cognitive disabilities, who may struggle to distinguish text from its background, leading to frustration and abandonment of the content.

WCAG 2.2 outlines specific contrast requirements to address these challenges. For normal text (under 18.66px or not bold), the minimum contrast ratio is 4.5:1 for AA compliance. Large text (18.66px and bold or 24px and regular) requires a ratio of 3:1. For AAA compliance, the standards are stricter: 7:1 for normal text and 4.5:1 for large text. These ratios are based on extensive research into readability and are widely adopted as the global standard for accessible design. Failure to meet these requirements can result in legal consequences, as accessibility lawsuits under the ADA and Section 508 have increased in recent years. For example, a 2023 report from ADA.gov highlighted that over 2,300 accessibility-related lawsuits were filed in federal courts in the U.S. alone, many of which cited poor color contrast as a violation.

Beyond legal compliance, high-contrast text improves the user experience for everyone. Studies by the Nielsen Norman Group found that users with perfect vision also benefit from better contrast, as it reduces eye strain and improves reading speed. For businesses, this translates to higher engagement, lower bounce rates, and increased conversions. For instance, a case study by WebAIM (webaim.org) showed that improving color contrast on an e-commerce site led to a 15% increase in time spent on the page and a 10% boost in sales. These benefits make color contrast not just an accessibility issue but a critical component of effective design.

How to Use the Color Contrast Checker Tool

  1. Open the Color Contrast Checker in your browser. The tool loads instantly and requires no installation or signup.
  2. Set the foreground (text) color. You can either:
    • Click the color picker and select a color from the visual palette, or
    • Type the hex code (e.g., #333333) directly into the input field.
  3. Set the background color using the same method—either the color picker or hex code input (e.g., #ffffff for white).
  4. View the contrast ratio displayed in real time. The tool automatically calculates the ratio and shows whether it passes WCAG AA or AAA standards.
  5. Adjust either color as needed. If the contrast ratio fails, tweak the foreground or background color until the tool indicates a pass. The live preview helps you see the changes instantly.
  6. Copy the hex codes or screenshot the results for your design files or accessibility documentation.

WCAG Contrast Ratio Requirements Explained

The contrast ratio is a numerical value that represents the difference in luminance between two colors. It ranges from 1:1 (no contrast, e.g., white on white) to 21:1 (maximum contrast, e.g., black on white). WCAG defines specific thresholds for different types of content to ensure readability. The table below summarizes these requirements:

Text Type WCAG AA Minimum Ratio WCAG AAA Minimum Ratio
Normal text (under 18.66px or not bold) 4.5:1 7:1
Large text (18.66px and bold or 24px and regular) 3:1 4.5:1
Graphical objects and user interface components (e.g., buttons, icons) 3:1 4.5:1

These ratios are calculated using a formula that accounts for the relative luminance of each color. The formula, defined by WCAG, is:

(L1 + 0.05) / (L2 + 0.05), where L1 is the luminance of the lighter color and L2 is the luminance of the darker color. For example, the contrast ratio between black (#000000) and white (#ffffff) is calculated as follows:

  • Luminance of white (L1) = 1.0
  • Luminance of black (L2) = 0.0
  • Contrast ratio = (1.0 + 0.05) / (0.0 + 0.05) = 1.05 / 0.05 = 21:1

While you don’t need to perform this calculation manually, understanding the formula helps explain why certain color combinations are more readable than others. For instance, dark gray text on a light gray background may look stylish but often fails to meet the 4.5:1 threshold, making it inaccessible to many users.

Testing Color Contrast in Different Design Tools

While the Color Contrast Checker is ideal for quick, browser-based testing, you may also need to verify contrast within design software like Adobe Photoshop, Figma, or Sketch. Here’s how to check color contrast in some of the most popular tools:

Adobe Photoshop

  1. Open your design file in Photoshop and select the text layer you want to test.
  2. Use the Eyedropper tool to sample the foreground (text) color. Note the hex code displayed in the Color Picker.
  3. Sample the background color using the same method.
  4. Open the Color Contrast Checker in your browser and input the hex codes for both colors.
  5. Review the contrast ratio and adjust the colors in Photoshop if needed.

Figma

  1. Select the text layer in your Figma design.
  2. Click the color swatch in the right-hand panel to view the hex code of the text color.
  3. Repeat for the background color.
  4. Paste both hex codes into the Color Contrast Checker to verify the ratio.
  5. Use Figma’s color adjustment tools to tweak the colors until they meet WCAG standards.

Sketch

  1. Select the text layer in Sketch and note the hex code in the color picker.
  2. Do the same for the background color.
  3. Input both hex codes into the Color Contrast Checker to check the contrast ratio.
  4. Adjust the colors in Sketch if the ratio fails to meet accessibility standards.

For developers working directly in code, you can also test contrast by inspecting elements in browser developer tools. Most modern browsers, like Chrome and Firefox, include accessibility audits that flag low-contrast text. However, these audits often require manual verification, making the Color Contrast Checker a faster and more reliable option for quick tests.

Common Color Combinations That Fail Contrast Tests

Some color combinations are notorious for failing WCAG contrast requirements, often due to trends in design or brand guidelines. Being aware of these pitfalls can help you avoid them in your projects. Below are examples of common color pairs that typically fail, along with suggestions for improving their contrast:

Color Combination Contrast Ratio WCAG AA Result Suggested Fix
Light gray (#aaaaaa) on white (#ffffff) 1.6:1 Fail Darken the gray to at least #767676 (4.5:1 ratio)
Dark gray (#333333) on light gray (#eeeeee) 3.2:1 Fail (for normal text) Use a darker background (#cccccc) or lighter text (#000000)
Red (#ff0000) on green (#00ff00) 1.1:1 Fail Avoid red-green combinations; use high-contrast alternatives like red on white or black on green
Blue (#0000ff) on black (#000000) 2.4:1 Fail Lighten the blue to #0066ff (7:1 ratio) or use a lighter background
Yellow (#ffff00) on white (#ffffff) 1.1:1 Fail Use a darker yellow (#cccc00) or add a black outline to the text

These examples highlight why it’s essential to test color combinations before finalizing a design. Even colors that appear distinct to some users may fail to meet accessibility standards. For instance, red and green are often used together in data visualizations or alerts, but they can be indistinguishable to users with red-green color blindness (protanopia or deuteranopia). The Color Contrast Checker can help you identify these issues early and explore alternative color schemes that maintain both aesthetics and accessibility.

If you’re working with a brand’s existing color palette, you may need to adjust the colors slightly to meet contrast requirements. For example, instead of using a brand’s primary blue (#0066cc) on a light gray background (#f5f5f5), you could darken the background to #e0e0e0 or use a lighter shade of blue (#3399ff) for text. These small tweaks can make a significant difference in readability without compromising the brand’s visual identity. For more tips on creating accessible color palettes, check out our guide on generating a color palette from any image in Illustrator.

Beyond Text: Contrast for UI Elements and Graphics

While text readability is the most common use case for color contrast checks, WCAG also applies to other elements of digital design, such as buttons, icons, and graphical objects. These components must also meet minimum contrast ratios to ensure they are perceivable by all users. For example, a button with low-contrast text or a border may be difficult to identify, leading to confusion or missed interactions. According to WCAG, graphical objects and user interface components must have a contrast ratio of at least 3:1 against their adjacent colors. This includes:

  • Buttons and form fields
  • Icons and symbols (e.g., hamburger menus, social media icons)
  • Charts and data visualizations
  • Focus indicators for interactive elements

To test these elements, use the same Color Contrast Checker tool. For instance, if you’re designing a button with a blue background (#0066cc) and white text (#ffffff), the contrast ratio is 6.1:1, which passes both AA and AAA standards. However, if the button’s border is a lighter shade of blue (#66ccff), the contrast ratio between the border and the background drops to 1.3:1, failing WCAG requirements. In this case, you might darken the border to #004499 to achieve a 3:1 ratio.

For data visualizations, such as charts or graphs, contrast is equally critical. Users with low vision or color blindness may struggle to distinguish between data points if the colors are too similar. For example, a pie chart using shades of green (#99cc99 and #669966) may have a contrast ratio of only 1.5:1, making it difficult to read. To improve accessibility, you could use a Color Palette Generator to create a palette with higher contrast, such as pairing #3366cc (blue) with #ff9900 (orange). This not only meets WCAG standards but also enhances clarity for all users.

Another often-overlooked aspect of contrast is focus indicators. These are the outlines or highlights that appear around interactive elements (e.g., links, buttons) when they are selected using a keyboard. WCAG requires focus indicators to have a contrast ratio of at least 3:1 against their background. For example, if your website’s background is white (#ffffff) and the default focus outline is light gray (#cccccc), the contrast ratio is only 1.6:1, which fails accessibility standards. To fix this, you could change the focus outline to a darker gray (#666666) or a high-contrast color like blue (#0066cc). Testing these elements with the Color Contrast Checker ensures your design is fully accessible.

If you're weighing options, How to Generate Gradient Color with CSS covers this in detail.

If you're weighing options, Create a Custom Color Palette from Any Image in Illustrator covers this in detail.