Color Contrast Ratio Tester - Online WCAG AA/AAA Check
Enter foreground and background colors to instantly see the contrast ratio and pass/fail for AA and AAA. Simple and fast.
UD5 Toolkit
WCAG Contrast Matrix with Vision Deficiency Simulation
WCAG (Web Content Accessibility Guidelines) is an international standard for web accessibility developed by the W3C. Adequate color contrast ensures that text and interactive elements are readable by users with visual impairments, including low vision, color blindness, and those using screens in bright sunlight. Meeting WCAG contrast requirements is also a legal requirement in many jurisdictions under accessibility laws like ADA and Section 508.
The contrast ratio is calculated using the relative luminance of the two colors. First, each color's sRGB values are linearized, then the relative luminance is computed as: L = 0.2126 × R + 0.7152 × G + 0.0722 × B. The contrast ratio is (L1 + 0.05) / (L2 + 0.05) where L1 is the lighter luminance. This yields a value between 1:1 (identical colors) and 21:1 (pure black vs pure white). The formula accounts for human perception of brightness.
AA Level (minimum): Requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (≥18pt or ≥14pt bold). This is the generally accepted minimum for web accessibility.
AAA Level (enhanced): Requires a contrast ratio of at least 7:1 for normal text and 4.5:1 for large text. This is a stricter standard providing better readability for users with significant visual impairments.
Protanopia (red-blind): Absence of red cone photoreceptors. Reds appear dark or brownish, and red-green discrimination is severely impaired. Affects ~1% of males.
Deuteranopia (green-blind): Absence of green cone photoreceptors. Similar to protanopia in effect, greens appear beige or brownish. Most common type, affecting ~1.5% of males.
Tritanopia (blue-blind): Absence of blue cone photoreceptors. Blues appear greenish and yellows appear pinkish. Very rare, affecting ~0.003% of the population.
Achromatopsia (total color blindness): Complete absence of color perception; the world appears in shades of gray. Extremely rare, affecting about 1 in 30,000 people.
Use this tool to check your color pairs under different vision deficiency simulations. Aim for pairs that maintain a strong contrast ratio (≥4.5:1) even when simulated. Additionally: avoid relying solely on color to convey information; use patterns, icons, or text labels as supplements; test your designs with simulation tools; and consider using high-contrast color combinations like dark blue on white or black on light yellow, which tend to work well across all vision types.
Yes. When you switch to a vision deficiency mode in this tool, the contrast ratios are recalculated based on the simulated colors. This helps you understand whether a color pair that passes WCAG under normal vision remains distinguishable for users with color vision deficiencies. A pair that passes AA normally might fall below the threshold when simulated, indicating potential accessibility issues.
Some color pairs that perform well across all vision types include: Black (#000000) on White (#FFFFFF) – 21:1 contrast; Dark Navy (#1a237e) on White – ~15:1; White on Dark Blue (#0d47a1) – ~12:1; Dark Charcoal (#212121) on Light Gray (#f5f5f5) – ~15:1; and Dark Green (#1b5e20) on Off-White (#fafafa) – ~14:1. These combinations maintain high contrast even when simulated for most color vision deficiencies.
This tool uses established color transformation matrices based on the Brettel-Viénot-Mollon model and Machado et al. research on color vision deficiency simulation. While no simulation can perfectly replicate the experience of a color-blind individual, these models are widely used in accessibility tools and provide a reliable approximation for design decision-making. For critical applications, we recommend also testing with real users and dedicated accessibility auditing tools.
Enter foreground and background colors to instantly see the contrast ratio and pass/fail for AA and AAA. Simple and fast.
Upload a gradient or enter a palette and simulate how it appears with different types of color vision deficiency. Ensure inclusive data visualization.
Paste a list of hex colors and see a grid showing the contrast ratio for every combination. Instantly identifies which pairs pass WCAG AA/AAA.
Build a color palette for charts that works for protanopia, deuteranopia, and grayscale. Export as array.
Paste hex colors, generate a contrast matrix against each other. Identify failing pairs for WCAG.
Build a palette and simulate how it appears to various color deficiencies. Also generate pre-vetted accessible palettes. Local processing.
Start with a base color and generate an extended palette where every shade contrasts properly with white and black. Export tokens.
Generate a random 5‑color palette where every adjacent pair passes WCAG AA contrast. Safe for inclusive designs.
See how a full paragraph looks with your chosen text and background colors. Not just a ratio; the real appearance.
Enter a hex color and get its relative luminance per WCAG definition. Understand why this matters for contrast.
Pick a base color and generate a 10‑step scale where each step meets a specific contrast ratio against white or black. Export as CSS custom properties.
Paste a list of foreground/background color pairs and instantly see which pass AA/AAA. Perfect for checking entire style guides.
Paste a set of hex colors and simulate how they appear with common color vision deficiencies. Get contrast warnings.
Enter a text color and background color and instantly see if the combination passes WCAG AA and AAA ratio. Safe colors.
Enter a palette of colors and see a grid showing whether each foreground/background pair passes AA or AAA contrast. Must for designers.
Enter options and criteria with weights, and see a ranked table of the best choice. Quantitative decision making.
Given a background color, this tool suggests foreground colors that meet AA/AAA contrast ratios. Works for all vision types.
Calculate the perceived brightness of an RGB color and determine if black or white text is more readable. Accessibility tool.
Enter a color palette and see how it looks for different types of color vision deficiency. Get warnings on conflicting colors.
Check the contrast ratio between foreground and background colors to ensure web accessibility compliance. Get WCAG 2.1 AA/AAA pass/fail results instantly.