WCAG Color Contrast & Hex Solver

Good design isn't just about how it looks—it's about who can use it. When text and background colors are too similar, millions of people with low vision or color blindness can't read your content. This tool helps you meet international accessibility standards by checking your contrast ratios and instantly calculating the exact color shifts needed to make your site readable for everyone.

Preview

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

Normal body (AA 4.5:1) · Bold/Large sample (AA 3.0:1)

Valid hex code (e.g., #FFFFFF or FFFFFF)

Valid hex code (e.g., #FFFFFF or FFFFFF)

Contrast ratio

12.63 : 1

AA — Normal text

≥ 4.5

Pass

AA — Large text

≥ 3

Pass

AAA — Normal text

≥ 7

Pass

AAA — Large text

≥ 4.5

Pass

Note: This calculator uses the official, legally enforceable WCAG 2.2 relative luminance algorithm. While future standards (WCAG 3.0 / APCA) are in draft, 2.2 remains the strict mathematical baseline required to pass current accessibility audits.

The Compliance Standard Matrix

Baseline contrast requirements under WCAG 2.2 guidelines for different text types.

Text TypeAA RequirementAAA RequirementUse Case
Normal Text4.5 : 17.0 : 1Body copy, articles
Large Text3.0 : 14.5 : 1Headers (18pt+ or 14pt bold)
UI Components3.0 : 1N/AIcons, form borders, buttons
LogotypesExemptExemptBrand identities and marks

Principle 1: Cognitive Load & Legibility

High contrast is not just for the visually impaired. It reduces "Cognitive Load" for all users, making it easier to scan information quickly in bright sunlight or on low-quality mobile displays.

Principle 2: Regulatory Compliance

Accessibility is increasingly a legal requirement. Standards like WCAG 2.2 are the basis for the Americans with Disabilities Act (ADA) and the European Accessibility Act, protecting your brand from significant legal liability.

Principle 3: The Luminance Delta

Accessibility is calculated via "Relative Luminance"—a mathematical measurement of the brightness of a color. Our solver identifies the smallest possible shift in luminance to reach compliance while preserving your brand's hue.

Automated Contrast Remediation

Fixing Contrast Without the Guesswork

Finding the exact hex code to pass an accessibility audit often turns into a frustrating loop: tweaking a color picker, copying the new hex, testing the contrast, and hoping it passes.

This solver eliminates that manual trial and error. When a color pairing fails, the math engine automatically calculates the exact visual shift required. It provides immediate, mathematically verified replacement hex codes so you can fix contrast issues instantly and get back to building.

Understanding AA vs. AAA Standards

Accessibility is not subjective; it is governed by strict mathematical ratios based on relative luminance. The Web Content Accessibility Guidelines (WCAG) 2.2 dictate two primary tiers of compliance:

  • AA Compliance (The Baseline): Requires a contrast ratio of at least 4.5:1 for normal text, and 3.0:1 for large text (18pt, or 14pt bold). This is the legal and functional baseline for most modern web applications.
  • AAA Compliance (The Gold Standard): Requires a stricter contrast ratio of at least 7.0:1 for normal text, and 4.5:1 for large text. This tier is typically required for specialized government, medical, or educational platforms.
CR=L1+0.05L2+0.05CR = \frac{L_1 + 0.05}{L_2 + 0.05}L=0.2126R+0.7152G+0.0722BL = 0.2126R + 0.7152G + 0.0722B

How the Solver Works

When a color pairing falls short of WCAG standards, the engine preserves the core identity of your design. It locks in your original hue and saturation, then mathematically nudges the brightness up or down. The exact moment the contrast hits the required 4.5:1 or 7.0:1 target, it captures that hex code and hands it back to you.

Goal: Reach Target WCAG Ratio
Step 1: Lock the original color's hue and saturation
Step 2: Adjust the brightness step-by-step
Step 3: Stop at the exact passing threshold
Result: A perfectly compliant replacement hex code

Web & Network Insights & Resources

Explore the algorithms, protocols, and computational concepts behind modern digital infrastructure.

Web & Network

What's the Difference Between a Wi-Fi Extender, a Mesh Kit, and a Longer Ethernet Cable?

A Wi-Fi extender is an extra box that sends your current Wi-Fi farther. A mesh kit is several boxes that cover the house as one network. A longer Ethernet cable is a wire from the router. This guide shows how they differ.

Read Article
Web & Network

How to Ping IndexNow Automatically with Vercel and GitHub Actions

Ping IndexNow automatically after you ship on Vercel. GitHub Actions sends only the pages you just changed. You do not paste a list. If your site is not on Vercel and GitHub, the idea still holds. The steps will not.

Read Article
Web & Network

Cross-Origin Resource Sharing (CORS): The Browser's Permission Slip Between Sites

CORS means Cross-Origin Resource Sharing. It’s how browsers decide whether a page on one site can read a response from another. Learn what “origin” means, why you see CORS errors, how to spot them, and what actually has to change.

Read Article
Computer & OSWeb & Network

How to Tell What Wi-Fi You're On—and Whether to Upgrade

See what Wi-Fi version your Windows laptop is using, why that label can mislead, and how to tell if you need a better router—or a faster computer.

Read Article
Web & Network

AI Tokens Aren't Words — They're the Meter

How AI tokenization turns text into billable units, why chat context windows fill up and “forget,” and how input vs. output tokens change what you pay—explained in plain English.

Read Article
Web & NetworkFinance

What Software Technical Debt Costs in Developer Hours (And Why It Grows Over Time)

Software technical debt is the ongoing developer time a web or app codebase needs for fixes, updates, and upkeep. Learn how those hours add up over time, why the load can increase year to year, and how to model the cost for your team.

Read Article

This calculator/tool is for illustrative purposes only. Because web and network environments vary significantly, Definitive Calc is not liable for deployment issues, unexpected costs, or system errors. Always independently verify results before production use.