🎯

Contrast Ratio Checker

Check WCAG contrast ratios to ensure accessible color combinations.

Design Tools
Loading tool...

How to Use Contrast Ratio Checker

How to Use the Contrast Ratio Checker

Step-by-Step Guide

  1. Choose Foreground Color: Select or enter the text/foreground color
  2. Choose Background Color: Select or enter the background color
  3. Preview: View how the colors look together in the preview area
  4. Calculate: Click "Calculate Contrast Ratio" to check WCAG compliance
  5. Review Results: See if your colors pass AA/AAA standards
  6. Swap Colors: Click "Swap Colors" to test the reverse combination
  7. Clear: Click "Clear" to reset and test new colors

Features

Color Input

  • Visual color pickers for easy selection
  • Manual hex code input for precise control
  • Supports all valid hex color formats
  • Separate inputs for foreground and background

Live Preview

  • See actual color combination before calculating
  • Preview normal text (16px)
  • Preview large text (18px bold)
  • Visual representation of final result

Contrast Calculation

  • Scientifically accurate WCAG 2.1 algorithm
  • Relative luminance calculation
  • Precise contrast ratio (e.g., 4.52:1)
  • Instant results

WCAG Compliance Check

  • Normal text AA (4.5:1) and AAA (7:1)
  • Large text AA (3:1) and AAA (4.5:1)
  • UI components AA (3:1)
  • Pass/Fail indicators for each standard
  • Visual checkmarks and X marks

Utility Functions

  • Swap colors button to test reverse combinations
  • Clear button to reset all inputs
  • Toast notifications for user feedback

Common Use Cases

Website Accessibility

  • Test text and background color combinations
  • Verify button color accessibility
  • Check link color contrast
  • Validate form input colors

Design System Development

  • Ensure all color combinations meet WCAG standards
  • Create accessible color palettes
  • Document compliant color pairs
  • Build accessible component libraries

UI/UX Design

  • Test color choices before implementation
  • Verify designs meet legal requirements
  • Choose accessible color combinations
  • Validate brand colors for accessibility

Legal Compliance

  • Meet ADA (Americans with Disabilities Act) requirements
  • Comply with Section 508 standards
  • Satisfy WCAG 2.1 Level AA (minimum legal requirement)
  • Achieve WCAG 2.1 Level AAA (enhanced compliance)

Understanding WCAG Contrast Ratios

What is a Contrast Ratio? Contrast ratio measures the difference in luminance between foreground and background colors. It ranges from 1:1 (no contrast, same color) to 21:1 (maximum contrast, black on white or vice versa).

WCAG 2.1 Standards:

Level AA (Minimum Legal Requirement)

  • Normal Text (under 18px): Minimum 4.5:1
  • Large Text (18px+ or 14px+ bold): Minimum 3:1
  • UI Components & Graphics: Minimum 3:1

Level AAA (Enhanced Compliance)

  • Normal Text (under 18px): Minimum 7:1
  • Large Text (18px+ or 14px+ bold): Minimum 4.5:1
  • UI Components & Graphics: Same as AA (3:1)

Why It Matters: Proper contrast ensures text and UI elements are readable for everyone, including people with:

  • Low vision
  • Color blindness
  • Age-related vision decline
  • Viewing screens in bright sunlight or poor lighting

Legal Requirements: Many countries require WCAG 2.1 Level AA compliance for:

  • Government websites
  • Public sector websites
  • Commercial websites (varies by jurisdiction)
  • Mobile applications

How Contrast is Calculated:

  1. Convert foreground and background colors to RGB
  2. Calculate relative luminance for each color using gamma correction
  3. Divide lighter luminance + 0.05 by darker luminance + 0.05
  4. Result is the contrast ratio (e.g., 4.5:1)

Tips for Accessible Color Combinations

  1. Aim for AA at Minimum: Level AA is the legal standard for most jurisdictions
  2. Strive for AAA When Possible: Enhanced compliance benefits more users
  3. Test Early and Often: Check contrast before finalizing designs
  4. Don't Rely on Color Alone: Use icons, labels, and patterns alongside color
  5. Consider Context: Body text needs higher contrast than large headings
  6. Test in Real Conditions: View on different devices and lighting conditions
  7. Use Dark on Light or Light on Dark: Avoid medium-contrast combinations
  8. Increase Font Weight: Bold text is more readable at lower contrasts
  9. Provide High Contrast Mode: Offer alternative color schemes for users who need them
  10. Document Compliant Pairs: Create a reference guide of approved color combinations

Frequently Asked Questions

Related Creative & Design Tools

🎨

Color Converter

Convert colors between HEX, RGB, and HSL with live preview, contrast checking, and quick-copy formats for your design system.

Use Tool β†’
πŸ“Έ

HEIC to JPG Converter

Convert HEIC/HEIF images to JPG format with adjustable quality settings. All conversions run locally in your browser - files never leave your device. Perfect for converting iPhone photos to a universally compatible format.

Use Tool β†’
πŸ–ΌοΈ

PNG to JPG Converter

Convert PNG images to JPG format with adjustable quality and transparency handling. All conversions run locally in your browser - files never leave your device. Perfect for reducing file sizes while maintaining image quality.

Use Tool β†’
🌈

Gradient Generator

Create beautiful CSS and Tailwind gradients with a visual editor. Support for linear and radial gradients with full control over colors, angles, and stops.

Use Tool β†’
🎨

Neumorphism Generator

Create beautiful neumorphism (soft UI) CSS effects with live preview. Generate soft, extruded 3D elements with dual shadows. Perfect for modern minimalist designs.

Use Tool β†’
πŸ–ΌοΈ

Image Placeholder Generator

Generate clean placeholder images with custom sizes, colors, and labels. Perfect for wireframes, mockups, and design systems.

Use Tool β†’
⬛

Box Shadow Generator

Visually design layered box shadows with fine-grained controls. Create production-ready CSS and Tailwind utilities for cards, modals, and UI elevations.

Use Tool β†’
πŸ”°

Logo Placeholder Generator

Generate simple placeholder logos with monograms, shapes, and preset color palettes. Perfect for mockups, prototypes, and early-stage branding.

Use Tool β†’

Share Your Feedback

Help us improve this tool by sharing your experience

We will only use this to follow up on your feedback