Passing WCAG Contrast Without Redesigning
By toolbelt maintainers ·
Updated
Your brand colour fails AA and the designer will not change it. Here is how to find the smallest shift that passes.
What is this tool?
Contrast ratio measures the luminance difference between text and its background, from 1:1 to 21:1. WCAG asks for 4.5:1 for normal text and 3:1 for large text.
How it works
I compute relative luminance using the WCAG formula, which accounts for how the eye perceives brightness rather than using raw RGB values, then report the ratio and pass or fail for each level.
Example
#777777 on #FFFFFF → 4.48:1 (fails AA by a hair) #767676 on #FFFFFF → 4.54:1 (passes) Two hex digits darker, and it passes.
When to use it
Every colour decision that involves text. Cheapest at design time; most expensive after an accessibility audit.
Optimization Tips
Move lightness, not hue, when you need to pass. Nudging a colour darker preserves the brand recognition that changing the hue would destroy. And test the state variants — the hover colour often fails even when the base passes.
Frequently Asked Questions
What is "large text"?
Does AA cover everything?
Why does an "accessible" palette still fail here?
Should I worry about dark mode?
Related tools
- HTML PreviewLive-render HTML, CSS, and JavaScript in a secure, isolated iframe. Test UI snippets, prototype components, and view results instantly without leaving the browser.
- OG PreviewerPreview how links look on social media. Test Open Graph and Twitter Card meta tags for Twitter, Facebook, LinkedIn, and WhatsApp to optimize click-through rates.
- JSON ValidatorValidate JSON syntax with detailed error messages. Catch trailing commas, missing brackets, and syntax errors instantly before sending payloads to your API.
- JSON FormatterBeautify, validate, minify, and view JSON. Format messy API responses into readable code or compress it to save bandwidth, running safely in your browser.