About the Color Contrast Checker tool
Light grey text on a white background may look elegant, but many people cannot read it, especially those with low vision, colour vision deficiency or anyone using a phone in sunlight. The Web Content Accessibility Guidelines (WCAG) set minimum contrast ratios, and they are one of the most frequently failed checks in accessibility audits.
This colour contrast checker calculates the WCAG 2.1 contrast ratio between a text colour and a background colour, from 1:1 up to 21:1. It then shows pass or fail for AA and AAA with normal text, large text and user interface components such as icons, borders and form controls. A live preview displays a heading, body text, a button outline and a link in your exact colours.
If a pair fails, the tool suggests the nearest passing colours: it keeps the same hue and saturation and moves the lightness as little as possible to reach AA or AAA. Click a suggestion to apply it. You can enter HEX, rgb(), hsl() or CSS colour names, or pick from the colour swatch.
How to use Color Contrast Checker
- Enter a colour in “Text (foreground)” using HEX, rgb(), hsl() or a name, or use the colour swatch.
- Enter the “Background” colour the same way.
- Read the contrast ratio and the Pass/Fail results for each WCAG level.
- Check the live preview to judge readability by eye.
- If it fails, click a suggestion under “Nearest passing colours” to fix it.
Features
WCAG 2.1 ratio
Uses the official relative-luminance formula and never rounds a failing ratio up to a pass.
Five checks at once
AA and AAA for normal and large text, plus the 3:1 rule for UI components and graphics.
Nearest passing colours
Suggests the closest accessible text or background colour with the same hue.
Flexible input
Accepts HEX, 3-digit HEX, rgb(), hsl() and all 148 CSS named colours.
Swap button
Flip foreground and background to test dark mode combinations.
When to use it
- Check brand colours for accessibility before finalising a style guide.
- Fix low-contrast placeholder or caption text flagged by Lighthouse or axe.
- Pick a text colour that works on a coloured button or badge.
- Verify dark mode colour pairs meet WCAG AA.
- Document contrast ratios for an accessibility conformance report.
Frequently asked questions
What contrast ratio does WCAG AA require?
4.5:1 for normal text and 3:1 for large text. Non-text UI components such as input borders and icons need at least 3:1 against adjacent colours.
What counts as large text?
WCAG defines large text as at least 18 point (24px) regular or 14 point (about 18.66px) bold.
What is the difference between AA and AAA?
AA is the level most laws and policies require. AAA is stricter, needing 7:1 for normal text and 4.5:1 for large text, and is recommended where possible.
Does this use the new APCA method from WCAG 3?
No. It uses the WCAG 2.x contrast ratio, which is the current standard referenced by regulations. APCA is still a draft.
Does contrast checking cover colour blindness?
Partly. Luminance contrast helps everyone, but you should also avoid using colour alone to convey meaning, for example by adding icons or text labels.