Skip to content

Plain guides to WCAG, alt text and screen readers

Contrast checker

Color contrastTopic guide

Color contrast checker

Check two colors against WCAG AA and AAA contrast ratios, and get a passing fix.

  • Free tool
  • WCAG 2.2 AA
  • Ratio to 2 decimals
  • Checked 30 Oct 2026

This color contrast checker tells you in one step whether two colors pass WCAG: body copy has to hit 4.5:1 for level AA, large text and interface parts need 3:1, and level AAA asks for 7:1. Type or pick a text color and a background color, and the result appears as you type, with the ratio shown to two decimals.

It works as a WCAG contrast checker for any website, app screen or document, and the same thresholds apply whether your team writes color or colour.

The math is the official WCAG formula, so the numbers match what auditors and browser tools report. Below the checker you will find a worked example, what each result row means, how to repair a pair that fails, and the cases where a number alone is not enough.

Quick facts

  • AA normal text

    At least 4.5:1 (WCAG 1.4.3).
  • AA large text

    At least 3:1 for 24 CSS px regular or about 18.66 CSS px bold.
  • AAA

    7:1 for normal text, 4.5:1 for large text (WCAG 1.4.6).
  • Icons, borders, focus rings

    3:1 against the colors next to them (WCAG 1.4.11).
  • No rounding up

    4.49:1 is a fail. The checker cuts the ratio to two decimals instead of rounding.
  • Lightest grey on white

    #767676 at 4.54:1 is the lightest grey that passes AA for body text.

How to use the color contrast checker, with a worked example

