Check if your button colors meet WCAG contrast requirements. Test CTA foreground and background color pairs for AA and AAA compliance in your browser.
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
Buttons are the most common accessibility audit failure after color contrast in text. A button that fails contrast requirements blocks users from completing tasks, submitting forms, or navigating your application. This example tests white text (#ffffff) on a standard blue button (#3b82f6).
Buttons have two separate contrast requirements that are often confused:
A button can pass text contrast but fail non-text contrast, or vice versa. You need to check both.
Most design systems use blue as the primary button color. Here is how common blue shades perform with white text:
| Button color | White text ratio | WCAG AA | Notes |
|---|---|---|---|
| #3b82f6 (blue-500) | 4.56:1 | Passes | Barely passes, no margin |
| #2563eb (blue-600) | 6.44:1 | Passes | Recommended minimum |
| #1d4ed8 (blue-700) | 8.59:1 | Passes | Good for primary CTAs |
| #60a5fa (blue-400) | 2.73:1 | Fails | Common mistake |
| #93c5fd (blue-300) | 1.47:1 | Fails | Never use with white text |
Every interactive state must meet contrast requirements:
| State | Foreground | Background | Ratio | Pass? |
|---|---|---|---|---|
| Default | #ffffff | #3b82f6 | 4.56:1 | AA passes |
| Hover | #ffffff | #2563eb | 6.44:1 | AA passes |
| Active | #ffffff | #1d4ed8 | 8.59:1 | AA passes |
| Disabled | #94a3b8 | #cbd5e1 | 1.46:1 | Exempt |
| Focus ring | #ffffff | #1e40af | 10.03:1 | AA passes |
Buttons rarely exist in isolation. Check every variant in your design system: primary, secondary, outline, ghost, and disabled. The CSS Gradient tool can help you generate button backgrounds, but always verify the final contrast ratio with the WCAG Contrast Checker before shipping.
Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.