Skip to content

Contrast Checker

Text color
60%
100%

Type any color: #3b82f6, rgb(59 130 246), hsl(217 91% 60%) or a name.

Background color
100%

A solid color. Transparency is ignored here.

Contrast ratio 3.67:1

Large text only

OK for large text, icons and borders, but normal text needs 4.5:1.

  • Fail AA Normal text 4.5:1 · 1.4.3
  • Pass AA Large text 3:1 · 1.4.3
  • Fail AAA Normal text 7:1 · 1.4.6
  • Fail AAA Large text 4.5:1 · 1.4.6
  • Pass AA UI parts & icons 3:1 · 1.4.11

Large text at 24px

Bold large text at 18.67px

Good contrast makes text easy to read for everyone, on any screen.

Small print at 14px, like captions and footnotes.

Make it pass

Change the text color

Or change the background

Only the lightness changes, so the hue and saturation stay yours. Click Use to try one.

CSS code

color: #3B82F6;
background-color: #FFFFFF;

Ratios use the WCAG 2 formula, which is what accessibility rules and audits check today. Large text means 24px and up, or 18.67px and up when bold.

Common pairs

Click one to load it

Palette checker

Up to 8 colors. Every text and background pair at once.

Contrast ratio of every pair. Rows are text colors, columns are background colors. Click a cell to load that pair.

AAA 7:1 and up AA 4.5:1 and up Large 3:1, only large text, icons and borders Fail under 3:1

Color Contrast Checker for WCAG AA and AAA

What Is Color Contrast?

Color contrast is how much a text color stands out from the color behind it. It’s measured as a ratio, from 1:1 (the same color, invisible) to 21:1 (black on white). The higher the number, the easier the text is to read.

It matters for everyone: people with low vision or color blindness, older eyes, and anyone reading a phone in bright sunlight. Light gray text can look clean on your big monitor and still be hard to read for a lot of your visitors. Here’s how four pairs score:

Aa Read me
Light gray on white 2.84:1 Fail
Aa Read me
The lightest AA gray 4.54:1 AA
Aa Read me
Dark gray on white 14.67:1 AAA
Aa Read me
Lime on near-black 12.7:1 AAA

How to Use the Contrast Checker

Five quick steps. Everything runs in your browser, and your last colors are remembered for next time.

Step 1 Enter Your Two Colors

Type or paste the text color and the background color. Any CSS color works: #1e40af, rgb(30 64 175), hsl(224 71% 40%) or a name like navy. You can also click the swatch to open your device’s color picker, or use Pick from screen (the eyedropper button, in Chrome and Edge on a computer) to grab a color from any window.

Step 2 Read the Ratio and the Checks

The big number is the contrast ratio, drawn in your own colors. Below it, five checks say Pass or Fail: AA and AAA for normal and large text, plus UI parts like borders and icons.

Step 3 Look at the Preview

The preview shows big and small text, a button, a link and an input border in your colors. Type your own sentence under it to see real words. Use the Lightness slider to nudge a color, and Opacity if your text is see-through.

Step 4 Fix It With One Click

If the pair fails, Make it pass finds the nearest text color and the nearest background that reach AA (4.5:1) or AAA (7:1). It only changes lightness, so your blue stays blue. Click Use to try one.

Step 5 Copy the CSS or Share the Pair

Copy the color and background-color lines in HEX, RGB or HSL. Copy link gives you a link that opens this exact pair, handy for a design review. Got a whole palette? Paste up to eight colors into the Palette checker to see every pair at once.

WCAG Contrast Levels, Simply Explained

The Web Content Accessibility Guidelines (WCAG) set the minimum ratios. Level AA is what most sites aim for, and many accessibility laws and policies, like Section 508 in the US and EN 301 549 in Europe, point to WCAG level AA. AAA is the stricter level.

What AA (minimum) AAA (enhanced) WCAG rule
Normal text 4.5:1 7:1 1.4.3 and 1.4.6
Large text 3:1 4.5:1 1.4.3 and 1.4.6
UI parts and graphics 3:1 No higher level 1.4.11

Some things don’t need to pass: logos and brand names, text in disabled controls, text that’s only decoration, and text that’s part of a photo full of other things.

What Counts as Large Text?

WCAG calls text “large” when it’s at least 18 point, or 14 point and bold. In CSS pixels that’s 24px, or 18.67px bold. Here’s the line, all in #8A8A8A on white (3.45:1): fine for the first two, not enough for the last one.

24px regular counts as large

18.67px bold counts as large

18px regular is normal text

A thin font (weight 300 or lighter) at the same size is harder to read. If your design uses one, give it more contrast than the minimum.

Contrast for Buttons, Borders and Icons

Text isn’t the only thing people need to see. WCAG 2.1 added Non-text Contrast (1.4.11): the edge of an input, a checkbox, a focus ring, a chart line or an icon without a label needs 3:1 against the colors next to it.

Your email Border #E5E7EB: 1.23:1, hard to find
Your email Border #767676: 4.54:1, easy to see

Buttons with a text label are easier: the label against the button color is what counts. The button’s edge against the page doesn’t need 3:1, because the words already show where the button is.

How the Contrast Ratio Is Calculated

First each color gets a relative luminance: a number from 0 (black) to 1 (white). The red, green and blue values are turned into light levels and added up with weights, because our eyes see green as much brighter than blue:

L = 0.2126 × R + 0.7152 × G + 0.0722 × B
ratio = (L of the lighter color + 0.05) / (L of the darker color + 0.05)

