Color Contrast Checker

Pick foreground and background colors, see WCAG 2.1 contrast ratio in real-time. Check AA/AAA pass or fail for normal and large text. Free and instant.

WCAG 2.1Real-TimeAA + AAALive Preview

Heading Text

Body text sample at 16px. Check if you can read this comfortably without strain.

Small text at 12px — typically needs higher contrast ratio. Sample link

14.48
: 1 contrast ratioExcellent
3:14.5:17:1
AA Pass
Normal Text
AA Pass
Large Text
AAA Pass
Normal Text
AAA Pass
Large Text
AA Pass
UI Components (icons, borders)
Default Dark
#E2E8F0 / #0F172A
High Contrast
#000000 / #FFFFFF
Sky on White
#0284C7 / #FFFFFF
Warning
#92400E / #FEF3C7
Low Contrast
#94A3B8 / #E2E8F0
Green on Dark
#22C55E / #0A0A0A
// Relative Luminance
L = 0.2126R + 0.7152G + 0.0722B
// Contrast Ratio
CR = (L1 + 0.05) / (L2 + 0.05)
FG luminance: 0.8017
BG luminance: 0.0088
(0.8017 + 0.05) / (0.0088 + 0.05)
= 14.48 : 1

Each color channel (R, G, B) is linearized from sRGB before computing luminance. The ratio ranges from 1:1 (identical) to 21:1 (black/white).

LevelMinimum
AA Normal
Body text, paragraphs
4.5:1
AA Large
18pt+ or 14pt+ bold
3:1
AAA Normal
Enhanced readability
7:1
AAA Large
Enhanced for large text
4.5:1
AA UI
Icons, borders, controls
3:1

* Large text = 18pt+ regular, or 14pt+ bold (approx. 24px / 18.66px).


What Is Color Contrast Ratio?

Color contrast ratio is a quantitative measurement of the perceived brightness difference between two colors. As defined by the WCAG (Web Content Accessibility Guidelines) 2.1 specification published by the W3C, the ratio is calculated using the formula (L1 + 0.05) / (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 is that of the darker color. The result ranges from 1:1 (identical colors) to 21:1 (pure black on pure white).

This ratio is critical for web accessibility. If the contrast is too low, users — especially those with low vision, elderly users, or anyone viewing screens in bright sunlight — cannot read the content. This is not merely a design preference; it is a legal requirement in many countries under disability discrimination laws like the ADA (US), EN 301 549 (EU), and the Equality Act (UK).

WCAG AA vs AAA Conformance Levels

WCAG 2.1 defines two primary conformance levels for contrast:

  • AA Requires a minimum ratio of 4.5:1 for normal-sized text (under 18pt or 14pt bold) and 3:1 for large text (18pt+ regular or 14pt+ bold). This is the minimum level required by most organizations and legal frameworks.
  • AAA Requires a minimum ratio of 7:1 for normal text and 4.5:1 for large text. This is the enhanced standard, especially important for medical, government, and educational websites — where readability must be guaranteed for all audiences.

Additionally, WCAG 2.1 requires a 3:1 ratio for non-text UI components such as icons, borders, and interactive controls (buttons, checkboxes, input fields). This rule applies to both default and interactive states (hover, focus).

How Relative Luminance Is Calculated

The process begins by converting sRGB values (0-255) to linear values. Each color channel (R, G, B) is divided by 255, then the inverse gamma function is applied: if the value is less than or equal to 0.04045, divide by 12.92; otherwise apply the formula ((value + 0.055) / 1.055) ^ 2.4.

After linearization, relative luminance is calculated using the weighted formula: L = 0.2126 * R + 0.7152 * G + 0.0722 * B. These coefficients reflect how the human eye perceives color — it is most sensitive to green, then red, and least sensitive to blue.

L = 0.2126R + 0.7152G + 0.0722B

Why Color Accessibility Matters

According to the World Health Organization (WHO), approximately 2.2 billion people worldwide have some form of vision impairment. About 8% of men and 0.5% of women experience color blindness — totaling over 300 million people globally. When web design fails to meet contrast standards, you inadvertently exclude a significant portion of your audience.

Beyond disabilities, poor contrast affects all users in many situations: using a phone in bright sunlight, viewing content on an old monitor with reduced brightness, or simply experiencing eye fatigue after a long workday. Good contrast design does not only help people with disabilities — it improves the experience for everyone.

How to Use This Contrast Checker

  • Step 1: Pick foreground color Enter a hex code (e.g., #E2E8F0) or click the color swatch to open your browser's color picker.
  • Step 2: Pick background color Similarly, enter a hex code or use the color picker for the background.
  • Step 3: Read the results The contrast ratio and pass/fail status for AA and AAA levels update instantly. Check both normal and large text results.
  • Step 4: Preview The text preview shows your chosen colors at multiple sizes for visual evaluation.
  • Step 5: Copy results Click the copy button to get results as text, useful for reports or sharing with your design team.

Design Tips for Good Contrast

  • Don't rely on color alone Use additional cues like icons, underlines, or bold weight to convey information. Especially important for colorblind users.
  • Test dark mode separately Many websites only check contrast in light mode. Make sure your dark mode palette also meets WCAG standards.
  • Be careful with text over images Text over images or gradients often has inconsistent contrast. Use a semi-transparent overlay or text shadow to ensure readability.
  • Aim for AAA whenever possible While AA is the minimum requirement, achieving AAA for body content significantly improves the reading experience for all users.
  • Check interactive states Buttons, links, and input fields need to meet the 3:1 standard for default, hover, focus, and disabled states.

Contrast Checking in Your Design Workflow

Contrast checking should be integrated into your design process, not treated as a final audit step. Ideally, verify contrast ratios when selecting your color palette — before designing interfaces. Many modern design systems like Material Design, Chakra UI, and Tailwind CSS ship with palettes that already meet WCAG AA standards.

During development, use automated accessibility testing tools like axe-core, Lighthouse, or pa11y in your CI/CD pipeline to catch contrast issues early. However, automated tools cannot catch everything — you still need manual testing for text over images, gradients, and dynamic components.

Color Contrast Checker Questions

About Calculators

Calculator tools cover everything from body metrics (BMI, calorie needs, macros) to financial planning (loan payments, compound interest, retirement savings) to everyday math (percentages, tip calculation, fuel economy). Each calculator implements the standard formula from a recognized body — WHO for BMI, IRS for tax brackets, the compounding formula A = P(1+r/n)^nt for interest — so you get the same answer as a textbook example.

Why it matters

Financial calculators in particular can save or cost you meaningful money. A compound interest calculator showing the difference between 5% and 7% annual returns over 30 years is the most motivating financial lesson most people ever see. A loan calculator revealing the true total cost of a 30-year mortgage versus 15-year stops many people from over-committing. The math doesn't change, but seeing it specifically for YOUR numbers is what makes it stick.

Privacy and safety

No calculator on ZestLab collects your financial or health data. Numbers you enter stay in your browser session and are cleared when you close the tab. We do not log, save, or analyze inputs. This is why none of our calculators require an account — they don't need one to work correctly.

Best practices

  • For BMI, remember the formula treats muscle mass the same as fat — athletes often show 'overweight' without being unhealthy
  • Compound interest math assumes consistent returns — real markets have volatility, so treat results as ceiling not guarantee
  • Run loan calculators at BOTH your ideal rate and 2% higher to stress-test affordability against rate rises
  • Tip calculators default to the payer's region convention (US 18-20%, EU 5-10%) — override if you know local custom