Colour Contrast Checker

Check text and background colours against WCAG AA and AAA, see a live preview, and get the nearest colours that pass.

Runs in your browser. Nothing is uploaded.

Preview

Large heading text

Normal body text at 16 pixels. Can you read this comfortably?

Small print at 13 pixels.

Contrast ratio

–:1

  • Normal text, AAneeds 4.5:1
  • Normal text, AAAneeds 7:1
  • Large text, AAneeds 3:1
  • Large text, AAAneeds 4.5:1
  • Icons and input bordersneeds 3:1

How to use the Colour Contrast Checker

  1. Enter the text colour and the background colour in any format, or choose them with the colour pickers.
  2. Read the contrast ratio and look at the live preview with large, normal and small text.
  3. Check the pass or fail badge for each WCAG level, normal text, large text and icons.
  4. If a level fails, click one of the suggested colours to use the nearest one that passes.
  5. Press Swap colours to check the opposite pairing, such as white text on a coloured button.

Make sure people can read your text

Text that is too close in brightness to its background is hard to read for many people: those with low vision or colour blindness, people using a phone in sunlight, and anyone with a dim or old screen. The Web Content Accessibility Guidelines (WCAG) set minimum contrast ratios so text stays readable, and many countries require them for public and commercial websites.

This checker measures the ratio between two colours, shows whether it passes each level, and suggests the closest colours that do.

How the ratio works

Contrast is calculated from the relative luminance (perceived brightness) of the two colours, giving a ratio from 1:1 (identical) to 21:1 (black on white). The guideline thresholds are:

  • 4.5:1 for normal text (AA) and 7:1 for enhanced contrast (AAA).
  • 3:1 for large text (AA) and 4.5:1 for large text (AAA).
  • 3:1 for icons, focus rings and the borders of form fields.

See it, not just the number

The preview shows a heading, body text, small print, an icon and an input outline in your exact colours, so you can judge the result with your own eyes as well as the guideline.

Fix failing colours quickly

When a level fails, the tool suggests the nearest text colour and the nearest background colour that pass, for both AA and AAA. Only lightness changes, so a brand blue stays the same blue, just darker or lighter. Click a suggestion to apply it and check the preview again.

The checker accepts HEX, RGB, HSL, OKLCH and colour names, and remembers your last pair in this browser. For whole palettes, start with the Colour Palette Generator; for converting a single colour, use the Colour Picker & Converter.

Frequently asked questions

What contrast ratio do I need?

WCAG level AA, the usual legal and practical target, needs 4.5:1 for normal text and 3:1 for large text and for icons and input borders. Level AAA needs 7:1 for normal text and 4.5:1 for large text.

What counts as large text?

At least 24 CSS pixels (18 points) of regular text, or 18.66 pixels (14 points) of bold text. Most body text, buttons and labels are normal text.

Why does 4.49 fail when it is almost 4.5?

The guideline sets a minimum, and the ratio must reach it. The tool cuts, rather than rounds, the number it shows, so a failing ratio never appears as 4.50.

How are the suggested colours chosen?

The tool keeps the hue and colourfulness of your colour and changes only its lightness, in the OKLCH colour space, until the ratio is met. It picks the smallest change, so the suggestion still looks like your brand colour.

What about transparent colours?

A semi-transparent text colour is blended with the background before the ratio is calculated. A transparent background is assumed to sit on white.

Tutorials