How to check color contrast
- Enter your text color and background color as HEX, RGB, HSL or a color name, or pick them with the color wells.
- Read the contrast ratio and the pass/fail results for each WCAG level.
- If a pair fails, click one of the suggested colors. The checker keeps the hue of your text color and only changes its lightness until the pair passes.
WCAG contrast requirements
- AA, normal text: at least 4.5:1. This is the level most accessibility laws and audits refer to.
- AA, large text: at least 3:1. Large means 24px (18pt) and up, or 18.66px (14pt) bold and up.
- AAA, normal text: at least 7:1, and 4.5:1 for large text.
- UI components and graphics: icons, input borders and focus indicators need at least 3:1 against their surroundings.
The ratio is calculated with the WCAG 2 relative luminance formula and is rounded down, so a pair shown as 4.50:1 really meets the 4.5:1 threshold. Semi-transparent text colors are blended over the background before measuring.
Tips
- Gray text on white is the most common failure:
#767676is the lightest gray that still passes AA on pure white. - Check every state: placeholder text, disabled buttons, links and hover colors.
- Use Swap to test light text on a dark background, for example on a filled button.
Build accessible color scales with the tints & shades generator; each swatch there already shows its contrast with white text.