WCAG Contrast Checker
Score any foreground/background pair against WCAG 2.1 (AA, AAA) and the newer APCA Lc model. Live ratio, large-text rules, non-text 3:1 check, and one-click swap.
- WCAG 2.1 ratio scored against the 4.5:1, 3:1 and 7:1 thresholds
- APCA Lc preview for the next-gen perceptual contrast model
- Large-text (18pt / 14pt bold) and non-text (UI components) rules
- Live swap of foreground and background, plus colorblind-safe hint
Direct answer
WCAG Contrast Checker
Ratio
16.12 : 1
Preview
The quick brown fox
Body text — the kind that should clear AA at 4.5:1 minimum. WCAG 2.1 specifies different ratios for normal and large text.
Small caption text — needs the highest ratio to remain legible.
When this saves you time
Real workflows where wcag contrast checker replaces tedious manual work or an in-app subscription tool.
Spot-check buttons before code review
Validate a brand palette against WCAG AA
Check dark-theme variants
Verify non-text contrast (SC 1.4.11)
Pre-flight marketing email colors
Compare WCAG 2.1 to APCA Lc
How it works
The methodology — every transformation documented so the output is reproducible.
Linearize and compute luminance
Each sRGB channel is gamma-decoded (the 2.4 curve with the 0.03928 break) and weighted 0.2126·R + 0.7152·G + 0.0722·B to produce relative luminance L.
Apply the WCAG ratio formula
Contrast ratio = (L1 + 0.05) / (L2 + 0.05) where L1 is the lighter color. The ratio runs from 1:1 (identical) to 21:1 (pure black on pure white).
Compare against AA / AAA thresholds
Normal text needs 4.5:1 AA / 7:1 AAA. Large text (≥18pt or ≥14pt bold) drops to 3:1 / 4.5:1. Non-text UI components (borders, icons) need 3:1.
Compute APCA Lc in parallel
APCA uses a different luminance estimator (Y) and a non-linear contrast formula tuned to spatial frequency. The result is a signed Lc value (range roughly -108 to +106) that better predicts real readability.
Worked examples
| Input | Result | Notes |
|---|---|---|
| #FFFFFF on #1F2937 (slate-800) | 16.1:1 — AAA pass | Common dark-UI body text. Plenty of headroom for icons too. |
| #FFFFFF on #2563EB (blue-600) | 5.17:1 — AA pass (normal), AAA fail | Typical primary button. Use for buttons, not body text headings under 18pt. |
| #6B7280 on #FFFFFF (gray-500) | 4.6:1 — AA pass for normal text | The lightest gray that still passes 4.5:1 on white. Anything lighter is large-text only. |
| #FBBF24 on #FFFFFF (amber-400) | 1.81:1 — fails everything | Yellow on white is a classic accessibility trap. Reserve for decorative use behind a dark text overlay. |
| #0F172A on #FFFFFF | 19.6:1 — AAA pass | Almost-black on white — the upper bound of practical UI contrast. |
Common mistakes to avoid
Trusting screenshots over the math
Forgetting the large-text loophole
Ignoring non-text contrast
Treating APCA as a drop-in replacement
Frequently Asked Questions
Where the WCAG 2.1 thresholds come from
The 4.5:1 number was not chosen arbitrarily. It reflects the estimated contrast loss for a user with 20/40 vision (the bottom of the “normal” range) at typical body-text sizes. The ratio is computed against relative luminance, which is what the eye actually responds to, rather than RGB channel values directly. Pure black on pure white scores 21:1; identical colors score 1:1. Most usable text pairs land between 4.5:1 and 16:1.
The 3:1 threshold for large text comes from research showing that larger glyphs are easier to resolve at lower contrast — the spatial-frequency advantage offsets some of the luminance loss. The same 3:1 figure governs non-text contrast (SC 1.4.11) on the assumption that UI shapes are typically larger than body type and do not need to be readable as individual characters.
WCAG 2.1 vs APCA: what's actually different
WCAG 2.1’s ratio is symmetric — swap foreground and background and the number is unchanged. APCA is polarity-aware: dark text on light backgrounds (positive Lc) needs different thresholds than light text on dark (negative Lc). APCA also weights spatial frequency: thin glyphs need more contrast than chunky ones, which the 2.1 ratio ignores. For most production work, scoring against both gives you a today-and-tomorrow view: ship the WCAG 2.1 pass for compliance, keep an eye on APCA for the perceptually-correct read.
Putting contrast in the design system
The checker is most useful when wired into your token pipeline. Build the palette in the palette generator, run each foreground/background pair through this tool, and freeze the passing pairs as semantic tokens (text-on-primary, text-on-surface, border-default). Then export them via the design token generator so the contrast guarantees travel with the tokens instead of living in a spreadsheet.