Design tools

Color Contrast Checker

Color Contrast Checker

Check WCAG 2.2 AA and AAA contrast for text and UI, and get the nearest passing colour.

About this tool

About Color Contrast Checker

Enter a text colour and a background colour to see their contrast ratio and every WCAG 2.2 result that depends on it: AA and AAA for normal text, AA and AAA for large text, and the 3:1 minimum for icons, borders, focus rings and other user-interface parts. Ratios are compared exactly as the standard says, without rounding up, so 4.49:1 is correctly a fail. If a pair fails, the checker suggests the nearest colour that passes each level, for the text or for the background. It only changes lightness in the OKLCH colour space, so the suggestion keeps your hue and still looks like your brand. Click a suggestion to apply it. A live preview shows large text, body text, small print, buttons and an icon in your colours, so you can judge readability by eye as well as by number. Colours can be entered as HEX, RGB, HSL, OKLCH or CSS names, and everything is calculated in your browser.

Built and maintained by Abhi JainUpdated

How to Check Colour Contrast

  1. 1

    Enter the colours

    Set the Text colour and Background colour, or press Swap colours or try a preset pair.

  2. 2

    Read the results

    See the contrast ratio and the Pass or Fail result for AA, AAA and UI graphics.

  3. 3

    Fix a failing pair

    Under Nearest passing colours, click a text or background suggestion to apply it.

Color Contrast Checker: questions and answers

What contrast ratio does WCAG require?

WCAG 2.2 AA needs at least 4.5:1 for normal text and 3:1 for large text and for UI components and graphics. AAA needs 7:1 for normal text and 4.5:1 for large text.

What counts as large text?

Text that is at least 24 CSS pixels (18pt) regular, or at least 18.66 CSS pixels (14pt) bold. Everything smaller is normal text.

How is the contrast ratio calculated?

Ratio = (L1 + 0.05) / (L2 + 0.05), where L1 and L2 are the relative luminances of the lighter and darker colour. Luminance is 0.2126 R + 0.7152 G + 0.0722 B using linearised sRGB channels. The result runs from 1:1 to 21:1.

Is #767676 on white accessible?

Yes, just. #767676 on white is 4.54:1, the lightest grey that passes AA for normal text. #777777 is 4.48:1 and fails.

What about APCA and WCAG 3?

APCA is a newer contrast method proposed for WCAG 3, which is still a draft. Laws and audits today reference WCAG 2.x ratios, which is what this checker uses.