Color Contrast Checker
Check color contrast ratio against WCAG AA and AAA accessibility standards. Enter values for instant results with step-by-step formulas.
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer
Color Contrast Checker
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: Contrast Ratio = (L1 + 0.05) / (L2 + 0.05) where L = relative luminance
Worked example — 12.63:1 (AAA Pass)
Formula
Contrast Ratio = (L1 + 0.05) / (L2 + 0.05) where L = relative luminance
WCAG 2.1 requires 4.5:1 for normal text (AA) and 7:1 for enhanced (AAA). Large text (18pt+): 3:1 (AA) and 4.5:1 (AAA).
Worked Examples
Example 1: Dark gray on white
Problem:#333333 on #FFFFFF
Solution:Contrast ratio ≈ 12.63:1
Result:12.63:1 (AAA Pass)
Frequently Asked Questions
What contrast ratio do I need?
WCAG AA (minimum): 4.5:1 for normal text, 3:1 for large text. WCAG AAA (enhanced): 7:1 for normal, 4.5:1 for large. Most legal requirements mandate AA.
What is WCAG and why does it matter for websites?
WCAG (Web Content Accessibility Guidelines) is an international standard published by the W3C that defines how to make web content more accessible to people with disabilities, including those with visual impairments, color blindness, and low vision. In the United States, websites of federal agencies must meet WCAG 2.0 AA standards under Section 508, and many private companies face legal liability if their sites are inaccessible. Meeting WCAG AA is also good business practice as approximately 8% of men and 0.5% of women have some form of color vision deficiency.
What is relative luminance and how is it calculated?
Relative luminance measures the perceived brightness of a color on a scale from 0 (absolute black) to 1 (pure white). It is calculated by first converting each RGB component to a linear value (applying a gamma correction), then combining them using the formula L = 0.2126 × R + 0.7152 × G + 0.0722 × B. The green channel has the highest weight (71.5%) because human eyes are most sensitive to green light, followed by red (21.3%) and blue (7.2%). The contrast ratio between two colors is (L1 + 0.05) / (L2 + 0.05) where L1 is the lighter color.
Are there color combinations I should always avoid for accessibility?
Several color combinations are problematic for users with color blindness and low contrast: red on green (the most common type of color blindness, affecting 1 in 12 men, cannot distinguish these), green on black, red on black, blue on black, and any low-contrast pastel combinations. Beyond contrast ratio, avoid relying solely on color to convey information — always add a text label, icon, or pattern to differentiate elements. For example, form validation errors should not only turn red but should also show an error icon and descriptive text, ensuring all users can understand the interface regardless of their color perception.
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer · Editorial policy
Related Calculators
🧮Color Palette Generator
Generate harmonious color palettes using complementary, analogous, triadic, and split schemes.
🧮Gradient Generator
Create CSS gradient code from color stops with linear, radial, and conic options.
🧮Depth of Field Calculator
Calculate depth of field with interactive inputs and clear steps.
🧮Hyperfocal Distance Calculator
Calculate hyperfocal distance with interactive inputs and clear steps.
🧮Field of View Calculator (camera)
Calculate field of view (camera) with interactive inputs and clear steps.
🧮Shutter Speed to Freeze Motion Calculator
Calculate shutter speed to stop motion with interactive inputs and clear steps.
🧮Exposure Value (ev) Calculator
Calculate exposure value (ev) with interactive inputs and clear steps.
🧮Neutral Density Filter Stop Calculator
Calculate neutral density filter stop with interactive inputs and clear steps.