Check if your input placeholder text meets WCAG contrast requirements. Light gray placeholders are one of the most common accessibility failures on the web.
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
Placeholder text is one of the most common WCAG failures on the web. The default light gray that browsers apply to placeholders almost always falls below the 4.5:1 contrast ratio required by WCAG AA. This example tests a typical placeholder gray (#9ca3af) on a white background.
Most CSS frameworks ship placeholder colors that fail WCAG. Tailwind’s default placeholder-gray-400 (#9ca3af) gives only 3.14:1 contrast on white. Bootstrap’s .form-control::placeholder uses rgba(0,0,0,.4) which translates to roughly #666666, barely passing at 5.74:1. Material UI’s default placeholder fails in dark mode.
The problem is compounded because placeholder text is typically smaller than body text (14-16px), meaning it falls under the stricter 4.5:1 requirement rather than the 3:1 large text threshold.
| Color | On white (#ffffff) | Ratio | WCAG AA |
|---|---|---|---|
| #cccccc | Light gray | 1.61:1 | Fails |
| #9ca3af | Tailwind gray-400 | 3.14:1 | Fails |
| #767676 | Minimum passing gray | 4.54:1 | Passes |
| #6b7280 | Tailwind gray-500 | 5.32:1 | Passes |
| #525252 | Tailwind gray-600 | 7.46:1 | Passes |
| #404040 | Dark gray | 9.67:1 | Passes |
Most placeholder contrast issues come down to one CSS property. Instead of relying on the browser default or framework default, override it explicitly:
/* Fails WCAG AA */
input::placeholder {
color: #9ca3af;
}
/* Passes WCAG AA */
input::placeholder {
color: #6b7280;
}
In Tailwind, use placeholder-gray-500 instead of placeholder-gray-400:
<!-- Fails -->
<input class="placeholder-gray-400" />
<!-- Passes -->
<input class="placeholder-gray-500" />
Contrast is one part of placeholder accessibility. WCAG also requires that placeholder text is not the only way to label an input (SC 1.3.1), and that the input has an accessible name (SC 4.1.2). Always pair placeholder text with a visible label or aria-label. The Regex Tester can help test input patterns, but the visual accessibility of the input itself is a separate concern.
Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.