color-contrast-checker
A color contrast checker measures the perceived contrast ratio between two colors (typically text and its background) against WCAG accessibility guidelines β AA requires 4.5:1 for normal text and 3:1 for large text (β₯18px or β₯14px bold); AAA requires 7:1 normal and 4.5:1 large. Failing contrast is the #1 accessibility violation on the web (per WebAIM annual survey, ~83% of homepage failures). The ZTools Color Contrast Checker computes both the WCAG contrast ratio AND the newer APCA score (WCAG 3 draft), shows a live text preview at multiple sizes, and offers color-blind simulation (Protanopia, Deuteranopia, Tritanopia).
Use casesβ
Pre-launch accessibility auditβ
Check every color pair in the design system before shipping. Catch violations now, not after a lawsuit or accessibility audit fails.
Marketing landing-page reviewβ
Hero CTAs over photo backgrounds often fail contrast. Verify each color pair against the worst-case underlying color in the photo.
Brand color auditβ
Brand uses a specific accent color β does it pass contrast against your background palette? Tool flags pairs that need text-color tweaks.
PDF / print accessibilityβ
Print designs follow same WCAG guidelines (effectively). Audit before sending to press; reprints are expensive.
How it worksβ
- Pick foreground + background colors β Hex picker, RGB sliders, OKLCH, or paste hex codes.
- View ratio β WCAG contrast ratio (e.g. 4.7:1) + AA / AAA pass/fail for normal AND large text.
- View APCA score β Newer perception-based score (WCAG 3 draft); -100 to 100. Generally aligns with WCAG but more accurate for thin fonts.
- Simulate color blindness β Toggle Protanopia / Deuteranopia / Tritanopia preview β does the contrast still hold for color-blind users?
- Suggest fixes β If failing, tool suggests darker / lighter shades that pass.
Examplesβ
Input: Foreground #6366f1 (indigo-500), background #ffffff
Output: Contrast 4.61:1 β passes AA normal, fails AA large strict, passes AA-large by sub-pixel margin. Use indigo-600 for safer compliance.
Input: Foreground #ffffff, background #ef4444 (red-500)
Output: Contrast 4.10:1 β fails AA (4.5 required). Use red-600 background or larger text.
Input: Foreground #1f2937 (slate-800), background #f3f4f6 (gray-100)
Output: Contrast 12.6:1 β passes AAA. Industry-standard "almost-black on light-gray" body text combination.
Frequently asked questionsβ
WCAG AA vs AAA β which target?
AA is the legal-compliance baseline (ADA, EN 301 549). AAA is best practice but stricter β many brands can't hit AAA on every component without sacrificing visual hierarchy. Aim for AA everywhere; AAA on body text where possible.
What's "large text" exactly?
WCAG defines large = 18pt+ (24px) at any weight, OR 14pt+ (18.66px) at 700+ weight. Headings often qualify as large.
APCA vs WCAG β which to follow?
WCAG 2.x is the current legal standard. APCA is in WCAG 3 draft and may become the standard in coming years. Comply with WCAG 2.x AA today; cross-reference APCA for thin/decorative fonts where WCAG's formula is too lenient.
Why does color contrast matter for color-blind users?
Red-green contrast that looks fine to most users may be invisible to deuteranopes. WCAG ratio is luminance-based and largely independent of hue, so AA-passing red-on-green also passes for color-blind users β but always verify with simulation.
Does font weight affect required contrast?
Yes β bold text reads at smaller sizes, so WCAG allows large-text contrast (3:1) for 14pt+ bold or 18pt+ regular.
What about text on photos / gradients?
Test against the worst-case underlying color (darkest part if light text, lightest part if dark text). Add a semi-transparent overlay if necessary.
Tipsβ
- For body text, target 7:1 (AAA) β buys safety margin against display variation.
- Test text-over-photo against the worst-case underlying color; add overlay/scrim if needed.
- Body text + background pair is the highest-leverage check β fix that first.
- Color-blind preview is mandatory for any color-encoded UI (status badges, charts, "required field" red).
- Include link/button hover states in audit β only ~30% of teams check hover contrast.
Try it nowβ
The full color-contrast-checker runs in your browser at https://ztools.zaions.com/color-contrast-checker β no signup, no upload, no data leaves your device.
Last updated: 2026-05-06 Β· Author: Ahsan Mahmood Β· Edit this page on GitHub