Skip to main content

WCAG Color Contrast Fixer — 4 Hue-Preserving Fixes per Pair, APCA + Colorblind Re-check

WCAG color contrast fixer — input fg/bg, get current ratio, auto-suggest 4 fixed colors hitting AA/AAA while preserving hue.

  • Runs locally
  • Category Color & Design
  • Best for Moving from a visual idea to reusable color values.
Inputs
Foreground (text)
Background
Live preview
Large heading sample 28px / 700
The quick brown fox jumps over the lazy dog. 16px body text.
13px caption — the line WCAG body thresholds were designed for.
Contrast metrics
WCAG 2.1 ratio
2.56:1
APCA Lc (WCAG 3 draft)
+50.2 body
|Lc| ≥ 60 ≈ body text OK · ≥ 75 ≈ AAA-equivalent
AA · Normal text (≥ 4.5)FAIL
AA · Large text (≥ 3.0)FAIL
AAA · Normal text (≥ 7.0)FAIL
AAA · Large text (≥ 4.5)FAIL
AA · UI component (≥ 3.0)FAIL
Suggested fixes (hue preserved)
Darken text
AaAA (4.5)
#6277934.59:1
Lighten text
AaAA (4.5)
#94a3b82.56:1
Not reachable while keeping hue/saturation — try a different lever.
Darken background
AaAA (4.5)
#3838384.57:1
Lighten background
AaAA (4.5)
#ffffff2.56:1
Not reachable while keeping hue/saturation — try a different lever.
Colorblind re-check (current pair)
A fix that passes WCAG can still collide for ~8% of men. Each row shows how the current pair looks under that deficiency, with the WCAG ratio re-computed on the simulated colors.
Normal visionPairRatioAA
Normal visionAa2.56:1FAIL
Protanopia (red-blind, ~1%)Aa2.72:1FAIL
Deuteranopia (green-blind, ~1%)Aa2.77:1FAIL
Tritanopia (blue-yellow, rare)Aa2.33:1FAIL
Achromatopsia (no color)Aa2.58:1FAIL
Batch check — paste one pair per line
Paste color pairs above to see a pass/fail grid for your entire palette in one shot.
References: WCAG 2.1 §1.4.3 / §1.4.6 · APCA W3C WCAG 3 working draft · Brettel/Vienot/Mollon colorblind matrices.

What this tool does

A WCAG contrast tool that doesn't stop at "your pair fails." Paste a foreground and background in any of five formats — hex (#334155), rgb(), hsl(), oklch(), or a CSS named color (slategray, steelblue, aliceblue) — and you get the live WCAG 2.1 ratio, the WCAG 3 draft APCA Lc number, a five-row judgment grid (AA normal / AA large / AAA normal / AAA large / 1.4.11 non-text UI), and a real text preview at heading, body, and caption sizes so you can judge the failure with your eyes, not just an integer. When the pair fails, the fixer doesn't give you a single answer — it gives you four levers per target (AA or AAA): darken foreground, lighten foreground, darken background, lighten background. Each lever walks lightness only in HSL, so the hue and saturation of your brand color survive the fix — your blue stays the same shade of blue, your red stays the same red, just lighter or darker. Every candidate is then re-projected through the four major colorblind matrices (protanopia, deuteranopia, tritanopia, achromatopsia) and the contrast is re-computed on the simulated pair, so a "fix" that secretly collides for the 8% of men with red-green deficiency shows up before you ship. Bring your whole palette: the batch checker accepts up to a dozen pairs per line and grades each one against AA and AAA at the same time. The fg/bg pair is URL-state, so a link lands the teammate on the exact failing combo, ready to fix. 100% client-side: no upload, no signup, no tracking.

Tool details

Input
Text + Numbers
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Preview
The result area focuses on usable output, with copy, download, or preview actions when supported.
Privacy
Browser-side processing
The main tool logic does not call an external API, so inputs normally stay in the current tab.
Save / share
Shareable URL state
Key settings are encoded in the URL so another person can reopen the same setup.
Performance budget
Initial JS <= 24 KB
No WASM budget is declared, keeping the tool quick to open on mobile.
Best fit
Color & Design · Designer
Category and role tags drive related tools, internal links, and quick fit checks.

How to use

  1. 1. Input

    Paste or drop your content into the tool panel.

  2. 2. Process

    Click the button. All processing is local in your browser.

  3. 3. Copy / Download

    Copy the result or download to disk in one click.

How WCAG Color Contrast Fixer fits into your work

Use it while choosing, checking, converting, or documenting colors for real interface work.

