Low contrast is the most common accessibility problem on the web. It affects people with low vision, colour blindness or ageing eyes, and anyone reading a phone in sunlight. The fix is usually small, often just a slightly darker shade, but you need a number to know when you have gone far enough. This checker gives you that number and shows the nearest colours that pass.
How the ratio works
WCAG compares the relative brightness (luminance) of the two colours. The result runs from 1:1, the same colour twice, to 21:1, black on white. The scale is not linear: 3:1 already looks clearly different, while 4.5:1 is comfortable for paragraphs of text.
A worked example
Say your design uses grey text #6b7280 on white. The ratio is 4.83:1, so it passes AA for body text but fails AAA. Click the AAA suggestion and you get a darker grey of the same hue that reaches 7:1. You keep the look and gain readability.
What the checks mean
- Normal text (AA 4.5:1 / AAA 7:1): paragraphs, labels, links and button text.
- Large text (AA 3:1 / AAA 4.5:1): headings and other big text.
- UI and graphics (3:1): icons, input borders, focus rings and chart lines. These need contrast against whatever they sit on.
Beyond the ratio
Contrast alone isn’t everything. Don’t rely on colour alone to show meaning: add an icon or text to error states. Also check hover, focus and dark-mode colours, as they are easy to forget.
How to use the Color Contrast Checker
- Enter the text colour and background colour, or pick them with the colour swatches.
- Read the ratio and the five WCAG checks: normal text, large text and UI elements.
- Look at the preview to see real text sizes in your colours.
- If a check fails, click a suggested AA or AAA colour to apply it and copy its HEX.
- Use ⇄ to swap text and background.
Features
- WCAG 2.2 contrast ratio, rounded down so a near miss never shows as a pass.
- Checks for AA and AAA normal text, AA and AAA large text, and 3:1 for icons and borders.
- Fix suggestions that keep your hue and adjust only lightness, using OKLCH.
- Handles translucent text colours by blending them over the background first.
- Accepts HEX, rgb(), hsl(), oklch() and colour names.
Frequently asked questions
What contrast ratio do I need?
WCAG level AA asks for 4.5:1 for normal text and 3:1 for large text and for icons, borders and focus indicators. Level AAA asks for 7:1 and 4.5:1. Most laws and accessibility audits use AA as the target.
What counts as large text?
At least 24px (18pt) at normal weight, or about 18.66px (14pt) when bold. Headings usually qualify; body text, captions and buttons usually do not.
Why does my light grey text fail?
Light grey on white is one of the most common failures. #9ca3af on white is only about 2.5:1. Darkening it to around #6b7280 reaches 4.8:1 and passes AA while still looking grey.
Does contrast apply to placeholder and disabled text?
Placeholder text should meet 4.5:1 because people need to read it. Disabled controls are exempt under WCAG, but they still need to be recognisable, so don’t make them invisible.
Written by Dewan Razib