How to check contrast
- Enter the Text color and the Background color, with the color pickers or as HEX, rgb(), hsl() or a color name.
- Read the contrast ratio and its rating, and check the pass or fail results for normal text, large text and interface components.
- Look at the live preview to see the pair on headings, body text, small print and a button. ⇅ Swap colors exchanges text and background.
- If a level fails, use one of the suggested colors: they are the closest versions of your color that pass.
What is a contrast ratio?
The contrast ratio compares how bright two colors are, from 1:1 (the same color) to 21:1 (black on white). It is calculated from the relative luminance of each color, as defined in the Web Content Accessibility Guidelines (WCAG). Higher means easier to read, especially for people with low vision or on a phone in sunlight.
WCAG contrast requirements
| Content | Level AA | Level AAA |
|---|---|---|
| Normal text | 4.5:1 | 7:1 |
| Large text (24px+, or 18.66px+ bold) | 3:1 | 4.5:1 |
| Icons, borders and form controls | 3:1 | — |
Most laws and company guidelines ask for AA. A ratio passes only if it meets the number exactly or above: 4.49:1 fails AA for normal text, so this checker never rounds up.
How the suggested fix works
When a pair fails, the checker keeps the hue and saturation of your color and moves only its lightness, step by step, until it finds the closest version that passes. Your color stays recognisably the same, just lighter or darker.
FAQ
Does this support transparent colors?
Not yet. Transparency is ignored, so enter the final color as it appears on screen.
Is this the same formula as WCAG 3 / APCA?
No. This checker uses the WCAG 2 formula, which is the one current accessibility rules refer to. APCA is a newer method that is still a draft.
Why does white text fail on my bright brand color?
Mid-tone colors such as orange, light green or sky blue are about halfway between black and white in brightness, so neither white nor black text gets much contrast. Use a darker shade of the brand color behind white text, or switch to dark text.
Do logos need to pass?
No. WCAG makes an exception for logos and brand names, and for text that is purely decorative or part of a disabled control.