Contrast Fixer
Runs in your browser — your text is not sent anywhere to use this tool.
Save this tool
Keep Contrast Fixer handy
Use your browser's Share menu, then “Add to Home Screen”.
A colour contrast fixer — the nearest accessible colour that passes WCAG AA.
- Enter the text colour and the background colour that are failing.
- Pick the WCAG level you need — AA is the usual target for body text.
- Choose which colour may change, or let it move whichever is closer.
- Copy the suggested colour, or pick a different option from the list.
Now
Nearest fix
Other options
About this tool
Knowing a colour pair fails is only half an answer. This is the contrast fixer for the other half: give it a failing pair and it returns the nearest accessible colour that passes. A contrast checker tells you 3.1:1 is not enough and leaves you guessing at shades until something sticks — which is how brand colours quietly turn into whatever passed first. This finds the nearest colour that works. It moves lightness and nothing else, so your hue and saturation survive: the result is recognisably the colour you chose, a little lighter or darker, rather than a different colour that happens to clear the bar. And it looks at every legal lightness rather than stopping at the first success, so a colour that only needs a 3% change gets a 3% change. You choose which colour is allowed to move. Brand palettes usually fix one of the two — the background is the page, or the text colour is the logo — and a suggestion that changes the wrong one is no use at all. Ask for a fix to the text, the background, or whichever is closer. All four WCAG grades are here: AA at 4.5:1 for body text, AA Large at 3:1 for headings of 18pt or 14pt bold, and the stricter AAA levels at 7:1 and 4.5:1. Everything runs in your browser.
Frequently asked questions
Why does it only change lightness?
Because contrast is a function of relative luminance, and of hue, saturation and lightness only lightness moves luminance meaningfully. Changing hue would produce a colour that passes and is not yours. Keeping hue and saturation means the fix still looks like the colour you picked.
What is the nearest passing colour?
The one that moved lightness the least. Every value from 0 to 100 is tried and the smallest change that clears your level wins, so you are never asked to go darker than necessary.
What if nothing passes?
It says so. Against a mid-grey background, AAA at 7:1 is unreachable even with pure black or pure white — no shade of any colour will do it. The honest answer then is to change the other colour, which is what the adjust option is for.
Which WCAG level should I aim for?
AA at 4.5:1 for normal body text is the legal requirement in most places, including the EU accessibility directive. AAA at 7:1 is worth targeting for long-form reading. Large text — 18pt, or 14pt bold — is allowed 3:1 at AA.
Does this replace the contrast checker?
No, it follows it. The checker tells you where you stand and against which levels; this one tells you what to do about a failure. They share the same contrast maths, so the two will never disagree with each other.
Help improve this tool
Found a bug, want a change, or need a tool we don't have?
You have an unsent draft.
Thanks — that's with us. You'll find the reply in your inbox.Go to my messages