WCAG Contrast Checker
Check WCAG 2.1 AA and AAA color contrast ratios between foreground and background colors with live preview cards locally in your browser.
Normal body copy needs at least 4.5:1 for WCAG AA and 7.0:1 for AAA compliance.
About this tool
Each sRGB channel is linearized to compute relative luminance L = 0.2126 R + 0.7152 G + 0.0722 B, and contrast ratio equals (Lmax + 0.05) / (Lmin + 0.05) per W3C WCAG 2.1. Validate button labels, muted captions, and badges before handoff.
How to use the WCAG contrast checker
- Enter the text colour in the Foreground box, as a HEX value.
- Enter the background colour in the Background box.
- Read the contrast ratio and the AA and AAA results for normal and large text.
- Use Swap colors to reverse the pair, and copy the ratio for a design review.
What the contrast ratio means
The contrast ratio compares the brightness of the text with the brightness of its background. It runs from 1 to 21. A ratio of 1 means no difference, and 21 means black on white. The Web Content Accessibility Guidelines set minimum levels: 4.5 to 1 for normal body text at level AA, 3 to 1 for large text, and 7 to 1 for normal text at level AAA.
People with low vision, colour blindness, or who read on a bright or dim screen, rely on enough contrast to read text. Meeting AA is the usual target for public websites.
A worked example
Blue #1d4ed8 on white gives a ratio of about 6.7 to 1. That passes AA for normal and large text, and misses AAA for normal text. Light grey #767676 on white gives about 4.5 to 1, which just passes AA for normal text and is a common choice for captions.
- Check a button label against its background before you release a new theme.
- Confirm that the grey hint text in a form still passes AA.
Who uses a contrast checker
- Designers checking palettes before they go into a design file.
- Developers testing colour tokens in a stylesheet.
- Accessibility reviewers auditing a site or an app.
- Content editors choosing readable colours for banners.
- Anyone whose text is hard to read on a screen.
Tips and limits
- The ratio checks colours only. Font size, weight and layout also affect how readable text is.
- Non-text elements such as icons and borders have their own minimum of 3 to 1.
- Gradients and images behind text need to be checked at the lightest and darkest points.
- A tool result is a guide. Test with real users when a product depends on reading.
- The calculation is made in your browser, and no colour is stored or sent.
Frequently asked questions
Related browser tools
Aspect Ratio Calculator
Calculate simplified aspect ratios via GCD, scale pixel dimensions proportionally, and copy CSS aspect-ratio rules in your browser.
Box Shadow Generator
Design soft CSS box shadows visually with X/Y offset, blur, spread, opacity, and inset controls locally in your browser.
Color Converter
Convert colors between HEX, RGB, HSL, and CSS OKLCH with a live swatch preview and RGB sliders locally in your browser.