Color contrast checker

Pick a text colour and a background, and see their contrast ratio and whether they meet WCAG 2.2 for normal text, large text and icons. When a pair falls short, the checker suggests the nearest colours that pass.

  • Free
  • No sign-up
  • Nothing uploaded
Loading the tool…
  • WCAG 2.2 AA and AAA, text and icons
  • Hex, rgb() and hsl(), see-through text too
  • Nearest passing colour, same hue
  • A link that shares the pair

How to check colour contrast

Four steps, start to finish.

  1. 1

    Pick the text colour

    Choose it in the picker or paste it as hex, rgb() or hsl(). See-through colours are checked as they look.

  2. 2

    Pick the background

    The colour behind the text. The swap button tries the pair the other way round.

  3. 3

    Read the checks

    The ratio, then pass or fail for normal text, large text and icons, at AA and AAA.

  4. 4

    Fix what fails

    Take the nearest text or background colour that passes, then copy the pair as CSS or share the link.

What the contrast ratio means

The Web Content Accessibility Guidelines (WCAG), published by the W3C, measure how readable text is against its background with a contrast ratio: the relative luminance of the lighter colour plus 0.05, divided by that of the darker one plus 0.05. It runs from 1:1 (the same colour) to 21:1 (black on white). Relative luminance is a colour's brightness as the eye sees it, which is why yellow looks far lighter than blue at the same strength.

WCAG 2.2 minimum contrast
WhatAAAAA
Normal text4.5:1 (1.4.3)7:1 (1.4.6)
Large text: 18 pt, or 14 pt bold3:1 (1.4.3)4.5:1 (1.4.6)
Icons, input borders and other graphics3:1 (1.4.11)No AAA level

On screens, 18 pt is 24 pixels and 14 pt is about 18.67 pixels, the sizes the checker's preview uses. Level AA is the level the US rule below points to; AAA is stricter.

Why the ratio isn't rounded

The W3C's guidance says computed values should not be rounded: 4.499:1 does not meet 4.5:1. So the checker passes or fails a pair on the exact ratio, and shows it cut (not rounded) to two decimals. Mid grey #777777 on white comes to 4.47:1 and fails AA for normal text; #767676, one step darker, comes to 4.54:1 and passes.

Fixing a pair that fails

When a pair falls short, the checker offers the nearest text colour and the nearest background colour that reach AA or AAA. It keeps the colour's hue and saturation and moves only its lightness, in the OKLCH colour space, lighter or darker, whichever changes the colour less. So a brand orange that fails becomes a deeper orange that passes, not a different colour.

  • Change the text first. A darker text colour on a light background is usually less noticeable than a new background.
  • Check every pair you use: body text, links, buttons, placeholder text and text on coloured panels.
  • Text over a photo has no single background colour. Check it against the lightest and the darkest parts, or put the text on a solid panel.
  • See-through text is checked as it looks over the background, since that is the colour a reader sees.

Building a set of colours? The color palette generator shows how readable white and black text are on each colour. Here, the two colours are kept in the page's address, so you can send the pair you checked to a colleague or keep the link with your design notes.

Contrast and accessibility rules

In the United States, the Department of Justice's rule for state and local governments sets WCAG 2.1 Level AA as the standard for their websites and mobile apps; an interim final rule published in April 2026 moved the compliance dates to April 26, 2027 for larger governments and April 26, 2028 for smaller ones and special districts. For businesses open to the public, the Department's web guidance says the ADA applies but there is no regulation with detailed standards, and it names colour contrast in text among the things to get right.

In the European Union, the European Accessibility Act covers products and services such as e-commerce, banking services and e-books, alongside computers, phones and ticketing machines. What it asks of a given product or service is set by the Act and the national laws that carry it out, so check the rules for yours. A contrast check is one step towards them.

Updated

Color contrast checker: common questions

What people ask before they use it.

What contrast ratio do I need?

For WCAG AA: 4.5:1 for normal text, 3:1 for large text (18 pt, or 14 pt bold) and 3:1 for icons and the borders of controls. AAA asks 7:1 for normal text and 4.5:1 for large text.

Is 4.49:1 close enough to pass?

No. WCAG compares the exact ratio, without rounding, so anything under 4.5:1 fails AA for normal text.

Can I check transparent colours?

Yes, for the text: type an rgba() value or an 8-digit hex, and it is checked as it looks over the background.

How do I share the colours I checked?

Copy the page's address: both colours are in the link, so whoever opens it sees the same pair.

Does passing the checks make my site compliant?

Not on its own. Contrast is one of many WCAG success criteria; a site needs to meet all of the ones that apply to it.