Color Contrast Checker (WCAG).
Check text and UI color contrast against WCAG 2.2 AA and AAA, with the closest passing colors.
Runs in your browserAbout Color Contrast Checker (WCAG)
The Color Contrast Checker measures how readable a text color is on a background using the WCAG 2.x contrast formula, the one accessibility audits and Lighthouse use. Pick a text color and a background and you get the ratio, from 1:1 for identical colors to 21:1 for black on white, and a pass or fail for each success criterion: 4.5:1 for normal text and 3:1 for large text at level AA, 7:1 and 4.5:1 at level AAA, and 3:1 for icons, input borders and other user interface components. The preview renders a heading, body text, a small caption and an outlined button in your colors so you can see the result, not only the number. When a pair fails, the tool suggests the closest text color and the closest background color that reach AA and AAA, keeping the same hue in the OKLCH color space so your brand color stays recognisable. For example, Tailwind gray-500 (#6b7280) on gray-100 (#f3f4f6) gives about 4.39:1, just short of AA, and a slightly darker gray fixes it. Ratios are truncated rather than rounded, because 4.499:1 does not meet 4.5:1. Common mistakes are checking only the brand color and not placeholder or disabled text, forgetting hover and focus states, and relying on color alone to convey meaning. Semi-transparent colors are composited before measuring. Everything runs in your browser.
How to Use
- Choose the text color and the background color.
- Read the ratio and the AA / AAA results; the preview updates live.
- If it fails, copy one of the suggested colors that pass.
Frequently Asked Questions
What counts as large text?
WCAG defines large text as at least 24 CSS pixels regular or 18.66 CSS pixels (14pt) bold. Large text needs 3:1 for AA instead of 4.5:1.
Why is my 4.49:1 pair marked as a fail?
The thresholds are minimums. The ratio is truncated to two decimals before comparing, so anything below 4.5 fails AA for normal text.
Does this check APCA from WCAG 3?
No. It uses the WCAG 2.x relative luminance formula, which is what current laws and audits reference. APCA is still a draft.
Is anything sent to a server?
No. The calculation and the preview are generated in your browser.
Related Tools
Convert between HEX, RGB, and HSL formats.
Turn one brand color into a Tailwind 50–950 palette, as v4 @theme, v3 config, CSS variables or SCSS.
Extract the dominant colors of an image as hex, RGB and HSL, with CSS variables or a Tailwind palette.
Build linear, radial and conic CSS gradients with a live preview, OKLCH interpolation and Tailwind output.
See your live viewport size, screen resolution, pixel ratio, active CSS breakpoints and media features.
Set each corner radius, including elliptical corners, and copy the shortest CSS or Tailwind classes.