Color Contrast Checker

Calculate color contrast ratios according to WCAG 2.1 & 2.2 accessibility guidelines. Test foreground and background colors in HEX, RGB, or HSL with instant AA/AAA ratings, live UI previews, and smart suggestions. 100% private in-browser.

Loading Color Contrast Engine...

What is a WCAG Color Contrast Checker?

Overview and core technical concepts

A Color Contrast Checker calculates the luminosity contrast ratio between text foreground colors and background surface colors according to Web Content Accessibility Guidelines (WCAG 2.1) AA and AAA standards.

Calculates exact contrast ratio (e.g. 4.5:1, 7:1, 15:1)
Evaluates WCAG 2.1 AA & AAA compliance for Normal and Large text
Includes color blindness simulator and suggestion palette
100% Client-side visual testing

Why Test Color Contrast?

Key advantages, developer speedups, and security benefits

Web Accessibility (WCAG & ADA) Compliance

Ensure visually impaired users, elderly users, and users reading screens in bright sunlight can easily read content.

Pass Legal & Corporate Audits

Failing WCAG AA contrast (4.5:1 for body text) risks accessibility lawsuit non-compliance.

When Shouldn't You Check Color Contrast?

Anti-patterns, limitations, and when to choose an alternative approach

Decorative Background Graphics without Text

Non-text decorative elements and disabled UI buttons are exempt from strict 4.5:1 contrast requirements.

Contrast Ratio Score Example

Sample inputs, expected outputs, and code patterns

White Text on Dark Slate Background

Expected Output
Foreground: #FFFFFF | Background: #0F172A | Ratio: 15.8:1 (Passes AAA)

Common Color Contrast Mistakes

Frequent errors, security risks, and how to fix them

Using Low-Contrast Light Gray Body Text
The Mistake:Setting body text to `#94A3B8` on `#FFFFFF` background (Contrast: 2.4:1).
The Impact:Violates WCAG AA guidelines (minimum 4.5:1), making text unreadable for many users.
How to Fix:Darken body text color to at least `#475569` (Contrast: 7:1).

Frequently Asked Questions

Contrast ratio is calculated using the relative luminance formula defined by the Web Content Accessibility Guidelines (WCAG). Relative luminance (L) measures the relative brightness of any point in a color space, normalized to 0 for darkest black and 1 for lightest white. The contrast ratio is defined as (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 resulting ratio ranges from 1:1 (no contrast) to 21:1 (black on white).

WCAG Level AA is the standard legal baseline for web accessibility across most international laws and enterprise guidelines. It requires a contrast ratio of at least 4.5:1 for normal body text and 3:0 for large text or UI components. Level AAA represents enhanced accessibility, requiring at least 7.0:1 for normal text and 4.5:1 for large text. Designing for AAA provides maximum readability for users with low vision or color vision deficiencies.

Under WCAG 2.1 and 2.2 specifications, 'Large Text' is defined as text that is at least 18pt (24px) in regular weight or at least 14pt (18.66px) in bold weight. Because larger fonts are easier to read, WCAG allows a lower minimum contrast ratio of 3.0:1 for Level AA and 4.5:1 for Level AAA.

Yes, 100%. All calculations, color format parsing, luminance evaluation, and suggestion algorithms execute 100% client-side inside your browser using pure local JavaScript. No colors, user inputs, or analytical data are ever sent to ToolZeno servers.

When a chosen color pair fails WCAG AA or AAA requirements, our smart algorithm analyzes the color's HSLA profile. It iteratively adjusts the lightness (L) or brightness of the foreground or background color while preserving the original hue (H) as closely as possible, finding the nearest accessible color shade that meets 4.5:1 or 7.0:1 contrast.