Color Contrast Checker

Enter foreground/background colors → get WCAG accessibility compliance info.

WCAG Color Contrast Checker

Sample Text Preview The quick brown fox jumps over the lazy dog. This shows how your color combination looks in different text sizes.

Contrast Ratio

21:1

Normal Text

WCAG AA PASS
WCAG AAA PASS

Large Text

WCAG AA PASS
WCAG AAA PASS

WCAG Requirements

Normal Text:

  • • AA: 4.5:1 minimum
  • • AAA: 7:1 minimum

Large Text (18pt+ or 14pt+ bold):

  • • AA: 3:1 minimum
  • • AAA: 4.5:1 minimum

What is color contrast?

Color contrast refers to the difference in light between font (or anything in the foreground) and its background. In web accessibility, color contrast is a measure of the difference in perceived brightness between two colors. This difference is expressed as a ratio ranging from 1:1 (no contrast, same color) to 21:1 (maximum contrast, black on white or vice versa).

The Web Content Accessibility Guidelines (WCAG) define specific contrast ratios to ensure text is readable for users with visual impairments, including color blindness and low vision conditions. Proper color contrast ensures that content is perceivable by the widest possible audience.

Why is color contrast important for accessibility?

Color contrast is crucial for web accessibility for several important reasons:

  • Visual Impairments: Approximately 285 million people worldwide have visual impairments. Sufficient contrast helps users with low vision, cataracts, or age-related vision loss read content more easily.
  • Color Blindness: About 8% of men and 0.5% of women have some form of color blindness. Good contrast ratios ensure content remains readable regardless of color perception differences.
  • Environmental Factors: Users may view content on devices in bright sunlight, on low-quality screens, or with glare, all of which reduce perceived contrast.
  • Cognitive Load: Better contrast reduces eye strain and cognitive load for all users, making content easier to read and understand.
  • Legal Compliance: Many countries require websites to meet WCAG standards, making proper contrast a legal requirement for public and commercial websites.

How can I ensure proper color contrast in my designs?

Follow these best practices to ensure your designs meet color contrast requirements:

  • Test Early and Often: Use this color contrast checker tool during the design phase, not after implementation. Test all text and important visual elements against their backgrounds.
  • Follow WCAG Guidelines: Aim for WCAG AA compliance at minimum (4.5:1 for normal text, 3:1 for large text). Consider AAA compliance (7:1 and 4.5:1 respectively) for critical content.
  • Don't Rely on Color Alone: Use additional indicators like underlines for links, icons, or text labels to convey information.
  • Test with Real Users: Conduct usability testing with users who have visual impairments to validate your contrast choices.
  • Consider Different States: Check contrast for all interactive states (hover, focus, active, disabled) and ensure they all meet requirements.
  • Use Design Systems: Create a color palette with pre-tested combinations that meet contrast requirements to ensure consistency across your project.

What are WCAG contrast ratio requirements?

The Web Content Accessibility Guidelines (WCAG) 2.1 define specific contrast ratio requirements for different levels of compliance:

Level AA (Minimum Compliance)

  • Normal Text: Minimum contrast ratio of 4.5:1
  • Large Text: Minimum contrast ratio of 3:1
  • Graphics & UI Components: Minimum contrast ratio of 3:1

Level AAA (Enhanced Compliance)

  • Normal Text: Minimum contrast ratio of 7:1
  • Large Text: Minimum contrast ratio of 4.5:1

Note: Large text is defined as 18pt (24px) or larger for regular weight, or 14pt (18.5px) or larger for bold weight. Level AAA is not required for entire websites but is recommended for critical content.

How is the contrast ratio calculated?

The contrast ratio is calculated using the relative luminance of the two colors according to the WCAG formula:

Contrast Ratio = (L1 + 0.05) / (L2 + 0.05)

Where L1 is the relative luminance of the lighter color and L2 is the relative luminance of the darker color.

The relative luminance is calculated by:

  1. Converting RGB values to sRGB (values between 0 and 1)
  2. Applying gamma correction to each channel
  3. Calculating weighted sum: 0.2126 * R + 0.7152 * G + 0.0722 * B

This tool automatically performs these calculations for you, instantly showing whether your color combinations meet WCAG standards for both normal and large text sizes.

What tools can help with color contrast testing?

Several tools and techniques can help you test and ensure proper color contrast:

  • This Color Contrast Checker: Use our free tool above to test any color combination instantly against WCAG standards.
  • Browser DevTools: Chrome and Firefox DevTools include built-in contrast ratio checkers in their color pickers.
  • Design Software Plugins: Figma, Sketch, and Adobe XD have plugins like Stark or Able that check contrast ratios during design.
  • Automated Testing: Tools like axe DevTools, WAVE, or Lighthouse can scan entire pages for contrast issues.
  • Manual Testing: Use browser extensions like WCAG Color Contrast Checker or Colour Contrast Analyser (CCA) for on-page testing.
  • Screen Readers: Test with actual assistive technologies to understand the real user experience.

Remember to test contrast in different contexts: on various devices, under different lighting conditions, and with different display settings to ensure accessibility for all users.