Color Contrast Checker
Free color contrast checker for web accessibility. Test WCAG 2.1 compliance for text and background color combinations. Ensure your designs are accessible to all users.
Worked example
The brand teal #0D7377 on white against all four WCAG levels
A brand colour is about to be used for body text on a white background, and the palette has to be signed off knowing which WCAG levels it reaches.
- Enter #0D7377 as the foreground and #FFFFFF as the background. The colour is read as red 13, green 115 and blue 119.
- Each channel is divided by 255 and linearised with the WCAG curve. Red: 13/255 = 0.0510, which is 0.004025. Green: 115/255 = 0.4510, which is 0.171441. Blue: 119/255 = 0.4667, which is 0.184475.
- Relative luminance is 0.2126 x 0.004025 + 0.7152 x 0.171441 + 0.0722 x 0.184475 = 0.136789. White is 1.0.
- The ratio is (1.0 + 0.05) divided by (0.136789 + 0.05) = 5.62 to 1, which the panel prints as 5.62:1.
- Reading the four rows: AA normal text needs 4.5 and passes, AA large text needs 3 and passes, AAA large text needs 4.5 and passes, AAA normal text needs 7 and fails.
- For calibration, #767676 on white gives 4.54 to 1, the classic grey that just clears AA normal text, and #595959 gives 7.00 to 1, which clears AAA.
- Taking the teal darker to #0A5C5F raises the ratio to 7.75 to 1, which passes AAA normal text as well and keeps the hue.
Result: At 5.62 to 1 the teal is safe for large text at every level and passes AA for body text, but it fails AAA for normal text. Darkening it to about #0A5C5F reaches 7.75 to 1 and passes all four rows, at the cost of a visibly darker brand colour.
How to use Color Contrast Checker
- Enter foreground color
- Enter background color
- View contrast ratio
- Check WCAG AA/AAA compliance
- Adjust colors to meet standards
Common mistakes
Checking a text colour that is semi-transparent in the real design.
Alpha is composited before the maths: a translucent foreground is flattened onto the background, and a translucent background is first flattened onto white because nothing else is behind it here. If the page has a photo or a coloured block behind the text, the ratio shown is not the ratio users see, and the result says so when alpha is involved.
Treating every heading as large text.
WCAG 2.1 defines large text as at least 18pt (24px), or at least 14pt (18.66px) when bold. A 20px heading is normal text for this purpose and needs 4.5 to 1, not 3 to 1.
Checking one colour pair and applying the verdict to the whole design system.
A ratio belongs to a pair of colours, not to a colour. Check hover, focus, disabled, placeholder and dark-mode pairs separately, because a teal that passes on white can fail on a light grey card.
Typing a colour name such as teal or a system keyword.
Only hex (#rgb, #rgba, #rrggbb, #rrggbbaa), rgb() and rgba() and hsl() and hsla() are parsed, in comma or space syntax, with percentages and a slash before alpha. Anything else returns an error naming the accepted forms rather than silently failing.
Features
- WCAG 2.1 AA/AAA testing
- Real-time contrast ratio
- Color picker integration
- Text preview
- Accessibility recommendations
Limits worth knowing
- Thresholds are the WCAG 2.1 ones: 4.5 to 1 for AA normal text, 3 to 1 for AA large text, 7 to 1 for AAA normal text and 4.5 to 1 for AAA large text.
- Relative luminance uses the WCAG formula with the 0.03928 breakpoint and the 0.2126, 0.7152 and 0.0722 weights. APCA, which WCAG 3 drafts use, is not implemented.
- A translucent background is flattened onto white because the tool has no page context, and the result states that when alpha is involved.
- No named colours, no eyedropper, no colour-blindness simulation and no automatic suggestion of the nearest passing shade; the swap button and the live preview are how alternatives are compared.
- The live preview renders at a few fixed sizes, so it demonstrates the thresholds rather than reproducing your actual typography.
When to use it
- A web designer checking if their color palette meets accessibility standards
- A developer ensuring WCAG compliance before launch
- A brand team validating that their colors work for all users
Practical tips
- WCAG AA requires a contrast ratio of at least 4.5:1 for normal text
- Large text (18px+ bold or 24px+) only needs 3:1 ratio
- Test your colors in both light and dark modes
- Consider colorblind users — dont rely on color alone to convey information
When this is not the right tool
- The colours exist only in a screenshot or on a live page, or APCA scoring is required. — a browser or design-tool eyedropper to obtain the hex values first, and an APCA-specific checker when the target is the newer contrast model, because the two formulas disagree on dark colours.
Frequently asked questions
What is WCAG?
Web Content Accessibility Guidelines — international standards for making web content accessible to people with disabilities.
What ratio do I need?
AA requires 4.5:1 for normal text and 3:1 for large text. AAA requires 7:1 and 4.5:1 respectively.
Why does contrast matter?
About 1 in 12 men and 1 in 200 women have color vision deficiency. Good contrast helps everyone read your content.
Related tools in Developer Tools
- JSON Formatter — Free JSON Formatter and Validator — beautify, minify, validate, and debug JSON data instantly.
- Base64 Encoder/Decoder — Free Base64 Encoder and Decoder — convert text, files, and images to Base64 encoding and back.
- URL Encoder/Decoder — URL Encoder/Decoder converts special characters to percent-encoded equivalents.
- HTML Entities Encoder/Decoder — Free HTML Entities Encoder and Decoder — convert special characters to safe HTML entities and back.
- Regex Tester — The Regex Tester lets you write, test, and debug regular expressions in real-time with match highlighting and capture group display.
- Timestamp Converter — The Timestamp Converter converts between Unix timestamps and human-readable dates.
- File Encryptor — Encrypt a file with AES-256-GCM, using a key derived from your password with PBKDF2-SHA256.