Color Contrast Checker
Test any text/background color pair against WCAG AA and AAA rules — with the real contrast-ratio math and a live preview. Free, private, no signup.
The quick brown fox jumps over the lazy dog — normal text.
Large bold text — headings pass more easily.
How to check color contrast
Contrast is the difference in perceived brightness between text and its background, measured as a ratio from 1:1 to 21:1. The Web Content Accessibility Guidelines (WCAG) set minimum ratios so text stays readable for people with low vision, aging eyes, or glare-heavy phone screens — which is nearly everyone, some of the time.
- Pick your colors — use the native pickers for speed or type exact hex codes for precision.
- Read the ratio. The big number is your WCAG contrast ratio, computed with the real relative-luminance formula.
- Check the badges. Four pass/fail verdicts: AA and AAA, each for normal and large text.
- Eyeball the preview. Numbers are the rule, but the live sample shows what your pair actually looks like.
Why gray text keeps failing
The most common failure is medium gray on white: #777777 scores about 4.48:1 — a hair under the 4.5:1 AA bar for normal text. Nudge it to #767676 or darker and it passes. The same gray at large/bold sizes passes AA large (3:1) comfortably, which is why headings get away with lighter colors.
Contrast is necessary, not sufficient
A passing ratio doesn't guarantee everyone can use your design. Red/green pairs can pass the math while remaining indistinguishable to color-blind users, and thin fonts at small sizes strain eyes even at 7:1. Treat the ratio as the floor — then never rely on color alone to carry meaning.
- What is a good contrast ratio for text?
- WCAG AA requires at least 4.5:1 for normal text and 3:1 for large text. AAA — the stricter level — requires 7:1 for normal text and 4.5:1 for large text.
- What counts as large text?
- Text at least 18pt (24px), or at least 14pt (18.66px) if it is bold. Everything smaller is normal text and needs the higher 4.5:1 ratio.
- Why is my gray text failing?
- Mid-grays on white — like #777777 at about 4.48:1 — sit just under the 4.5:1 AA bar for normal text. Darken the gray slightly (to about #767676 or darker) or make the text large or bold to pass.
- How is the contrast ratio calculated?
- Each color's relative luminance is computed from its sRGB channels using the WCAG formula, then the ratio is (lighter + 0.05) / (darker + 0.05). It ranges from 1:1 (identical colors) to 21:1 (black on white).
- Does this work for color blindness?
- Partially. A high contrast ratio helps everyone, but some color pairs that pass the ratio check are still hard to tell apart for color-blind users (red/green especially). Avoid relying on color alone to convey meaning.
- Is my input sent anywhere?
- No. The calculation runs entirely in your browser with JavaScript. Nothing is uploaded or stored.
More from the codex
Color Contrast Checker
WCAG AA/AAA contrast ratios with live preview.
Color Picker
HEX, RGB, HSL, palettes and contrast.
Open tool → LiveCSS Minifier
Compress stylesheets online.
Open tool → LiveMeta Tag Generator
SEO and social preview tags, generated live.
Open tool → LiveImage Compressor
Reduce image size online.
Open tool → LiveQR Code Generator
Make QR codes online.
Open tool → LiveReadability Checker
Flesch-Kincaid grade and style highlights.
Open tool → LiveHTML Entity Codec
Encode and decode HTML entities.
Open tool → LiveWord Counter
Count words and estimate reading time instantly.
Open tool → LiveCase Converter
UPPER, lower, Title Case and more.
Open tool → LiveRegex Tester
Test regular expressions live.
Open tool → LiveText-to-Speech Reader
Hear your essay read aloud for proofreading.
Open tool →Support the codex
This tool is free, with no account and no ads. If it saved you a trip to a search engine, consider supporting the indie dev behind it.
Questions about this tool?
Found a wrong ratio or have a suggestion? Email [email protected] — every message is read by the indie dev behind the codex.