
Key takeaways
WCAG AA requires 4.5:1 for normal text, 3:1 for large text (18pt+ or 14pt bold), and 3:1 for UI components like button borders and input outlines.
Most mid-tone blues and brand reds fail body-text contrast against white but pass the 3:1 large-text threshold, so darkening the shade or reserving them for large text fixes the issue.
Gray placeholder text like #999999 on white fails at 2.85:1; darkening it to #767676 reaches 4.54:1 and passes AA.
Automated checkers skip text over photos, so sample the rendered background at multiple points behind the text and darken any scrim until the worst sample passes AA.
Use WebAIM's checker for single pairs and site-wide crawling for coverage, then re-run checks after theme changes to catch regressions.
Color contrast analyzers measure the contrast ratio between your text and background colors against WCAG AA (4.5:1 for normal text) and AAA (7:1) thresholds. Most failures come from four familiar culprits: blue, red, purple, and gray. This guide gives per-pair pass/fail verdicts with hex examples, plus how to handle text over photos.
What does a color contrast analyzer actually measure?
A color contrast analyzer measures the ratio between the lightness of two colors, expressed as a number like 4.5:1. It does this by calculating each color's relative luminance, then dividing the lighter value by the darker one. The result tells you whether text or UI elements are readable against their background under WCAG 2.2.
Relative luminance in plain terms
Relative luminance is a 0 to 1 measure of how bright a color appears to the human eye, weighted toward green because our eyes perceive it as brighter than red or blue. Two colors can look distinct to you yet land on nearly identical luminance values, which is why a pale gray button on white can pass a visual gut check and fail a WCAG check. The analyzer removes the guesswork by comparing those luminance values directly.
The WCAG 2.2 thresholds: 3:1, 4.5:1, 7:1
WCAG 2.2 sets three ratios. Normal body text needs 4.5:1 to meet AA (criterion 1.4.3), large text of 18pt or 14pt bold needs 3:1, and UI components like form fields and focus indicators need 3:1 (criterion 1.4.11), all per the W3C's Understanding WCAG 2.2 docs and the W3C's non-text contrast doc. AAA raises normal text to 7:1. Tools like Accessibird's accessibility analytics track these ratios across your pages over time, so a designer's color tweak that drops a pair below threshold gets caught instead of quietly shipping.
Which blue color contrast combinations pass WCAG AA and which fail?
Blue is the most common brand color and the most common contrast failure. The math is unforgiving: WCAG AA needs 4.5:1 for body text and 3:1 for large text (18pt+ or 14pt bold). Most mid-tone blues sit between 3:1 and 4.5:1 against white, which fails body text but passes large text.
Blue on white: the classic fail
PairRatioAA body (4.5:1)AA large (3:1)#1a73e8 on #ffffff~3.6:1FailPass#0b57d0 on #ffffff~5.6:1PassPass#3b82f6 on #ffffff~3.7:1FailPass
The fix is simple: darken toward #0b57d0 or similar. A WCAG check on your live site catches these, and our fix guidance shows the closest passing shade. Need help applying it? Contact Accessibird.
White on blue: when it works
White text flips the problem. #ffffff on #3b82f6 fails at ~3.7:1 for body text, while white on #1e40af passes comfortably. Buttons with white labels need that darker blue.
Blue on gray: the double whammy
Blue on light gray (#f3f4f6) loses you a little contrast; blue on mid-gray (#9ca3af) is a guaranteed fail for any text. Darken the blue, lighten the gray, or pick one fix, not neither.
Why does red color contrast fail so often, and what fixes work?
Red on white: why brand reds fail
Most brand reds sit in the 2:1 to 4:1 range against white, below the 4.5:1 WCAG AA threshold for normal text. Pure #FF0000 scores about 4:1, and lighter tints like crimson or tomato fall further. Red also carries low luminance contrast against white because its green and blue channels are near zero, so the eye gets saturation, not brightness difference. Run the pair through the WebAIM color contrast checker by entering the hex values for foreground and background to see the exact ratio and pass/fail for normal text, large text, and UI components.
Fixes: darken the red, swap the background, or resize the text
Three fixes work in order of effort. Darken the red toward #B30000 or similar until it clears 4.5:1. Swap white for a cream or light gray background to gain a few tenths. Or keep the brand red and use it only for large text (24px, or 19px bold) where 3:1 suffices. For repeated checks across a site, contrast findings feed into ongoing analytics so fixes stay fixed.
When does color contrast purple meet AA on light and dark backgrounds?
Purple on light backgrounds
Purple is tricky on white because mid-tone violets sit right at the AA boundary of 4.5:1. Darker purples pass reliably: #5B2C87 on #FFFFFF reaches roughly 8:1, and #6A1B9A on #FFFFFF clears AA for body text. Lighter violets like #9C27B0 on white fall short for normal text, though they can still pass the 3:1 threshold for large text (18pt+ or 14pt bold). If you want a softer purple, keep it for large headings only.
Purple on dark backgrounds
Light purples work better against dark surfaces. #B39DDB on #1A1A2E passes AA for body text, and #D1C4E9 on #121212 clears it comfortably. Avoid mid-purple on mid-navy, a common pairing on SaaS sites, because both sit in the same luminance range and the ratio lands below 4.5:1. Test every purple pair with a color contrast analyzer before committing, and log the results in ongoing monitoring like Accessibird's Accessibility Analytics so fixes stay fixed.
How do you handle gray color contrast on buttons and muted text?
Gray placeholder and muted text
Gray placeholder text and muted captions fail WCAG AA more often than any other pattern. A common example: #999999 text on #FFFFFF needs 2.85:1, but AA requires 4.5:1. Darken it to #767676 (4.54:1), and it passes. For captions on light backgrounds, #595959 gives roughly 7:1, which clears AAA too. If a placeholder must stay light for design reasons, add a visible label next to it and treat the placeholder as decorative.
Gray buttons and the 3:1 non-text rule
Buttons play by different rules. Under WCAG 2.2's non-text contrast criterion, UI components like button borders, input outlines, and icons need 3:1 against adjacent colors, not 4.5:1 (W3C WAI). So a gray button with white text can pass if the gray is dark enough for the text (4.5:1) and the button edge stands out from the page background (3:1). Gray-on-gray fails when both tests miss; nudge the button fill or add a border until each pair clears its own threshold. Run every gray pair through a color contrast analyzer separately, then fold the fixes into your regular WCAG check so monitoring catches regressions. Our pricing keeps that ongoing checking affordable for small sites, as we explain in why Accessibird is so affordable.
How do you check color contrast over photos and image backgrounds?
Why automated checkers miss image backgrounds
A color contrast analyzer needs two fixed colors to compute a ratio. A photo gives it thousands of pixels, so most automated scans skip text sitting on images entirely, and your WCAG check reports a clean page that is actually failing. Treat any text-on-photo section as a manual item.
Scrims, gradients, and text shadows
The reliable fix is to guarantee the darkest and lightest pixels behind your text. A solid or gradient scrim between the photo and the text does this: sample the scrim color where the text sits, check that pair, and you have a ratio you can trust. A text shadow alone is not a substitute, because the shadow does not change the pixels directly behind the letterforms.
A scrim works only if you commit. Pick a color, note its hex value, and apply it at full opacity behind the text block, or as a gradient that reaches near-full opacity at the text edge. Then sample the actual rendered background at each corner of the text and at its center, because a gradient means those samples differ. If any sample fails AA, darken the scrim until the worst sample passes. Log the hex values you sampled and the ratios they produced, so the next designer inherits a documented decision instead of re-deriving it from a screenshot. This discipline applies whether the background is a hero photo, a product shot on a category card, or a decorative gradient in a banner, and it turns an untestable design choice into a measurable pair.
A manual sampling workflow
Screenshot the rendered section, crop the text area, and sample four points around the glyphs with a color contrast analyzer. Check the worst sample against AA. If the photo changes with a carousel or CMS upload, re-sample, since a new image can shift the background under the same text.
How does WebAIM's color contrast checker compare to running checks inside your CMS?
WebAIM's checker: fast for single pairs
The WebAIM color contrast checker is the fastest way to test one foreground/background pair, and it shows the large-text thresholds (18pt or 14pt bold) where AA drops to 3:1, which matters when you resize a failing heading instead of recoloring it. Paste two hex values, get pass/fail for AA and AAA. The limit is obvious: you supply the pairs yourself.
Checking at scale across a site
In-CMS or platform-level checking flips that trade-off. A checker that crawls your WordPress, Shopify, or custom site finds the pairs you never thought to test, like gray button text on a themed background, across hundreds of pages. Accessibird pairs its checker with monitoring so contrast regressions from theme updates get flagged, not rediscovered. The honest gap: automated scans miss text baked into images, so spot-check those with WebAIM by hand. Use both: crawl for coverage, WebAIM for judgment calls.
How do you turn one-off checks into ongoing contrast monitoring?
What to monitor and how often
Run a full WCAG check after every theme change, redesign, or major content import, since one new template can break contrast sitewide. Then spot-check the pages that change most: homepage, product pages, campaign banners, and anything editors touch weekly. New buttons and seasonal promo colors are where red-on-white and gray-on-gray sneak back in. A monthly sweep of high-traffic pages catches most regressions without a full crawl every time.
Where Accessibird fits, honestly
Accessibird's checker handles the same per-pair color tests described above, and its monitoring watches your site for contrast issues as pages change, which suits a 5,000-page shop better than manual checks. Pro starts at €20/month with EUR checkout; a Free tier exists. Where it falls short: it flags issues and gives fix guidance, but it does not rewrite your CSS, so someone on your team still applies each fix. Compared with other overlay and monitoring vendors, treat it as one component of ongoing remediation, not a finished compliance outcome.
FAQ
What contrast ratio do I need for small text to pass WCAG AA?
Small text needs 4.5:1 to meet AA under WCAG 2.2, criterion 1.4.3. "Small" means anything below 18pt regular or 14pt bold; those larger sizes only need 3:1. For AAA, the bar rises to 7:1 for the same body text. Check each foreground/background pair with an analyzer rather than trusting your eye.
Does a contrast overlay or dark mode toggle fix contrast failures?
Neither is automatic. A dark mode toggle creates a second set of color pairs, and every one needs its own passing ratio, which many themes never verify. A scrim over a photo only helps if you sample the actual rendered pixels behind the text and confirm the worst sample clears 4.5:1. Otherwise, the failure ships anyway.
What is the minimum contrast for icons and button borders?
Non-text UI components need 3:1 against adjacent colors under criterion 1.4.11. That covers button borders, input outlines, icons, and focus indicators. The catch: text inside a component still follows the text rules, so a gray button fill with white text needs 4.5:1 for the text pair plus 3:1 for the edge against the page background.
Can I use a brand color that fails contrast and still be accessible?
Often yes. Keep the failing color for large text (24px regular or 19px bold), where 3:1 is the AA threshold, and use a compliant variant for body copy. A red like #FF0000 fails at 4.5:1, but a darkened #B30000 passes. The brand stays recognizable; the failing pair just never carries small text.
