Skip to content
SmaftyToolsSmaftyTools

All tools →

Color Contrast Checker

Check WCAG 2.1 AA and AAA color contrast ratios for normal and large text with live preview and one-click accessible color auto-fix.

About Color Contrast Checker

The Color Contrast Checker calculates the exact WCAG 2.1 contrast ratio between any foreground text color and background color, showing instant PASS/FAIL results for Level AA and Level AAA across normal and large text.

Test brand color pairs in a live readability preview, swap foreground and background in one click, and use the Auto-Fix button to automatically adjust a failing text color to meet WCAG AA (4.5:1).

What contrast ratios are required for WCAG 2.1 AA and AAA accessibility?

Under the W3C Web Content Accessibility Guidelines (WCAG 2.1), contrast ratio is calculated from the relative luminance of the foreground and background colors on a scale from 1:1 (no contrast) to 21:1 (black on white). Level AA requires at least 4.5:1 for normal body text and 3.0:1 for large text (18pt regular or 14pt bold and larger). Level AAA raises the bar to 7.0:1 for normal text and 4.5:1 for large text. Checking contrast during design prevents unreadable buttons, muted placeholders, and accessibility audit failures. SmaftyTools computes exact sRGB-linearized luminance locally in your browser and even suggests the closest accessible foreground hex color when a pair falls below 4.5:1.

How to Use the Color Contrast Checker

  1. Pick or paste your Foreground (text) and Background hex colors.
  2. Read the live WCAG 2.1 contrast ratio and AA/AAA pass-fail badges.
  3. If a pair fails AA normal text, click Auto-fix to get an accessible hex color immediately.

Features

  • Exact WCAG 2.1 relative luminance and contrast ratio formula (1:1 to 21:1)
  • Pass/Fail badges for AA Normal, AA Large, AAA Normal, and AAA Large
  • One-click Auto-Fix suggestion to reach WCAG AA (4.5:1)
  • Live readability preview and instant foreground/background swap

Examples

High-contrast slate on white

Input

Foreground #0f172a on Background #ffffff

Output

17.85:1 — PASS WCAG AA & AAA (Normal and Large Text)

Frequently Asked Questions

What counts as large text in WCAG 2.1?

WCAG defines large text as at least 18pt (24px) regular weight, or 14pt (about 18.67px) bold weight. Large text only requires 3.0:1 for Level AA and 4.5:1 for Level AAA.

Should my website target WCAG AA or AAA?

WCAG 2.1 Level AA (4.5:1 for normal text, 3.0:1 for large text) is the global standard required by most accessibility policies and audits. Aim for AAA (7.0:1) on long-form reading copy whenever possible.

How does the Auto-Fix button choose a new color?

It steps your chosen foreground color toward pure black or pure white (whichever increases contrast against your background) until it reaches at least 4.5:1.

Is the Color Contrast Checker free?

Yes, the Color Contrast Checker is completely free with no usage limits. No signup, no account and no installation required.

Color Converter

Convert colors between HEX and RGB with a live picker and instant preview. Free online color converter for designers and developers.

Color Palette Generator

Generate harmonious 5-color palettes from any base color — analogous, complementary, triadic and more. Click any swatch to copy its hex code.

CSS Box Shadow & Glass Generator

Design custom CSS box shadows and frosted glassmorphism cards with live preview, presets, and one-click CSS copy. Free and browser-based.

Gradient Generator

Create beautiful CSS gradients — linear, radial or conic — with a live preview and copy-ready CSS code. Free online gradient generator.