Skip to content
Icons and graphics

Color Contrast Checker

Check text and background colours against WCAG 2.2 AA and AAA, and get the closest colour that passes.

Last checked

Colours

Examples

Contrast ratio

4.54: 1

  • PassAA, normal text (4.5:1)1.4.3, under 24 px or 19 px bold
  • PassAA, large text (3:1)1.4.3, 24 px or 19 px bold and up
  • FailAAA, normal text (7:1)1.4.6
  • PassAAA, large text (4.5:1)1.4.6
  • PassUI parts and graphics (3:1)1.4.11, icons, borders, focus rings

APCA Lc 71.6, for reference only: pass and fail above follow WCAG 2.2.

Preview

Large text, 24 px

Normal text, 16 px. The quick brown fox jumps over the lazy dog.

Button

Closest colours that pass

  • AAA text: #5959597.00:1

Change either the text or the background. Hue and chroma stay as they are (in OKLCH); only the lightness moves, so the fix still reads as the same colour.

How to use it

  1. Type, paste or pick the text colour and the background colour. Any CSS colour format works, including oklch() from Tailwind v4.
  2. Read the ratio and the five checks. Green means the pair meets that level.
  3. If a check fails, use the closest text or background colour that passes, or copy the link to share the pair.

What it checks and why

WCAG 2.2 sets minimum contrast between text and its background. Normal text needs 4.5 to 1 for level AA and 7 to 1 for AAA. Large text, which is 24 px or 19 px bold and up, needs 3 to 1 for AA and 4.5 to 1 for AAA. Icons, borders of form fields and focus rings need 3 to 1 against what is next to them (success criterion 1.4.11). The tool applies those numbers to the pair you give it.

The ratio comes from relative luminance, defined in WCAG: each colour channel is converted from sRGB to linear light and weighted by how bright the eye finds red, green and blue. The ratio is the lighter luminance plus 0.05, divided by the darker plus 0.05. A pair at 4.499 does not meet 4.5, so the tool truncates to two decimals and never rounds up.

When a pair fails, the tool looks for the nearest passing text colour and the nearest passing background. It keeps the OKLCH hue and chroma of your colour and moves only the lightness, so the result still looks like your brand colour, only darker or lighter. OKLCH is used because its lightness tracks how bright a colour looks, so the hue does not drift the way it can with HSL. A mid-tone background can leave no passing option in one direction, and the tool then tries the other.

Specs and sources

Limits

  • The WCAG ratio is a known weak model for dark backgrounds and thin fonts. Some pairs that pass look hard to read. APCA, a proposed replacement, is not part of WCAG 2.2, so its Lc value is shown for reference only and pass or fail follows WCAG.
  • Colours outside sRGB, such as a vivid oklch() or display-p3 value, are brought into sRGB by lowering chroma before measuring. A semi-transparent background is measured laid over white.
  • The screen picker uses the EyeDropper API, which Chrome and Edge support and Firefox and Safari do not; there the button is hidden.
  • A transparent text colour is laid over the background before measuring. A text colour over an image or gradient needs a check at the worst spot.
  • Large text is a size rule from WCAG, not a style, so check the real font size before you rely on the 3 to 1 level.
  • Contrast is one part of readable text. Font weight, size, spacing and colour blindness matter too, and this tool does not simulate them.

Questions

What contrast ratio do I need for WCAG AA?
4.5 to 1 for normal text and 3 to 1 for large text and for UI parts such as icons and input borders. Large text is 24 px, or 19 px if bold, and bigger.
What is the difference between AA and AAA contrast?
AAA asks for more: 7 to 1 for normal text and 4.5 to 1 for large text. Most laws and policies require AA. AAA is a higher goal, and WCAG itself says it is not possible for every kind of content.
Does the contrast rule apply to logos and disabled buttons?
No. WCAG exempts logotypes, text that is part of an inactive control and pure decoration. Placeholder text in a field is not exempt, so it needs the same ratio as other text.
Why does the ratio say 4.49 when other tools say 4.5?
The tool truncates instead of rounding. WCAG sets 4.5 as a minimum, so 4.499 does not pass, and rounding up would hide a real failure.
Can I check oklch() colours, like the Tailwind v4 palette?
Yes. Paste oklch(), oklab() or color(display-p3 ...) values as they are. The tool converts them to sRGB, as a browser does on a standard screen, and measures the ratio from that.