R, G and B here aren’t the 0-255 values: each is divided by 255 and then “linearized” (very small values are divided by 12.92, the rest are raised to the power of 2.4 after a small shift). For #767676, each channel is 118 / 255 = 0.463, which becomes 0.181. Gray has the same value in every channel, so L = 0.181. White has L = 1, so the ratio is (1 + 0.05) / (0.181 + 0.05) = 4.54:1.

WCAG doesn’t round. 4.499:1 fails the 4.5 line, which is why this checker cuts the ratio at two decimals instead of rounding it up: #777777 on white shows 4.47:1 and fails.

How to Fix Low Contrast

Before 2.54:1 After 5.16:1

Darken the text (or lighten it on dark)

Keep the hue, change only the lightness. A light blue #60A5FA becomes #2563EB and still looks like your brand. That’s what Make it pass does for you.

Before 2.8:1 After 5.17:1

Change the background instead

When the text color is fixed (white button labels, for example), move the background. Bright orange #F97316 fails with white text, a deeper #C2410C passes.

Opacity 40% Same as #999999

Don’t fade text with opacity

opacity: 0.4 or rgba(0, 0, 0, 0.4) on black text gives the same pale gray as #999999: 2.84:1 on white. It also changes with whatever is behind it. Pick a solid color that passes instead.

Common Contrast Mistakes

Pale placeholder text

Search products

Placeholder gray like #9CA3AF is only 2.53:1 on white. Placeholder text is still text people need to read, so give it at least 4.5:1, and don’t use it as the only label.

Text on a photo

No overlay Dark overlay

A photo has light and dark spots, so white text passes in one place and fails in another. Put a dark overlay (rgb(0 0 0 / 55%)) or a solid box behind the text, then check the lightest part of the photo with Pick from screen.

Light gray on white

Posted 3 days ago · 4 min read

Small gray meta text is everywhere. #AAAAAA on white is 2.32:1. Go to #767676 or darker for small text on white.

Color as the only signal

Read the terms and the privacy policy.

Contrast isn’t everything. A link shown only by color, or an error shown only in red, is missed by people who can’t tell the colors apart (WCAG 1.4.1, Use of Color). Add an underline, an icon or a word like “Error”.

WCAG 2 Contrast vs APCA

The ratio in this tool is the WCAG 2 formula, the one in current rules and accessibility audits. It’s simple and well tested, but it isn’t perfect: it can pass some dark pairs that are hard to read, and fail some pairs, like white on a mid orange, that many people read fine.

A newer method called APCA (Accessible Perceptual Contrast Algorithm) also looks at font size and weight, and gives a score like Lc 60 instead of a ratio. It has been explored in drafts of WCAG 3, which isn’t finished and may still change. Until it’s an actual standard, WCAG 2 ratios are what you’ll be checked against. Passing both is a nice bonus, but this tool doesn’t compute APCA scores.

What This Checker Can’t Do

Next steps: find a color and its shades in the HTML Color Picker, check your whole page with the HTML Accessibility Checker, or build a background with the CSS Gradient Generator (then check the lightest and darkest stops against your text here).

Frequently Asked Questions

What is a good color contrast ratio?

For normal body text, aim for at least 4.5:1. That’s the WCAG AA level most sites and accessibility rules use. Large text (24px, or 18.67px bold) only needs 3:1, and so do icons, input borders and other UI parts. If you want the stricter AAA level, normal text needs 7:1 and large text 4.5:1. Black on white is 21:1, the highest ratio there is.

How is the contrast ratio calculated?

Each color gets a relative luminance, a number from 0 (black) to 1 (white) that says how bright it looks. Green counts the most and blue the least, because that’s how our eyes work. Then the ratio is (lighter + 0.05) / (darker + 0.05). Two identical colors give 1:1, and black on white gives 21:1. This checker does the math in your browser.

What counts as large text in WCAG?

Text that is at least 18 point (24px in CSS), or at least 14 point (about 18.67px) when it’s bold. Anything smaller is normal text and needs the higher ratio. Thin or decorative fonts can be harder to read than their size suggests, so give them more contrast than the minimum.

What’s the difference between WCAG AA and AAA?

AA is the level most websites aim for and the one many laws and policies point to: 4.5:1 for normal text and 3:1 for large text. AAA is stricter: 7:1 for normal text and 4.5:1 for large text. AAA is great for long reading, but it isn’t always possible for every part of a design, so most teams treat AA as the must-have.

Does a ratio of 4.49:1 pass AA?

No. WCAG doesn’t round, so anything under 4.5:1 fails, even 4.499:1. That’s why this checker cuts the ratio at two decimals instead of rounding it up. A common example: #777777 on white is 4.47:1 and fails, while #767676 is 4.54:1 and passes.

How does the checker handle transparent text colors?

Text with opacity, like rgba(0, 0, 0, 0.6), is laid over the background first, the same way the browser paints it. The checker then measures that blended color, and shows it under the ratio. A background color has to be solid, so its transparency is ignored.

Do buttons, icons and input borders need contrast too?

Yes. WCAG 2.1 added success criterion 1.4.11, Non-text Contrast: the parts you need to see to use a control, like an input’s border, a checkbox outline, a focus ring or an icon without a text label, need 3:1 against the colors next to them. Disabled controls and pure decoration don’t have to meet it.

What is APCA, and does this tool use it?

APCA (Accessible Perceptual Contrast Algorithm) is a newer way to measure contrast that also looks at font size and weight, and treats dark text on light and light text on dark differently. It has been explored in drafts of WCAG 3, which isn’t finished. This tool uses the WCAG 2 ratio, because that’s what current rules, audits and most testing tools check.