Contrast Checker
Checks the contrast of two colors against WCAG 2.2: pass or fail for AA and AAA, body text, large text and graphics, live on real text.
Contrast ratio
18.47 : 1
- AA, body textPass
- AA, large textPass
- AAA, body textPass
- AAA, large textPass
- AA, graphicsPass
Preview
The quick brown fox
jumps over the lazy dog, followed by body text at normal size, so you can see whether this contrast is actually readable.
This contrast checker tells you whether a text color is readable enough on its background. Measured against WCAG 2.2, with an actual calculation, not by eye. You enter two hex values or pick them with the color picker. You immediately see the contrast ratio and whether it's enough for the five common WCAG levels.
It's meant for the quick check in between. Before a new text color goes into the CSS. Before a client logo lands on a light header. Before a design token goes into the code.
I built it for everyone who makes color decisions day to day without being an accessibility specialist: designers, frontend developers, freelancers placing a client logo, or anyone who just wants to check their own blog theme. It's not enough for a full accessibility audit of a website. It's built too narrow for that. That's also what makes it fast.
How it works
Two fields, foreground and background. Each one takes a hex value or the browser's native color picker. Both inputs carry their own labels for screen readers. For an accessibility tool that should go without saying, but it doesn't everywhere. The swap button flips the two colors. Handy when you want to check a combination the other way round too, say for a dark mode draft where text and background color trade roles.
Both fields want the full six-digit hex code, #RRGGBB. The tool doesn't accept the three-digit shorthand like #fff. While you type, it can't be reliably told apart from a six-digit value you've only started.
The calculation follows the WCAG 2.2 formula for relative luminance. Both colors are linearized from sRGB, then summed with weights: 0.2126 for red, 0.7152 for green, 0.0722 for blue. The two luminance values give you the contrast ratio: the lighter value plus 0.05, divided by the darker value plus 0.05. The result list checks that against five thresholds:
- AA, body text: at least 4.5:1
- AA, large text: at least 3:1
- AAA, body text: at least 7:1
- AAA, large text: at least 4.5:1
- AA, graphics and UI components: at least 3:1
The last row deliberately has no AAA column, because there isn't one. WCAG only defines contrast for icons, form borders and chart lines at level AA (Success Criterion 1.4.11, Non-text Contrast). If you're looking for a missing AAA number there, you're looking for something the standard doesn't contain.
Below the results, the preview updates live. A sentence in real ink on real paper, in exactly the colors you just entered. The sentence is the English pangram "The quick brown fox jumps over the lazy dog", so every letter is in the picture. As soon as a value slips under a threshold, the matching row in the result list flips from Pass to Fail. And the preview shows you at the same time how that actually reads.
When you need it
You'll need the tool most often when a text color for a new background has to be settled. For a button, say, or a new section in the layout. Brand palettes are worth a look too. Company colors are usually picked for the eye, not for contrast values. A red that looks good on white often sits just under 4.5:1 for body text.
Just as handy: the check before you commit a new --color token to the design system. Before it spreads into twenty components and the error shows up everywhere at once. Or when a client sends a mockup and you want to quickly check whether the suggested colors are readable at all, before you bring it up.
The readability checker is a good companion afterwards. In a separate article I explain why I built the readability checker. In accessibility, color and sentence length are more closely linked than you'd think at first glance.
And before a page goes live, it's worth running the meta checker next to the contrast check. So title and description don't get cut off mid-word in the search results.
What WCAG 2.2 actually requires
WCAG has two conformance levels, AA and AAA. Within each level it separates normal text from large text. Large doesn't mean "looks big" here.
The definition is 18 point, about 24px, at regular weight. Or 14 point, about 18.7px, in bold. Anything smaller counts as normal text and needs the stricter value (W3C, WCAG 2.2 Understanding: Contrast Minimum, Success Criterion 1.4.3).
The idea behind it: larger, heavier letterforms stay recognizable even at lower contrast. Small text doesn't forgive that.
For most websites AA is enough. It's also the level German public authorities and by now many private providers test against. AAA (Success Criterion 1.4.6) is the stricter level. It's for content where readability matters especially: long body text, public-facing forms, anything with a broad, partly older audience.
What a lot of people miss: icons, input borders, chart lines and other non-text controls have their own threshold of 3:1 (WCAG 2.2, Success Criterion 1.4.11), regardless of the text next to them.
A form with dark gray text on white can meet the text contrast easily. And still fail on a light gray input border that hardly anyone has on their radar as a separate criterion.
Another classic: light gray placeholder text in form fields. At first glance it looks clean. In the math it still often slips under every AA threshold, because design systems like to keep placeholders pale on purpose.
An example you can recalculate: #999999 on white comes out at 2.85:1. Clearly under the 4.5:1 threshold for body text, yet in a screenshot it only looks "subtly gray", not "broken". #767676 on white is just over the line at 4.54:1. That's why many style guides list it as the darkest gray that still counts as AA-safe at normal text size.
Why this isn't a nice-to-have anymore
According to the WHO, at least 2.2 billion people worldwide live with a visual impairment (WHO, Fact Sheet: Blindness and Visual Impairment). On top of that there's color vision deficiency. According to figures from Colour Blind Awareness it affects about one in twelve men and one in 200 women, around 300 million people worldwide (Colour Blind Awareness, About Colour Blindness).
For them, color contrast doesn't decide whether a website looks nice. It decides whether they can read it at all.
In Germany this now matters legally too. Since June 28, 2025, the Barrierefreiheitsstärkungsgesetz (BFSG), Germany's accessibility act, has been in force. It requires a whole range of digital services to be accessible: online shops, consumer banking services, telecom services and e-book providers are explicitly included (Barrierefreiheitsstärkungsgesetz, gesetze-im-internet.de).
Micro-enterprises are exempt for services, everyone else isn't. Color contrast is just one of many criteria, but one of the easiest to check. A WCAG check like this one is the first step, not the last.
What it can't do
The tool checks one pair of colors, not your whole website. It tells you the contrast ratio between exactly the two colors you enter, nothing more. Gradients, background images, semi-transparent overlays or text on photos don't even enter the formula. It needs two fixed sRGB values.
It also doesn't simulate color vision deficiency. A pass in this tool means the calculated contrast is right. It doesn't mean a red-green combination is equally easy to tell apart for everyone. That's a different problem, usually solved with simulators that filter an image through the specific vision deficiency.
And it doesn't find anything on its own. For a complete audit of an existing page you need a tool that runs over the real, rendered layout. One that tracks down every combination itself, not just the one you're testing right now. Ideally it also checks keyboard operation and screen reader output.
For a quick check in between, before a color goes live, this is enough. It's one of twelve tools I built for this site over time. Why and how is in my list of the twelve tools.
FAQ
- What contrast ratio does WCAG 2.2 require?
- For body text 4.5:1 at level AA and 7:1 at AAA, for large text 3:1 (AA) and 4.5:1 (AAA). Icons, input borders and chart lines have their own value of 3:1, set in Success Criterion 1.4.11. There's no AAA level for these non-text elements, the standard simply doesn't define one.
- What counts as large text?
- 18 point, so about 24 pixels, at regular weight, or 14 point, about 18.7 pixels, if the text is bold. Anything smaller counts as normal text and has to meet the stricter value. The idea behind it: larger letterforms stay recognizable at lower contrast, small text doesn't forgive that. How big something looks doesn't matter, the threshold is in the standard.
- Why doesn't the tool accept #fff?
- Both fields want the full six-digit hex code. While you're typing, the three-digit shorthand can't be reliably told apart from a long value you've only started: #fff might be finished or the start of #fff000. Type #ffffff and the checker calculates right away.
- Can I check text on a photo or a gradient?
- No. The WCAG formula needs two fixed sRGB values, and a gradient, a background image or a semi-transparent overlay doesn't have them. In those cases you measure the lightest and the darkest spot under the text separately and keep working with the worse of the two values.
- Is a check like this enough for Germany's accessibility law?
- No, it covers one criterion out of many. The Barrierefreiheitsstärkungsgesetz (BFSG), Germany's accessibility act, has applied since June 28, 2025, and requires online shops, consumer banking services, telecom services and e-book providers, among others, to be accessible. Micro-enterprises are exempt for services. Color contrast is the part you can check fastest. Keyboard operation, screen reader output and structure need a tool that runs over the rendered layout.
More tools
UTM Builder
Builds campaign URLs with the five UTM parameters and warns you live about mistakes that wreck GA4 reports, like uppercase letters or a missing campaign.
Readability Checker
Check readability with the right formula: Amstad for German, Flesch Reading Ease for English. Score, stats and your longest sentences, right in your browser.
Markdown Editor
Markdown on the left, live preview on the right. One click copies both so the formatting survives in Word, Google Docs and Gmail.
JSON-LD Generator
Generate JSON-LD from a form or check existing markup for missing required fields. 17 Schema.org types from Article to VideoObject, in your browser.