Color jobs

  • Moving from a visual idea to reusable color values.
  • Checking contrast and accessibility before a UI ships.
  • Keeping brand, design, and implementation color decisions aligned.

Color checks

  • Verify contrast against the actual background, not just a sample swatch.
  • Check dark and light themes separately when both exist.
  • Copy the final format your design system or codebase expects.

Good next steps

These links move the current task into a more complete workflow.

  1. 1 Glassmorphism Generator Glassmorphism CSS generator — backdrop-filter blur + transparency + border, live preview with 8 background presets, copy CSS/Tailwind/SwiftUI. Open
  2. 2 Color Converter HEX ⇄ RGB ⇄ HSL ⇄ HSV ⇄ CMYK — instant 5-way conversion, live swatch — browser-only Open
  3. 3 Color Blindness Simulator Color blindness simulator — paste hex or upload image, see how it looks to people with protanopia / deuteranopia / tritanopia / monochromacy. Open

Real-world use cases

  • Audit a brand palette pass before the design review

    Designer ships the v2 token file the night before review. You paste each foreground/background pair from `tokens.json` into the batch box (12 pairs, comma per line), wait for the table, and instantly see which three pairs miss AA. For each miss, you click "Darken background" on the fix card — the suggestion stays in the same hue family as the original tint, so when the designer pushes back ("you killed my warm cream"), you paste a screenshot showing the original cream is still cream, just 6% darker. Review goes from "we need another two days" to "approved, ship Monday."

  • Convince a stakeholder a dark-mode pair "feels off" with numbers

    The brand wants a #38bdf8 cyan on #0f172a slate hero. WCAG 2.1 says 7.4:1 — sailing AAA. The PM still says it looks "shimmery and hard to read at small sizes." Drop the pair in, point at APCA Lc: about -68, in the "good" band but only marginally for body text. Run the colorblind grid — the deuteranopia row stays green, so the issue isn't colorblindness. Pull "Darken cyan" to lift APCA into the |Lc| ≥ 75 "excellent" band; the new color is still recognizably brand. Stakeholder sees the math, not the vibes, and approves.

  • Fix a failing call-to-action button without touching the brand red

    The primary CTA is #ef4444 red on white — checker says 4.0:1, fails AA normal (passes AA large only). Sales says "do not touch the red." Open the fixer, target AA. "Darken text" gives you a deeper red (#dc2626-ish) that clears 4.5:1 while the hue gauge in the suggestion card shows it's still firmly in the red 5-15° hue band — no purple drift, no pink drift. Apply, screenshot, ship the patch. The brand red moves one shade deeper and the support inbox stops getting "I can't read the button text" tickets.

  • Pair-test a custom dark theme against red-green colorblindness

    You're shipping a dark theme variant and want to be sure the status colors (success green / error red) aren't going to collapse for the ~8% of male users with deuteranopia. Drop the green-on-bg pair in, scan the deuteranopia row of the colorblind grid: ratio drops from 5.2:1 to 2.9:1, way below AA. The WCAG 2 number alone would have shipped this. Switch the success color to "Lighten background" on the fix card — the new pair clears 4.5:1 on BOTH normal vision and the deuteranopia simulation. The error red was fine; the green needed a real-world re-check.

Common pitfalls

  • Assuming WCAG 2 ratio ≥ 4.5 means the pair is colorblind-safe — for ~8% of male users with deuteranopia it can collapse to under 3:1. Always glance at the colorblind row before shipping.

  • Picking the first lever the tool gives you. Lightening text often pushes a fix into a colorblind-unsafe direction; darkening the background usually preserves both WCAG and colorblind safety on the same hue.

  • Trusting APCA Lc instead of WCAG 2 for compliance work. APCA is excellent for design judgment but lawsuits, contracts, and audits still cite WCAG 2.x ratios — hit WCAG 2 first, then use APCA as the second-opinion.

Privacy

The foreground and background colors you type are processed entirely in the browser tab — sRGB parsing, WCAG 2 luminance math, APCA Lc computation, hue-preserving fix walks, and colorblind matrix multiplication all run in this page's JavaScript. The only network-touching part is the URL: the fg/bg pair is mirrored into `?fg=...&bg=...` so a shared link reproduces your exact pair on the recipient's screen, but the URL is rewritten locally via `history.replaceState` — nothing is POSTed to our server, no analytics tag carries the color values, and the batch textarea is never sent anywhere. Verify in DevTools → Network: type, change colors, paste a batch — the request count for our origin stays at zero.

FAQ

Tool combos

Folks in your role tend to reach for these alongside this tool.

Made by Toolora · 100% client-side · Updated 2026-06-14