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.
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
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
Foreground: #FFFFFF | Background: #0F172A | Ratio: 15.8:1 (Passes AAA)Common Color Contrast Mistakes
Frequent errors, security risks, and how to fix them
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.
Related Tools
HEX ↔ RGB Converter
Convert color codes instantly between HEX, HEX with Alpha, RGB, RGBA, HSL, and CMYK formats. Features live visual previews, color channel breakdown, copyable CSS snippets, and history. 100% free & client-side.
RGB ↔ HSL Converter
Convert colors instantly between RGB, RGBA, HSL, and HSLA formats online. Features live visual previews, interactive channel sliders, copyable CSS declarations, and history. 100% free & client-side.
RGB ↔ CMYK Converter
Convert colours instantly between RGB, RGBA, and CMYK formats online. Features live visual previews, print ink channel sliders, copyable CSS declarations, and print guidance. 100% free & client-side.
CSS Gradient Generator
Design, customize, and export CSS linear, radial, and conic gradients online with live preview, unlimited color stops, CSS variables, Tailwind classes, and PNG/SVG/JPEG/WebP download options. 100% free & client-side.