WCAG Color Contrast Checker
Test foreground and background colors in HEX, RGB, or OKLCH against WCAG 2.1 AA, AAA, and UI component thresholds. Fix failing pairs in one click with perceptual OKLCH lightness adjustment and copy accessible CSS or Tailwind v4 tokens.
Large Heading (24px+ Bold · AA ≥ 3:1)
Normal body copy at 16px needs at least a 4.5:1 contrast ratio for WCAG AA readability and 7.0:1 for AAA. Clear contrast makes cards, navigation links, and error messages effortless to read on every display.
/* WCAG Fail — Contrast Ratio 2.46:1 */
:root {
--color-background: #fef2f2; /* oklch(97.0% 0.013 17.4) */
--color-foreground: #fb7185; /* oklch(71.9% 0.169 13.4) */
}
.accessible-surface {
background-color: var(--color-background);
color: var(--color-foreground);
}FAQ
What is the difference between WCAG AA and AAA color contrast?
WCAG 2.1 Level AA requires at least 4.5:1 contrast for normal body text (under 18pt / 24px regular or 14pt / 18.66px bold) and 3:1 for large text and non-text UI components like icons, focus rings, and form borders. Level AAA raises those thresholds to 7:1 for normal text and 4.5:1 for large text.
How does the 1-click OKLCH Auto-Fix preserve brand color?
The 1-click Auto-Fix solver converts your color into perceptual OKLCH space, preserves your brand hue and saturation, and binary-searches for the closest lightness that meets 4.5:1 (AA) or 7:1 (AAA) against the paired surface.
Can I check OKLCH and RGB colors, not just HEX?
Yes. Paste any valid 3- or 6-digit HEX code, rgb(r, g, b) value, or modern oklch(L% C H) color directly into either input and the ratio, badges, and live preview update immediately.
What does the UI Components AA badge measure?
Under WCAG 2.1 Success Criterion 1.4.11 (Non-text Contrast), interactive controls such as button outlines, checkboxes, focus indicators, and input borders need at least a 3:1 ratio against adjacent background colors.
How do I export an accessible color pair to CSS or Tailwind v4?
Use the export panel below the preview to copy CSS Custom Properties, Tailwind v4 @theme OKLCH tokens, or JSON containing both colors, their OKLCH coordinates, and their verified WCAG grade.
More Free Design Tools
View all tools →Google Font Pairings Generator
16 curated Google Font heading + body pairings with live editable preview, Google Fonts link & Tailwind v4.
CSS Box Shadow Generator
Multi-layer CSS box-shadow studio with 8 curated presets, inset support & Tailwind utility export.
Retro Color Palette Generator
70s groove, 80s synthwave, 90s Memphis, Y2K Chrome, Mid-Century, Bauhaus & Kodak Film palettes.
Aesthetic Color Palette Generator
Matcha & Cream, Dark Academia, Japandi, Pastel Dream & harmony sliders with WCAG badges.
Brand Guidelines Generator
Build a live mini brand book and export HTML brand sheet, BRAND.md or CSS design tokens.
Gradient Border CSS Generator
Rounded & transparent CSS border gradients with padding-box, mask-composite & Tailwind v4.
Tailwind v4 Palette Generator
Perceptually uniform 50–950 Tailwind v4 OKLCH scales and dark-mode palettes.
OKLCH Color Converter
Convert HEX to OKLCH and OKLCH to HEX with live Lightness, Chroma & Hue sliders.
CSS Glassmorphism Generator
Frosted-glass CSS & Tailwind v4 cards with live backdrop-filter blur and saturation.