The tool sits right above this section. It takes two colors, each as a six digit hex value (#rrggbb), a three digit short form (#rgb), or a choice from the color picker. The sample text under the inputs repaints as you type, once in normal size and once in large size, so you can see the pair as well as measure it.

Here is a real case from an audit. A shop used a mid grey, #777777, for product descriptions on a white page. Enter #777777 as the text color and #ffffff as the background:

Product details in #777777 on white

  1. The ratio reads 4.47:1.
  2. AA normal text fails, because 4.47 is below 4.5.
  3. AA large text passes, because 4.47 is above 3.
  4. Both AAA rows fail.
  5. The UI parts and graphics row passes, so the same grey would be fine for an input border.

The grey is so close to the line that many people would call it fine by eye. The checker does not round, so it reports the fail honestly. Under the rows it then names the closest text color that passes AA for normal text, here #767676 at 4.54:1, one step darker in each channel, with a button that applies it:

Product details in #767676 on white

The suggestion only appears when the pair is below 4.5:1, and it only changes the text color. With white text on a mid blue button, for example, it may offer a dark grey text instead, because no shade of white can pass. If you want to keep white text, darken the button color yourself and test again. The checker opens with #595959 on white, which is 7.00:1, right on the AAA line.

The swap button exchanges the two colors. The ratio does not change when you swap, because contrast compares the lighter color with the darker one, whichever is on top. Swapping is still useful: it shows how a button with white text on a colored fill will look, using the same pair.

What each pass or fail row means in this accessibility color contrast checker

The checker shows five results. Each one maps to a WCAG success criterion. Only the rows that match your content matter, so a fail on an AAA row does not mean your site fails AA.

Result rows in the checker
RowNeedsUse it forCriterion
AA normal text4.5:1Body copy, links, labels, placeholder text, small buttons1.4.3, level AA
AA large text3:1Text at 24 CSS px or more, or bold text at about 18.66 CSS px or more1.4.3, level AA
AAA normal text7:1Projects that aim higher, such as reading heavy services for older users1.4.6, level AAA
AAA large text4.5:1Large headings on an AAA project1.4.6, level AAA
UI parts and graphics3:1Checkbox outlines, text field edges, keyboard focus outlines, meaningful icons and lines in charts1.4.11, level AA

Legal rules and contracts nearly always point to level AA, so the first, second and last rows are the ones to watch. For the full rule text, the size definitions and the exemptions, read the WCAG contrast ratio rules. The UI row is explained in depth in our guide to contrast for controls and graphics.

CSS pixels are the units you write in CSS, not the physical dots on a screen. A phone with a sharp screen may use three device pixels for one CSS pixel; the rule still counts CSS pixels.

How to fix a pair that fails

You rarely need a new palette. Small changes in lightness usually fix a fail while the color still looks like your brand. Work in this order:

  1. Darken the text (or lighten it, on a dark background). Keep the hue and only move lightness. This is what the checker suggestion does.
  2. If the text color is fixed, change the background instead, for example from a pale grey panel to white.
  3. If both colors are fixed by the brand, make the text large enough to count as large text, then aim for 3:1.
  4. Test again in every state: hover, focus, visited and disabled styles often use a second color that nobody checked.
Before and after examples
BeforeRatioAfterRatio
#999999 text on white2.84:1#666666 on white5.74:1
#767676 on a #f5f5f5 panel4.16:1#6e6e6e on the same panel4.67:1
White on #4a90e2 button3.29:1White on #2f6fb65.15:1
#3b82f6 link on white3.67:1#2563eb link on white5.16:1

The second row is a common trap. A grey that passes on white can fail on the light grey card that sits on the same page. Always test against the real background behind the words.

Checking colors from a design file or a live page

From a design file. Copy the hex values from the inspect panel of your design tool, not from a screenshot. Screenshots pass through the display color profile and can shift a value by a few steps. Watch for layer opacity: text set to #000000 at 60 percent opacity is really a mid grey once it is blended with the background, and that blended color is the one to test.

From a live page. The browser can measure contrast for you. In Chrome and Edge, right click the text, choose Inspect, then select the small color square next to the color property in the Styles pane. The color picker that opens shows the contrast ratio and marks AA and AAA, and it draws lines on the color area that show where passing colors begin. In Firefox, the Accessibility panel of the developer tools can check the whole page for contrast issues.

A browser extension checker scans many text elements at once, which is a fast first pass. Treat its list as a starting point. Extensions often cannot judge text over photos, gradients or video, and they miss colors that appear only on hover or focus. Our guide to WCAG checkers explains what automated tools catch and what they miss.

When a page uses CSS variables, test the computed value. Inspect the element, open the Computed tab and copy the final color, so you test what the visitor sees.

Brand colors that fail, and how to keep them

Bright brand colors are the most common reason a site fails contrast. Orange, yellow, light green and sky blue are bright, so white text on them is weak. A few real numbers:

  • White on orange #ffa500: 1.97:1, a fail for every row. Black on the same orange: 10.63:1, a pass even for AAA.
  • White on pure red #ff0000: 3.99:1, enough for large text only. A deeper red, #d32f2f, gives 4.97:1 with white.
  • Yellow #fff000 text on white: 1.18:1. Yellow works as a background for black text instead.

Black on brand orange White on deep red

The usual fix is a small set of shades for each brand color: the bright original for large shapes, illustrations and big headings, and a darker text shade for links and small labels. Logos are exempt from contrast rules, so the logo itself can stay as it is.

To check a whole palette, make a grid with your text colors down the side and your background colors across the top, run each pair through the checker, and write the ratio in each cell. Share the grid with designers so everyone picks from pairs that already pass. This is what people mean by a color palette contrast checker.

Text on images and gradients

Contrast still applies when text sits on a photo or a gradient. The checker needs one background color, so pick the worst one: for white text, the lightest spot behind any letter; for dark text, the darkest spot. Use the eyedropper in the color picker to sample that spot, then test it.

A photo of a sky with white text across it may pass on the blue and fail on a cloud. A gradient from navy to light blue may pass at the left and fail at the right. If any letter sits on a failing area, the text fails.

Reliable fixes, in order of strength:

  • Put the text on a solid panel next to or over the image.
  • Add a dark overlay between the image and the text, then test the text against the darkest overlay result on the lightest part of the photo.
  • Move the text to a calmer area of the image and lock the crop on small screens, where the image shifts.
.hero { position: relative; }
.hero::before { content: ""; position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.6); }
.hero h2 { position: relative; color: #ffffff; }

A thin text shadow alone is not a dependable fix, because the checker cannot measure it and it often fails at the edges of each letter. Text that is part of the picture itself, such as a sign in a street photo, has no contrast rule; text placed on top by the website does.

Contrast in dark mode

Dark mode is a second color scheme, so it needs a second round of checks. A pair that passes in light mode tells you nothing about dark mode.

The same colors on a dark background (#121212)
ForegroundRatio on #121212Result for normal text
#e0e0e0 off white14.19:1Passes AA and AAA
#9e9e9e grey6.99:1Passes AA, just misses AAA
#767676 grey4.12:1Fails AA, though it passes on white
#0066cc link blue3.36:1Fails AA, though it gives 5.56:1 on white
#8ab4f8 light blue8.88:1Passes AA and AAA

Many teams avoid pure white on pure black (21:1) for long text, because some readers, including many with astigmatism, see the letters glow or blur. An off white on an off black, like the first row, still passes AAA with plenty of room. Remember the borders, focus rings and icons too: they need 3:1 in both themes.

What contrast math cannot tell you

The ratio is a measure of lightness difference. It is useful and it is what WCAG requires, but it has blind spots:

  • Thin and small fonts. A hairline font at 4.6:1 passes on paper and is still hard to read. The formula knows only two sizes, normal and large.
  • Some color pairs. Many designers find white on bright orange easy to read even though it fails, and some dark pairs pass while looking muddy. Follow the number for conformance and use your eyes as a second check.
  • Hue alone. Red and green can have similar lightness, so a pair can pass while a color blind reader still cannot tell which item is the error. That is a separate rule, covered in our guide to color as the only cue.
  • States and moving content. The checker tests one pair at a time. Hover colors, focus styles, video captions and carousel slides need their own checks.

Drafts of WCAG 3 have explored a different way to measure contrast. It is not final and no law points to it. Build and test to the WCAG 2 ratios on this page.

For the exact wording of the rule, see the W3C Understanding page for 1.4.3. Contrast is only one line of an audit; the WCAG checklist shows the rest.

Contrast guides on this site

This checker is the hub for color and contrast. Each guide below covers one rule in detail, with tests and fixes.

Color and contrast guides, grouped by topic
TopicGuideWhat it answers
Text contrastWCAG contrast ratio rules4.5:1, 3:1 and 7:1, large text sizes, the formula, exemptions, a table of greys
Interface and graphicsContrast for controls and graphics (1.4.11)3:1 for the edges of fields, focus outlines, icons and charts
Meaning carried by colorColor as the only signal (1.4.1)Links, errors, required fields and charts that rely on color alone

For the wider picture, read what WCAG is and accessible web design for designers choosing colors from the start.

Questions people ask

Is this an ADA color contrast checker?

The ADA itself has no color rule. Judges and federal officials in the US tend to point to WCAG, most often 2.1 AA, and this checker tests the WCAG ratios that those settlements rely on. For what that means for your business, see the ADA website compliance guide and check your own position with a qualified lawyer.

Is there a color contrast checker Chrome extension?

Yes, several browser extensions scan a page and list low contrast text, and Chrome also shows the ratio in its developer tools color picker without any extension. Extensions are fast but they struggle with text on images and with hover or focus colors, so confirm doubtful items with a checker like this one.

Is this a WCAG color contrast checker for version 2.2?

Yes. The contrast rules stayed the same from version 2.0 through to the current 2.2, so a WCAG 2.2 color contrast checker uses the same 4.5:1, 3:1 and 7:1 thresholds. WCAG 2.1 added the 3:1 rule for interface parts and graphics, which is the last row in the results.

Why does 4.49:1 fail when it is so close to 4.5?

WCAG sets 4.5:1 as a minimum, and a minimum is not met by a smaller number. Some tools round to one decimal and show 4.5, which hides a fail. This checker cuts the value to two decimals and never rounds up.

Can I check the contrast of text on an image?

Yes, but you have to choose the background color yourself. Sample the lightest spot behind white text, or the darkest spot behind dark text, with an eyedropper, and test that color. If it fails, add a solid panel or a dark overlay behind the text.

Do I need to download anything to check contrast?

No. The checker runs inside this page in your browser and does not send your colors to a server. Browser developer tools also include a contrast reading, so there is no need for a separate download.

All Color contrast pages 1