Kerbly

Color contrast checker for WCAG 2.2

Pick a text colour and a background. See the ratio, whether it passes AA and AAA, the closest colours that do, and how it looks with colour-blindness. Free, instant, and nothing leaves your browser.

Your colours

#777777 · rgb(119, 119, 119) · hsl(0, 0%, 47%)

#ffffff · rgb(255, 255, 255) · hsl(0, 0%, 100%)

Try an example

Result

4.48:1

Passes only for large text and UI parts

Contrast ratio 4.48 to 1. Passes only for large text and UI parts.

  • AA, normal text

    Needs 4.5:1 · Body text and most labels. The level most laws and policies ask for.

    Fail
  • AA, large text

    Needs 3:1 · Text from 24px, or 18.66px and bold.

    Pass
  • AAA, normal text

    Needs 7:1 · The enhanced level. Worth aiming for on long reading.

    Fail
  • AAA, large text

    Needs 4.5:1 · Large text at the enhanced level.

    Fail
  • Buttons, icons and borders

    Needs 3:1 · Parts of controls and graphics you need to see (WCAG 2.2, 1.4.11).

    Pass

Fix it: the closest colours that pass

Same hue, smallest change. Pick one to try it in the preview above.

Change the text colour

  • Darker text: #767676

    4.54:1 · keeps the same hue, moves less than 1 point of lightness

Or change the background

  • Darker background: #060606

    4.52:1 · keeps the same hue, moves 98 points of lightness

How it looks with colour-blindness

About 1 in 12 men and 1 in 200 women have some form of colour-vision deficiency. These previews are an approximation, and the ratio is measured on the simulated colours.

  • Protanopia

    No red cones. Reds look dark and muddy.

    4.48:1Below AA
  • Deuteranopia

    No green cones. The most common type.

    4.48:1Below AA
  • Tritanopia

    No blue cones. Rare. Blues and yellows blur together.

    4.48:1Below AA
  • Greyscale

    No colour at all. Only lightness is left.

    4.48:1Below AA

What the numbers mean

WCAG measures how different two colours are in brightness, on a scale from 1:1 (identical) to 21:1 (black on white). Which number you need depends on what you are colouring.

WCAG contrast ratios by level and use
LevelMinimum ratioApplies to
AA, normal text4.5 : 1Body text, labels, links, placeholder text and most small text.
AA, large text3 : 1Text from 24px regular, or from 18.66px bold.
AAA, normal text7 : 1The stricter level. Worth aiming for on long articles and for low-vision readers.
AAA, large text4.5 : 1Large text at the stricter level.
Buttons, icons, borders3 : 1The visible edges of inputs and buttons, icons that carry meaning, chart lines and focus rings.

How the ratio is worked out

Each colour gets a relative luminance, a number from 0 (black) to 1 (white) that weights green most and blue least, because that is how bright they look to the eye. The ratio is then (lighter + 0.05) ÷ (darker + 0.05). The 0.05 stops the maths blowing up near black. This is the formula in WCAG 2.x, so the answer matches the other well-known checkers, with one difference: this tool never rounds a failing result up over a pass mark.

Mistakes we see on real websites

A scan finds these across a whole site. See the guide to the “color-contrast” error for the exact fix.

Popular colour combinations, checked

Common pairs from design systems and websites, with the real numbers.

Questions people ask

What is a good colour contrast ratio?

For normal text, at least 4.5:1 to meet WCAG level AA, and 7:1 for the stricter AAA level. For large text (24px, or 18.66px and bold) the limits are 3:1 for AA and 4.5:1 for AAA. Parts of buttons, icons, form borders and charts need 3:1 against what is next to them.

Is 4.5:1 contrast required by law?

No law names a ratio for every website, but WCAG level AA (4.5:1 for normal text) is the level that rules and settlements point to. Examples are the EU's EN 301 549 standard and the US Department of Justice rule for state and local governments, which both reference WCAG 2.1 AA. The ADA itself does not set a number for private businesses, though courts and settlement agreements generally use WCAG AA. This is general information, not legal advice.

Did WCAG 2.2 change the contrast rules?

No. WCAG 2.2 keeps the same contrast thresholds as 2.1: 4.5:1 and 3:1 for text, 7:1 and 4.5:1 for the enhanced level, and 3:1 for interface components and graphics. The new 2.2 rules are about other things, such as focus visibility and target size.

How is the contrast ratio calculated?

Each colour is converted to a relative luminance from 0 (black) to 1 (white), using the sRGB formula in WCAG. The ratio is (lighter + 0.05) divided by (darker + 0.05). Black on white gives 21:1 and identical colours give 1:1. This checker never rounds a failing result up across a pass mark, so 4.499 is shown as 4.49 and does not pass.

What counts as large text?

WCAG defines large text as at least 18 point (about 24 CSS pixels) in regular weight, or at least 14 point (about 18.66 pixels) in bold. Anything smaller is normal text and needs the higher ratio.

How do I check text on top of an image or a gradient?

Test the text colour against the lightest and the darkest parts of the background behind the words, and make sure the worst case passes. Adding a solid or semi-opaque panel behind the text is the dependable fix. This tool compares two flat colours, so sample the worst spot with a colour picker and enter it as the background.

Do hover, focus and disabled states need to pass too?

Hover and focus states do, because people see and use them. Text in disabled controls is exempt from the contrast rules, as are logos and purely decorative elements, but a disabled state that is very faint can still confuse people, so keep it readable where you can.

What about APCA and WCAG 3?

APCA is a newer, different way to estimate readability that is proposed for a future WCAG 3. It is still a draft and is not what laws or audits use today. This tool uses the WCAG 2 formula that applies now.

Are my colours sent anywhere?

No. The calculation runs in your browser. Your colours are not uploaded or stored, and a shared link only carries the two colour codes in its address.

My brand colour fails on a white button. What should I do?

Keep the brand colour for large shapes and decoration, and use a darker shade of the same hue for text and small controls. The Fix it panel above finds the closest passing shade with the same hue, so the brand still looks like itself.

Checked one pair? Check the whole site.

A free scan tests every colour, label and heading on your page against WCAG 2.2 and gives you a plain-English fix list. No account needed.

No account needed. Takes about 30 seconds.