Color Contrast Checker
Free WCAG color contrast checker. Test foreground and background color combinations for AA/AAA accessibility compliance. Supports normal and large text sizes.
Preview
Color Information
Foreground Color (Text)
Background Color
Suggest Similar Colors
Foreground Color (Text)
Background Color
Preset Color Combinations
Color Contrast Checker - WCAG Accessibility Tool
A comprehensive color contrast checker that evaluates foreground and background color combinations against WCAG 2.1 guidelines. Tests both AA and AAA compliance levels for normal text (under 18pt or 14pt bold) and large text (18pt and larger, or 14pt bold and larger). Features include real-time contrast ratio calculation, color adjustment tools, preset combinations, and recommendations for improving accessibility. Essential for designers, developers, and anyone creating accessible web content.
What is color contrast and why does it matter?
Color contrast is the difference in luminance (brightness) between two colors, typically between text (foreground) and its background. It's crucial for web accessibility.
Why It Matters:
Readability:
- Higher contrast = easier to read
- Low contrast causes eye strain
- Critical for long-form content
- Affects reading speed and comprehension
Accessibility:
- Essential for people with low vision
- Helps users with color blindness
- Benefits older users (age-related vision changes)
- Required by law in many countries
WCAG Guidelines:
- AA (Minimum): 4.5:1 for normal text
- AA (Minimum): 3:1 for large text
- AAA (Enhanced): 7:1 for normal text
- AAA (Enhanced): 4.5:1 for large text
Text Size Definitions:
Normal Text:
- Less than 18pt (24px)
- Less than 14pt (18.5px) bold
Large Text:
- 18pt (24px) or larger
- 14pt (18.5px) bold or larger
Real World Impact:
- 1 in 12 men have color vision deficiency
- 1 in 200 women have color vision deficiency
- Many users have temporary vision issues
- Screen glare reduces effective contrast
Legal Requirements:
- Section 508 (US Government)
- ADA (Americans with Disabilities Act)
- EN 301 549 (European Standard)
- Required for government websites
- Increasingly required for private sector
How do I use the contrast checker?
Simple steps to check your color contrast:
1. Choose Colors:
- Enter hex codes manually (#RRGGBB)
- Use color pickers for visual selection
- Apply preset combinations
- Paste colors from other tools
2. View Results:
- Contrast ratio displayed (e.g., 7.2:1)
- AA compliance status (Pass/Fail)
- AAA compliance status (Pass/Fail)
- Separate results for normal and large text
3. Check Preview:
- See actual text appearance
- Normal text sample
- Large text sample
- Judge readability yourself
4. Adjust if Needed:
- Use Lighten/Darken buttons
- Try suggested similar colors
- Swap foreground/background
- Test different combinations
Understanding Results:
✓ Pass (Green):
- Contrast meets requirements
- Safe to use
- Accessible to most users
✗ Fail (Red):
- Contrast too low
- Not accessible
- Must improve or use different colors
Contrast Ratio Scale:
- 21:1 = Maximum (black on white)
- 7:1 = AAA for normal text
- 4.5:1 = AA for normal text
- 3:1 = AA for large text
- Below 3:1 = Fails all standards
Tips:
- Test with actual content size
- Consider various lighting conditions
- Check on different devices
- Test with colorblind simulators
- Verify with real users when possible
What are WCAG AA and AAA levels?
WCAG (Web Content Accessibility Guidelines) defines accessibility levels:
Level AA (Minimum Conformance):
Normal Text:
- Ratio: 4.5:1 minimum
- Most common requirement
- Balance of accessibility and design
- Required by most laws
Large Text:
- Ratio: 3:1 minimum
- More lenient for headings
- Applies to 18pt+ or 14pt+ bold
When to Use AA:
- Standard websites
- Most commercial applications
- Legal compliance minimum
- Good balance for most users
Level AAA (Enhanced Conformance):
Normal Text:
- Ratio: 7:1 minimum
- Higher accessibility
- More restrictive
- Best for critical content
Large Text:
- Ratio: 4.5:1 minimum
- Same as AA normal text
- Still challenging for some color pairs
When to Use AAA:
- Government websites
- Educational institutions
- Healthcare applications
- Financial services
- Critical information
- Sites for older adults
AAA Challenges:
- Limits design choices
- Harder to achieve with brand colors
- Not always possible with all palettes
- May conflict with brand identity
Practical Approach:
- Aim for AA minimum everywhere
- Use AAA for body text when possible
- AA acceptable for some UI elements
- AAA for critical actions/information
- Test with real users
Exceptions:
- Logos (no requirement)
- Inactive/disabled elements
- Pure decoration
- Text in images (avoid if possible)
How is contrast ratio calculated?
The mathematical formula for contrast ratio:
Formula:
Contrast Ratio = (L1 + 0.05) / (L2 + 0.05)
Where:
- L1 = Relative luminance of lighter color
- L2 = Relative luminance of darker color
- 0.05 = Constant to prevent division by zero
Calculating Relative Luminance:
1. Convert RGB to decimal (0-1):
R = Red / 255
G = Green / 255
B = Blue / 255
2. Apply gamma correction:
If RGB ≤ 0.03928:
RGB = RGB / 12.92
Else:
RGB = ((RGB + 0.055) / 1.055) ^ 2.4
3. Calculate luminance:
L = 0.2126 × R + 0.7152 × G + 0.0722 × B
Why These Numbers?
- Based on human perception
- Green contributes most (71.52%)
- Red contributes moderate (21.26%)
- Blue contributes least (7.22%)
- Matches how our eyes actually work
Examples:
Black (#000000) on White (#FFFFFF):
- L1 (white) = 1.0
- L2 (black) = 0.0
- Ratio = (1.0 + 0.05) / (0.0 + 0.05)
- Ratio = 1.05 / 0.05 = 21:1 (Maximum)
Dark Blue (#0000FF) on White (#FFFFFF):
- L1 (white) = 1.0
- L2 (blue) = 0.0722
- Ratio = (1.0 + 0.05) / (0.0722 + 0.05)
- Ratio = 1.05 / 0.1222 = 8.59:1 (AAA Pass)
Our tool handles all this automatically!
Important Notes:
- Ratio is always ≥ 1:1
- Higher number = better contrast
- Maximum possible = 21:1
- Minimum useful = 3:1
What if my colors don't pass?
Several strategies to improve failing contrast:
1. Adjust Lightness:
Lighten Background:
- Make background lighter
- Keep foreground same
- Usually easiest approach
- Use Lighten button in tool
Darken Foreground:
- Make text darker
- Keep background same
- Good for light backgrounds
- Use Darken button in tool
2. Try Suggestions:
- Tool provides similar colors
- Maintains similar hue
- Automatically passes standards
- Click suggested colors to apply
3. Swap Colors:
- Switch foreground/background
- Sometimes works instantly
- Especially effective with complementary colors
4. Use Preset Combinations:
- Black on white: 21:1 (Maximum)
- White on black: 21:1 (Maximum)
- Dark blue on white: Usually AAA
- Yellow on black: Usually AA/AAA
5. Design Alternatives:
Add Borders:
- Border around text
- Creates separation
- Helps but doesn't replace contrast
Increase Font Weight:
- Makes text bolder
- Improves readability
- Lowers minimum contrast needed
Increase Font Size:
- Larger = easier to read
- Moves from normal to large text
- Lower contrast requirement (3:1 vs 4.5:1)
Use Text Shadows:
- Adds depth and separation
- Light shadow on dark text
- Dark shadow on light text
- Use sparingly
6. Brand Color Challenges:
If Brand Colors Fail:
- Use brand colors sparingly
- Apply to larger elements only
- Use for backgrounds with sufficient text contrast
- Create accessible variations
- Use brand colors in logos/decorations
Common Solutions:
- Lighter tint of brand color for backgrounds
- Darker shade for text
- White/black text on brand backgrounds
- Brand accent, not primary text color
7. Testing:
- Always preview with actual content
- Test on different screens
- Check in various lighting
- Get feedback from users with disabilities
Remember: Accessibility improves UX for everyone!
Key Features
- Real-time contrast ratio calculation
- WCAG 2.1 AA compliance checking
- WCAG 2.1 AAA compliance checking
- Normal text contrast (4.5:1, 7:1)
- Large text contrast (3:1, 4.5:1)
- Live preview of color combinations
- Sample text in normal size
- Sample text in large size
- Pass/Fail indicators for each level
- Color picker for foreground
- Color picker for background
- Manual hex color input
- Swap foreground/background colors
- Lighten/Darken color adjustment
- Suggest similar passing colors
- Preset high contrast combinations
- Color information display (HEX, RGB, HSL)
- Relative luminance calculation
- Detailed WCAG explanations
- Responsive mobile design
- Dark mode support
- 100% client-side processing
- No data sent to servers
- Copy color codes to clipboard
- Accessibility-focused design