Color Contrast Checker
check WCAG color contrast ratio for accessibility compliance
Interactive Color Contrast Checker — coming soon
In development. We're still building the interactive Color Contrast Checker. The guide below explains exactly what it does and how to use it. In the meantime, here are DevLab tools that already work in your browser:
Browse all working tools →Paste a foreground hex and a background hex to get the WCAG 2.1 relative-luminance contrast ratio between them, with a clear AA/AAA pass-fail result. A practical example: white (#FFFFFF) on a medium-grey (#767676) returns exactly 4.54:1, which passes AA for normal text but fails AAA. Unlike browser DevTools, which only reports contrast for elements already rendered on a page, this tool lets you test hypothetical pairs before writing a single line of CSS.
What is Color Contrast Checker?
Color Contrast Checker computes the contrast ratio between any two colors using the WCAG 2.1 relative luminance formula. You enter a foreground color (your text or icon fill) and a background color, and the tool returns a ratio like 7.2:1 alongside a AA/AAA verdict for both normal text (thresholds: 4.5:1 and 7:1) and large text (3:1 and 4.5:1). There is no rendering step — the math runs directly on the hex or RGB values you provide.
When designers already have a mockup open, they often reach for the accessibility panel inside Chrome DevTools or the TPGi Colour Contrast Analyser desktop app, which can eyedropper directly from pixels on screen. This tool is faster when you are working from a token file or Figma spec and just need to verify a named pair like --text-primary on --surface-card before committing it to a design system. WebAIM's Contrast Checker is the closest web equivalent; the main difference is workflow integration — this one lives alongside the other devlab color tools rather than as a standalone site.
One thing that trips up developers: the WCAG 2.1 formula operates in the sRGB color space after gamma expansion, so a color that looks 50% grey visually is not at the midpoint of the luminance scale. #808080 has a relative luminance of about 0.216, not 0.5. This means intuition about which pairs will pass is unreliable without actually running the numbers, especially in the mid-tone ranges where failures are most common.
When to use Color Contrast Checker
- Verify a proposed text-on-background token pair passes the 4.5:1 AA threshold before it gets merged into a design system.
- Audit a client-supplied brand palette for accessibility compliance before the CSS variables are written.
- Confirm that a CTA button label (e.g., white on your brand's teal) clears 3:1 for its large-text classification at 18px bold.
Frequently Asked Questions
My color pair passes AA for large text but fails for normal text — what exactly counts as large?
Why does WCAG 2.1 relative luminance treat the same hex differently depending on gamma?
Does WCAG 2.1 contrast ratio apply to icons and UI borders, not just text?
Can I check semi-transparent or rgba() colors?
Is the contrast ratio algorithm here the same one WCAG 3 will use?
Related Tools
- Color Converterconvert between HEX, RGB, HSL, HSB, and CMYK color formats · Colors
- Color Palette Generatorgenerate harmonious color palettes from a base color · Colors
- Color Shades Generatorgenerate tints and shades of any color for design systems · Colors
- CSS Gradient Generatorgenerate CSS linear, radial, and conic gradients visually · CSS
Learn more
- Color Spaces Explained: RGB, HSL, HEX, and BeyondUnderstand how computers represent color. Learn the differences between RGB, HSL, HEX, HSV, and OKLCH — and when to use each one.
- Color Contrast for Developers: WCAG Rules and How to CheckLearn the WCAG contrast requirements for text, icons, and interactive elements — and how to test contrast ratios in your projects.