DevTools Pro

The ultimate developer toolkit designed to boost your productivity and workflow.

Version 2.1.0

Legal & Resources

DocumentationPrivacy PolicyTerms of Service

Contact & Support

Contact Us

Support Development

If you find these tools useful, consider supporting us.

Buy Me A CoffeeBuy Me A Coffee

Made with ❤️ by developers worldwide

© 2026 DevTools Pro. All rights reserved.

WCAG Contrast Checker

Verify Color Accessibility Compliance with WCAG 2.1 Standards

A comprehensive tool for checking color contrast ratios against WCAG 2.1 accessibility guidelines. Ensure your designs are accessible to users with visual impairments.

WCAG 2.1 CompliantReal-time AnalysisLive Preview

Table of Contents

1. Getting Started2. Tool Tabs Overview2.1 Color Selection2.2 Color Input Methods2.3 Undo/Redo History2.4 Share via URL3. Contrast Analysis4. WCAG Compliance Levels5. Accessibility Score Widget6. Auto-Fix Suggestions7. Color Format Conversion8. Live Preview9. Device/Context Preview10. Complex Background Testing11. Color Blindness Simulation12. Accessible Palette Generator13. Bulk Color Testing14. Export Colors15. Saved Colors & Contrast Matrix16. Accessibility Guidelines17. Common Use Cases18. Technical Details19. Related Tools

Getting Started

The WCAG Contrast Checker helps you verify that your color combinations meet accessibility standards for users with visual impairments. The tool calculates contrast ratios using the official WCAG 2.1 formula and includes many advanced features for comprehensive accessibility testing.

Quick Start Steps:

  1. Select Colors: Choose your foreground (text) and background colors using the color pickers, enter hex values, or pick colors from images
  2. View Results: The contrast ratio is calculated automatically and displayed instantly
  3. Check Compliance: See which WCAG levels (AA, AAA) your color combination passes
  4. Explore Features: Use additional tabs to test complex backgrounds, simulate color blindness, generate accessible palettes, and more
  5. Save & Export: Save color combinations for future reference or export to your preferred format
8 Tabs

Multiple specialized views for different testing scenarios

4 Simulations

Color blindness simulation for Protanopia, Deuteranopia, Tritanopia, and Achromatopsia

Palette Tools

Generate accessible color palettes with harmonies and WCAG analysis

4 Export Formats

Export to CSS Variables, Tailwind, SCSS, or JSON

Tip: The tool uses the relative luminance formula from WCAG 2.1, which accounts for the non-linear response of human vision to color intensity. Use keyboard shortcuts Ctrl+Z for Undo and Ctrl+Y for Redo.

Tool Tabs Overview

The WCAG Contrast Checker is organized into 8 main tabs, each specializing in different aspects of color accessibility testing:

Contrast Checker

The main tab for checking contrast between foreground and background colors. Includes accessibility score, auto-fix suggestions, and live preview.

Preview

Device and context preview showing how colors appear on different devices (mobile, tablet, desktop) and in different modes (light, dark, high-contrast).

Complex BG

Test contrast against complex backgrounds including gradients, images, and CSS patterns (dots, grid, checkerboard, lines, etc.).

Export

Export your color combinations to CSS Variables, Tailwind Config, SCSS Variables, or JSON format.

Palette

Generate accessible color palettes from a base color with shades, tints, color harmonies (analogous, triadic, split-complementary), and WCAG compliance analysis.

Bulk Test

Test multiple foreground/background color combinations simultaneously in a table view. Export results to CSV.

Color Blindness

Simulate how your color combination appears to users with different types of color vision deficiency: Protanopia, Deuteranopia, Tritanopia, and Achromatopsia.

Saved

View and manage saved color combinations. Includes a contrast matrix showing ratios between all saved colors.

Color Selection

The color selection interface allows you to specify both foreground (text) and background colors in multiple ways.

Color Picker

Click the color swatch to open an interactive color picker. You can select colors visually or enter specific values.

Hex Input

