How to use this contrast checker
Set the two colors your design actually uses: the text color on the left, the background it sits on to the right. Use the color swatches for a quick pick or type exact HEX codes from your stylesheet — both stay in sync. The ratio and the four WCAG grades update as you type, and the live preview at the bottom shows your pair as a headline and a paragraph, because a ratio is an abstraction but a hard-to-read sentence is not. If you are testing the reverse combination — light text on a dark panel — the Swap button flips the pair in one click, though the ratio itself will not change.
Read the grades by the text you are checking. Body copy, captions and buttons are normal text, so the AA normal card is the one that matters; headlines of roughly 24 pixels or more (19 if bold) may use the large-text column. Most professional work targets AA everywhere and AAA for long-form reading text where the palette allows it. When a pair fails, do not abandon the color: keep the hue, lower the lightness of the text a few steps at a time, and watch the ratio climb. Our Color Picker shows the tints and shades of any color, which turns that walk into a single click per step.
Check every real combination, not just the obvious one. Text sits on hover states, disabled buttons go pale, footers invert the scheme, and charts put labels on colored segments. Each of those is a separate pair with its own ratio, and accessibility audits fail on the pair nobody tested. It takes ten seconds per pair here — far cheaper than redesigning after a complaint.
Example: this site's blue on white
The blue WordToolNest uses for its buttons and links, #2563EB, on a plain white background:
That is a realistic, healthy result: comfortable for body text under the standard most sites are held to, short of the strictest level. Compare the famous edge case #767676 on white — at 4.54:1 it is the lightest grey that still passes AA for normal text, while one step lighter, #777777 at 4.48:1, fails. And vivid is not the same as readable: tomato red #FF6347 on white manages only 2.95:1, failing every grade despite looking bold. Brightness difference, not color intensity, is what the ratio measures.
How the ratio is calculated
WCAG first converts each color's red, green and blue channels from their screen values into linear light values, undoing the gamma curve screens apply. It then blends them into a single number called relative luminance, weighting green most heavily (0.7152), red next (0.2126) and blue least (0.0722), because human eyes are far more sensitive to green brightness than to blue. The ratio is the lighter luminance plus 0.05, divided by the darker luminance plus 0.05 — the small constant keeps the math sane near black. Identical colors give exactly 1:1; pure black against pure white gives the famous 21:1 ceiling. This checker performs the full WCAG 2.1 calculation, the same one auditors and browser developer tools use.
Designing with contrast from the start
Contrast failures are usually born at palette time, not at audit time. When you choose a brand color, immediately test it on white, on black and on your lightest background tint, and record the darkest shade of it that passes AA — that shade becomes your text-safe version, while the pure color stays free for large headings, icons and decorative shapes. Keep placeholder text, disabled states and footnotes honest too: they are exempt from the strictest reading of the rules in some cases, but real users still have to read them. A palette with tested pairs is a design asset; a palette of untested swatches is a future bug report. The two minutes per color happen once — the readability is enjoyed on every visit.
Frequently asked questions
What is a contrast ratio?
It is a number from 1:1 to 21:1 that expresses how different two colors are in perceived brightness. 1:1 means identical colors — completely unreadable. 21:1 is black on white, the maximum possible. WCAG measures this brightness difference, called relative luminance, after correcting each RGB channel for how screens actually display it.
What contrast ratio do I need for WCAG AA?
For level AA, normal text needs at least 4.5:1 and large text needs at least 3:1. Large text means at least 24 pixels, or about 19 pixels if bold. AA is the level most laws, procurement rules and style guides ask for, so it is the practical target for most websites.
What about WCAG AAA?
AAA is the stricter level: 7:1 for normal text and 4.5:1 for large text. It is designed for readers with stronger vision impairments. Many design systems aim for AAA on body text where possible, but it is not legally required in most places, and some brand colors simply cannot reach it on white.
Why does a bright color like tomato red fail on white?
Because contrast is about brightness, not vividness. Tomato (#FF6347) looks bold, but its perceived brightness is fairly high, so against white it scores only 2.95:1 — below even the large-text threshold. A color can be loud and still be hard to read, especially for older eyes and in bright sunlight.
My pair fails. How do I fix it without changing the brand?
Keep the hue and change the lightness. Darken the text color step by step (or lighten it on dark backgrounds) until the ratio passes — the color family stays recognizably yours. Our Color Picker shows tints and shades of any color, which makes walking darker or lighter a one-click job.
Does the ratio change if I swap text and background?
No. The formula is symmetric — it always divides the lighter luminance by the darker one — so white text on blue scores exactly the same as blue text on white. Readability in practice can differ slightly because light text on dark can bloom on some screens, but the WCAG number is identical.
Do icons, borders and form outlines need contrast too?
Yes, under WCAG's non-text contrast rule, interface components and meaningful graphics need at least 3:1 against adjacent colors — input borders, focus indicators, toggle states and essential icons included. Purely decorative elements are exempt.
What counts as large text exactly?
WCAG defines large text as at least 18 point (about 24 CSS pixels), or at least 14 point (about 19 CSS pixels) when bold. Headlines usually qualify; body text, captions, footnotes and buttons usually count as normal text and must meet the stricter ratio.
Is anything I check uploaded or tracked?
No. The luminance and ratio calculations run in JavaScript in your own browser. Colors you enter are never sent to a server or stored anywhere — closing the tab clears everything.