Contrast Ratio Calculator (WCAG)

This tool calculates the contrast ratio between two colors to check WCAG compliance for digital business assets. E-commerce sellers, marketers, and entrepreneurs can use it to ensure website text, buttons, and ads meet accessibility standards. It helps avoid accessibility-related fines and improves user experience for all customers.

Contrast Ratio Calculator (WCAG) 🎨

Enter 3 or 6 digit hex codes, with or without # (e.g. #FFF or #FFFFFF)

Contrast Ratio Results

Contrast Ratio
WCAG AA Normal Text
WCAG AA Large Text
WCAG AAA Normal Text
WCAG AAA Large Text

How to Use This Tool

Follow these steps to check color contrast compliance for your business’s digital assets:

  • Enter the foreground (text/element) hex color in the first input field, or use the placeholder values as a starting point.
  • Enter the background hex color in the second input field.
  • Select the text size (normal or large) and font weight (normal or bold) that matches your design specs.
  • Click the Calculate Contrast Ratio button to generate results.
  • Review the detailed compliance breakdown and visual ratio indicator.
  • Use the Copy Results button to save the output for your design documentation or accessibility audit.
  • Click Reset to clear all fields and start a new check.

Formula and Logic

This tool uses the WCAG 2.1 defined formula to calculate contrast ratio between two colors:

  1. Convert both hex colors to RGB values, then calculate their relative luminance using the sRGB color space formula.
  2. Relative luminance is calculated as: 0.2126 * R + 0.7152 * G + 0.0722 * B, where R, G, B are linearized RGB values (adjusted for gamma correction).
  3. Contrast ratio 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.

WCAG compliance thresholds used are:

  • AA Normal Text (≤ 16px / 12pt): 4.5:1 minimum
  • AA Large Text (> 16px / 12pt or bold ≥ 14pt): 3:1 minimum
  • AAA Normal Text: 7:1 minimum
  • AAA Large Text: 4.5:1 minimum

Practical Notes

For business and e-commerce teams, keep these real-world considerations in mind when using this tool:

  • Accessibility non-compliance can lead to fines under ADA (Americans with Disabilities Act) or equivalent local regulations, especially for e-commerce sites serving public customers.
  • Use high-contrast ratios for call-to-action buttons, checkout flows, and error messages to improve conversion rates for visually impaired users.
  • Marketing emails and digital ads must also meet WCAG standards to avoid being flagged as inaccessible by email clients or ad platforms.
  • When designing for mobile, test contrast ratios at smaller screen sizes where text may appear smaller than intended.
  • Save contrast ratio reports for client projects or internal design system documentation to streamline future accessibility audits.

Why This Tool Is Useful

Small business owners, e-commerce sellers, and marketing teams benefit from this tool in several ways:

  • Avoids costly legal penalties related to digital accessibility non-compliance, which can range from $5,000 to $100,000+ per violation in the US.
  • Improves user experience for the 1 in 4 adults in the US living with a disability, expanding your potential customer base.
  • Ensures brand consistency by documenting compliant color palettes for websites, apps, and marketing materials.
  • Speeds up accessibility audits for client projects, reducing time spent on manual contrast checks.
  • Integrates into existing design workflows to validate color choices before development starts.

Frequently Asked Questions

What is a good contrast ratio for e-commerce product pages?

For product descriptions and prices (normal text), aim for at least 4.5:1 to meet WCAG AA standards. For large product titles or promotional banners, 3:1 is sufficient for AA compliance. AAA standards (7:1 for normal text) are recommended for critical checkout flow text to minimize errors.

Do I need to check contrast ratios for my marketing emails?

Yes, most email clients (Gmail, Outlook, Apple Mail) prioritize accessible emails in inboxes, and non-compliant emails may be flagged as spam. A 4.5:1 contrast ratio for body text ensures readability across all devices and email clients.

Can I use this tool for my business’s mobile app design?

Absolutely. Mobile apps are subject to the same WCAG accessibility standards as websites in most jurisdictions. Test all text elements, buttons, and form fields in your app design using this tool to ensure compliance before submitting to app stores.

Additional Guidance

For ongoing accessibility compliance, adopt these best practices for your business:

  • Create a brand style guide that lists pre-approved compliant color combinations to reduce repeated contrast checks.
  • Train your design and marketing teams on WCAG standards to catch accessibility issues early in the design process.
  • Schedule quarterly accessibility audits for your website and digital assets to catch new issues from design updates.
  • Use this tool to validate third-party design assets (e.g., freelance graphic designs, ad creatives) before publishing.