Enter hex color values directly (e.g., #000000 or #FFFFFF). The input validates hex format in real-time.

Input Options:

#RRGGBB6-digit hex (e.g., #FF5733)
#RGB3-digit hex (e.g., #F53 → #FF5533)
Copy ButtonClick to copy the hex value to clipboard

Random Palette: Use the "Random Palette" button to generate random color combinations for inspiration or testing.

Color Input Methods

The tool supports multiple ways to input and select colors beyond simple hex values.

Multi-Format Input

The text input accepts multiple color formats including HEX, RGB (rgb(0,0,0)), HSL (hsl(0,0%,0%)), and named colors (red, blue, etc.). The input automatically parses and converts to hex.

Image Color Picker

Click the eyedropper icon to pick colors directly from any image. Upload an image or paste from clipboard (Ctrl+V), then click anywhere to extract the color. Supports PNG, JPG, GIF, and WebP.

Real-time Format Display:

As you select colors, the tool automatically displays all available formats:

  • HEX: #000000
  • RGB: rgb(0, 0, 0)
  • HSL: hsl(0, 0%, 0%)
  • CMYK: cmyk(0%, 0%, 0%, 100%)
  • Named: black (when applicable)

Undo/Redo History

The tool includes full undo/redo functionality to help you experiment with different color combinations.

Undo (Ctrl+Z)

Revert to the previous color state. The tool maintains a history of up to 50 color changes.

Redo (Ctrl+Y)

Restore a previously undone color change. Works with Ctrl+Y or Ctrl+Shift+Z.

Tip: Use keyboard shortcuts for quick navigation: Ctrl+Z to undo and Ctrl+Y (or Ctrl+Shift+Z) to redo.

Share via URL

Share your color combinations with others by generating a shareable URL that encodes the foreground and background colors.

How to Share

  1. Click the "Share" button to generate a shareable URL
  2. The URL is automatically copied to your clipboard
  3. Share the link with colleagues or save it for later
  4. When someone opens the link, the colors are automatically loaded

URL Format:

https://example.com/wcag-contrast-checker?fg=000000&bg=ffffff

The URL parameters fg and bg contain the foreground and background colors (without the # symbol).

Contrast Analysis

The contrast analysis section displays the calculated contrast ratio and provides detailed compliance information.

Contrast Ratio Display:

Contrast Ratio
7.54:1

The contrast ratio is calculated 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.

Recommendations: When your color combination doesn't meet WCAG standards, the tool provides specific suggestions for improving contrast.

Accessibility Score Widget

The Accessibility Score provides a comprehensive overall assessment of your color combination across multiple accessibility dimensions.

Score Components:

Contrast Score
Based on WCAG contrast ratio (0-100)
Color Blindness Score
How distinguishable colors are for color-blind users
UI Legibility Score
Suitability for common UI patterns (buttons, links, etc.)

Score Ratings:

70-100:Compliant - Good accessibility
50-69:Needs Review - May need improvements
0-49:Non-compliant - Needs significant changes

Auto-Fix Suggestions

When your color combination doesn't meet WCAG standards, the tool automatically suggests alternative colors that would pass.

How Auto-Fix Works

  1. The tool analyzes your current foreground and background colors
  2. It calculates the minimal adjustment needed to meet WCAG AA (4.5:1) or AAA (7:1) requirements
  3. Suggestions include whether to lighten or darken each color and by what percentage
  4. Click "Apply Fix" to instantly apply the suggested colors

Tip: The auto-fix tries to preserve your original color hue while adjusting lightness to meet accessibility requirements.

Color Format Conversion

The tool automatically converts colors between multiple formats for easy use in different contexts.

Supported Formats:

HEX
#FF5733
Hexadecimal color values
RGB
rgb(255, 87, 51)
Red, Green, Blue values
HSL
hsl(11, 100%, 60%)
Hue, Saturation, Lightness
CMYK
cmyk(0%, 66%, 80%, 0%)
Cyan, Magenta, Yellow, Key (print)

Named Colors

The tool also recognizes CSS named colors (e.g., "red", "blue", "transparent"). When a matching named color exists, it's displayed alongside other formats.

Color Blindness Simulation

The Color Blindness tab simulates how your color combination appears to users with different types of color vision deficiency. This helps ensure your design is accessible to all users.

Supported Color Blindness Types:

Protanopia

Red-blindness, difficulty distinguishing red and green

Deuteranopia

Green-blindness, most common form of color blindness

Tritanopia

Blue-blindness, difficulty distinguishing blue and yellow

Achromatopsia

Complete color blindness, sees only in grayscale

How to Use

  1. Navigate to the "Color Blindness" tab
  2. Select a color blindness type from the tabs
  3. View the side-by-side comparison of original vs simulated colors
  4. Check WCAG compliance badges for each simulation
  5. The tool shows contrast ratio changes under each simulation

Important: Color blindness simulation shows how colors are perceived differently. The contrast ratio may change significantly for some color combinations, affecting accessibility.

Accessible Palette Generator

The Palette tab generates accessible color palettes from a base color, including shades, tints, and color harmonies with WCAG compliance analysis.

Palette Features:

Tints (Light Variants)

Lighter versions of your base color for highlights and backgrounds

Shades (Dark Variants)

Darker versions of your base color for text and emphasis

Color Harmonies

The palette generator creates harmonious color schemes based on color theory:

• Analogous: Colors within 30° on the color wheel
• Triadic: Colors at 120° intervals
• Split-Complementary: Base + two colors adjacent to its complement

WCAG Compliance Suggestions

The tool analyzes your base color and suggests compliant variants for both white and black backgrounds. Each color variant shows its contrast ratio and WCAG AA/AAA compliance status.

WCAG Compliance Levels

The tool checks compliance against WCAG 2.1 guidelines, which define different levels of accessibility requirements.

WCAG AA (Minimum)

The minimum level required for most web content.

Normal Text4.5:1 minimum
Large Text3:1 minimum

WCAG AAA (Enhanced)

Enhanced accessibility for situations requiring higher contrast.

Normal Text7:1 minimum
Large Text4.5:1 minimum

Compliance Categories:

Normal Text
Text smaller than 18pt or 14pt bold
Large Text
Text 18pt and larger, or 14pt bold and larger

Pass/Fail Indicators: Each compliance level shows a clear Pass (green) or Fail (red) badge, making it easy to see which requirements your color combination meets.

Live Preview

The live preview section shows how your color combination appears in real-world scenarios with adjustable typography settings.

Preview Controls:

Font Size16px
Adjustable from 12px to 48px
Font Weight400
Adjustable from 100 to 900

Heading Example

Shows how headings appear with your color combination. Useful for testing section titles and emphasis text.

Paragraph Example

Demonstrates body text readability. Test longer passages to ensure comfortable reading experience.

Button Example

Shows how buttons appear with inverted colors. Important for ensuring CTA buttons meet contrast requirements.

Device/Context Preview

The Preview tab shows how your colors appear in different device contexts and display modes.

Mobile

Preview your colors on a mobile device frame with typical mobile viewport dimensions.

Tablet

Preview your colors on a tablet device frame with typical tablet viewport dimensions.

Desktop

Preview your colors on a desktop device frame with typical desktop viewport dimensions.

Preview Modes:

Light Mode

Standard light background viewing

Dark Mode

Dark background viewing for low-light conditions

High Contrast

Maximum contrast for accessibility needs

Complex Background Testing

The Complex BG tab allows you to test contrast against non-solid backgrounds including gradients, images, and CSS patterns.

Gradient Backgrounds

Test text contrast against linear and radial gradients. Adjust angle, color stops, and positions to find accessible combinations.

Image Backgrounds

Enter an image URL to test contrast against the image. The tool calculates the average luminance for accurate contrast checking.

CSS Patterns

Test contrast against CSS-generated patterns: Dots, Grid, Checkerboard, Diagonal Lines, Crosshatch, and Zigzag.

Pattern Options:

• Dots - Polka dot pattern
• Grid - Grid lines pattern
• Checkerboard - Checkered pattern
• Diagonal Lines - Striped pattern
• Crosshatch - Cross-hatched pattern
• Zigzag - Zigzag lines pattern

Bulk Color Testing

The Bulk Test tab allows you to test multiple foreground/background color combinations simultaneously in a table view, making it easy to audit entire color systems.

Features:

  • Add unlimited color combinations to test
  • Each row shows foreground, background, and contrast ratio
  • WCAG AA and AAA compliance for both normal and large text
  • Visual preview of each color combination
  • Randomize all combinations with one click
  • Export results to CSV for documentation
{n}
Total Combinations
Count of all color pairs being tested
{n}
WCAG AA Pass
Number of combinations passing AA
{n}
WCAG AA Fail
Number of combinations failing AA

Tip: Use bulk testing to audit your entire color system at once. Export to CSV to include in accessibility documentation or reports.

Export Colors

The Export tab allows you to export your color combinations in multiple formats for use in different projects and technologies.

CSS Variables

Export as CSS custom properties:

:root {
  --foreground: #000000;
  --background: #ffffff;
}

Tailwind Config

Export as Tailwind CSS theme extension:

theme: {
  extend: {
    colors: {
      foreground: '#000000',
      background: '#ffffff',
    }
  }
}

SCSS Variables

Export as SCSS variables:

$foreground: #000000;
$background: #ffffff;

JSON

Export as JSON for programmatic use:

{
  "foreground": "#000000",
  "background": "#ffffff"
}

Export Options:

  • Copy to Clipboard: Click the Copy button to copy the code
  • Download File: Click Download to save as a file

Saved Colors & Contrast Matrix

The Saved tab allows you to store and manage color combinations for future reference, with a contrast matrix for analyzing relationships between colors.

Save Combinations

Click "Save Combination" to store the current foreground and background colors. Up to 20 combinations can be saved.

Export to JSON

Export all saved color combinations as a JSON file for backup or use in other projects.

Contrast Matrix

The contrast matrix provides a visual grid showing contrast ratios between all saved colors. This helps identify which color combinations work well together.

  • Each cell shows the contrast ratio between two colors
  • Green cells indicate WCAG AAA compliance (7:1+)
  • Light green cells indicate WCAG AA compliance (4.5:1+)
  • Yellow cells indicate large text compliance (3:1+)
  • Red cells indicate failure to meet requirements
  • Click any cell to load that color combination

Saved Color Card Features:

  • Click any saved card to load that color combination
  • Each card shows the contrast ratio and AA compliance status
  • Hover over a card to reveal the delete option
  • Color values are displayed in hex format

Local Storage: Saved colors are stored in your browser's local storage and will persist between sessions.

Accessibility Guidelines

Understanding WCAG contrast requirements helps you create inclusive designs that work for all users.

Why Contrast Matters

Adequate contrast ensures that text is readable for users with low vision, color blindness, or those viewing in challenging lighting conditions. It also helps in situations where displays have poor quality or are viewed at angles.

Legal Requirements

Many jurisdictions require websites to meet WCAG accessibility standards. Failure to comply can result in legal action and exclusion of users who rely on accessible design.

WCAG 2.1 Contrast Requirements:

Text SizeAA MinimumAAA Enhanced
Normal Text4.5:17:1
Large Text (18pt+)3:14.5:1

Common Use Cases

Web Design

Ensure your website's text meets accessibility standards. Test different color schemes and find accessible alternatives to problematic combinations.

UI Component Design

Verify that buttons, form inputs, and other interactive elements have sufficient contrast for all users to identify and use.

Brand Guidelines

Validate brand color palettes for accessibility compliance. Identify which color combinations can safely be used for text.

Document Accessibility

Check colors used in documents, presentations, and PDFs to ensure they meet accessibility requirements for distribution.

Mobile App Design

Test color combinations for mobile interfaces where users may have varying display quality and lighting conditions.

Accessibility Audits

Conduct quick accessibility checks during development or as part of comprehensive accessibility audits.

Technical Details

The tool uses the official WCAG 2.1 relative luminance formula for calculating contrast ratios.

Relative Luminance Formula

L = 0.2126 × RsRGB + 0.7152 × GsRGB + 0.0722 × BsRGB

Where each RGB component is linearized using gamma correction before calculating luminance.

Contrast Ratio Formula

Contrast Ratio = (L1 + 0.05) / (L2 + 0.05)

Where L1 is the luminance of the lighter color and L2 is the luminance of the darker color.

Gamma Correction: The tool applies proper gamma correction (linearization) as specified in WCAG 2.1, ensuring accurate contrast calculations that match human visual perception.

Related Tools

Color Palette Generator

Generate harmonious color schemes for your designs

Gradient Generator

Create beautiful CSS gradients with live preview

Hex Compare

Compare and analyze hex color values

Neumorphism Generator

Create soft UI shadow effects for modern designs

← Back to DocumentationOpen Tool