Skip to content

Color contrast checker

Enter a text color and a background color to get the WCAG 2.2 contrast ratio, APCA Lc and a pass or fail for each level. Normal text needs 4.5:1 for AA and 7:1 for AAA; large text, buttons and input borders need 3:1. The pair is shown on a button, a card, a badge, a link and a small caption, and you can switch the view to four kinds of color blindness. Hex, rgb(), hsl(), oklch() and Tailwind names such as slate-500 all work.

WCAG 2.2 contrast ratio

4.83:1

APCA Lc

73.6

APCA 0.0.98G-4g: content text, not long body copy.

Normal text AA 4.5:1 · 1.4.3Pass
Normal text AAA 7:1 · 1.4.6Fail
Large text AA 3:1 · 1.4.3Pass
Large text AAA 4.5:1 · 1.4.6Pass
UI components 3:1 · 1.4.11Pass

Large text is 24px and up, or 18.66px (14pt) and up when bold.

The colors as chosen.
12px caption · Updated 2 hours ago

Ship the pricing page today

Body text at 16px. Every plan includes unlimited projects and email support. Read the full comparison before you choose.

Start free trialTalk to salesNew
Pro plan€29

A card with 14px text: team roles, audit log and priority support.

you@company.com

WCAG 2.2 contrast thresholds

What each level asks for, with the success criterion it comes from. Logos, decoration and disabled controls are exempt.

WhatAAAAACriterion
Normal text (under 24px, or under 18.66px bold)4.5:17:11.4.3, 1.4.6
Large text (24px and up, or 18.66px bold and up)3:14.5:11.4.3, 1.4.6
UI components and their states: button and input edges, focus rings, checkboxes3:1none1.4.11
Graphics you need to understand the content: icons, chart lines3:1none1.4.11
Color as the only way to tell things apartnot allowed1.4.1

Contrast of our 37 shadcn/ui presets

Every theme in our shadcn preset library, measured with the same code as the checker above: body text, muted text on the page, and the label on a primary button, in light and dark mode. The lowest muted-text ratio in the table is 5.02:1.

PresetLight · bodyLight · mutedLight · buttonDark · bodyDark · mutedDark · button
Ledger15.14:1 Lc 996.31:1 Lc 7910.46:1 Lc 9814.54:1 Lc 9210.71:1 Lc 729.17:1 Lc 66
Offset19.67:1 Lc 1066.88:1 Lc 8419.67:1 Lc 10818.04:1 Lc 1019.63:1 Lc 6218.04:1 Lc 100
Galley16.56:1 Lc 997.09:1 Lc 815.44:1 Lc 8214.47:1 Lc 948.79:1 Lc 6311.98:1 Lc 77
Linen15.11:1 Lc 985.95:1 Lc 765.41:1 Lc 8215.95:1 Lc 979.25:1 Lc 648.56:1 Lc 62
Charter15.16:1 Lc 1027.35:1 Lc 865.12:1 Lc 8015.91:1 Lc 959.42:1 Lc 639.05:1 Lc 63
Handbill14.67:1 Lc 967.37:1 Lc 8111.43:1 Lc 9915.10:1 Lc 939.87:1 Lc 678.90:1 Lc 64
Vitrine19.57:1 Lc 1067.46:1 Lc 8619.57:1 Lc 10817.79:1 Lc 10011.32:1 Lc 7119.57:1 Lc 106
Openings16.67:1 Lc 1047.20:1 Lc 854.76:1 Lc 7815.93:1 Lc 959.27:1 Lc 628.92:1 Lc 68
Cover13.87:1 Lc 1007.37:1 Lc 864.50:1 Lc 7615.05:1 Lc 958.92:1 Lc 638.29:1 Lc 62
Passage14.35:1 Lc 1016.73:1 Lc 837.12:1 Lc 8815.58:1 Lc 969.17:1 Lc 649.41:1 Lc 63
Dateline16.93:1 Lc 997.03:1 Lc 816.78:1 Lc 8618.08:1 Lc 10010.10:1 Lc 649.66:1 Lc 62
Teller15.62:1 Lc 1037.45:1 Lc 868.56:1 Lc 9316.06:1 Lc 969.28:1 Lc 639.79:1 Lc 67
Kilowatt16.04:1 Lc 1037.37:1 Lc 8617.22:1 Lc 10217.14:1 Lc 1019.52:1 Lc 6417.22:1 Lc 100
Prompt17.48:1 Lc 1026.50:1 Lc 805.42:1 Lc 8116.32:1 Lc 9711.08:1 Lc 728.94:1 Lc 62
Doorstep13.25:1 Lc 955.92:1 Lc 7612.55:1 Lc 10015.46:1 Lc 949.18:1 Lc 6310.07:1 Lc 69
Airtime14.78:1 Lc 967.07:1 Lc 805.77:1 Lc 8218.59:1 Lc 1049.87:1 Lc 648.89:1 Lc 62
Furrow14.70:1 Lc 966.58:1 Lc 786.97:1 Lc 8716.91:1 Lc 9510.10:1 Lc 649.44:1 Lc 62
Docket14.23:1 Lc 1016.48:1 Lc 8218.87:1 Lc 10715.44:1 Lc 949.23:1 Lc 6316.71:1 Lc 97
Clause14.68:1 Lc 1017.21:1 Lc 857.77:1 Lc 9115.08:1 Lc 959.03:1 Lc 639.46:1 Lc 64
Copybook16.80:1 Lc 986.77:1 Lc 795.02:1 Lc 8016.10:1 Lc 959.35:1 Lc 6312.06:1 Lc 78
Counterfoil15.42:1 Lc 976.86:1 Lc 795.00:1 Lc 7715.74:1 Lc 959.18:1 Lc 638.19:1 Lc 62
Keyfob14.62:1 Lc 1016.30:1 Lc 815.48:1 Lc 8018.59:1 Lc 1049.86:1 Lc 648.91:1 Lc 62
Parcel14.91:1 Lc 968.20:1 Lc 847.43:1 Lc 8214.74:1 Lc 919.56:1 Lc 659.40:1 Lc 63
Forecourt17.39:1 Lc 1005.02:1 Lc 729.09:1 Lc 9517.25:1 Lc 1009.66:1 Lc 6413.86:1 Lc 86
Lineup17.09:1 Lc 1005.09:1 Lc 7213.50:1 Lc 10318.59:1 Lc 1049.86:1 Lc 648.89:1 Lc 62
Turndown16.40:1 Lc 995.07:1 Lc 724.94:1 Lc 7918.59:1 Lc 1049.85:1 Lc 648.84:1 Lc 62
Hearth13.90:1 Lc 986.41:1 Lc 8014.68:1 Lc 10418.59:1 Lc 1049.85:1 Lc 649.02:1 Lc 62
Tide13.40:1 Lc 956.52:1 Lc 7814.83:1 Lc 10418.59:1 Lc 1049.85:1 Lc 648.99:1 Lc 62
Quay14.73:1 Lc 978.15:1 Lc 849.99:1 Lc 9718.57:1 Lc 1049.71:1 Lc 638.99:1 Lc 62
Matinee13.71:1 Lc 956.56:1 Lc 7811.75:1 Lc 10118.59:1 Lc 1049.85:1 Lc 648.97:1 Lc 62
Proof15.37:1 Lc 976.67:1 Lc 796.54:1 Lc 8618.59:1 Lc 1049.85:1 Lc 648.94:1 Lc 62
Riso16.12:1 Lc 986.82:1 Lc 795.34:1 Lc 8118.59:1 Lc 1049.85:1 Lc 648.96:1 Lc 62
Margin18.60:1 Lc 1057.49:1 Lc 864.56:1 Lc 7716.10:1 Lc 959.35:1 Lc 638.82:1 Lc 62
Graphite19.80:1 Lc 1065.28:1 Lc 7617.73:1 Lc 10718.59:1 Lc 1049.86:1 Lc 6414.92:1 Lc 90
Harbor19.79:1 Lc 1065.27:1 Lc 766.70:1 Lc 8718.59:1 Lc 1049.87:1 Lc 648.89:1 Lc 62
Moss19.77:1 Lc 1065.25:1 Lc 767.07:1 Lc 8918.57:1 Lc 1049.71:1 Lc 639.03:1 Lc 63
Ember19.80:1 Lc 1065.28:1 Lc 765.18:1 Lc 8018.59:1 Lc 1049.85:1 Lc 648.98:1 Lc 63

Lc shown without its sign. Want one of these for your own project? Each preset installs with the shadcn CLI, or generate a theme from your own brand color.

Buttons, pricing and forms with the contrast already checked

7 of 106 free, no account. All of them in UI Pro.

  • Call to action (call-to-action-01)01

    Call to action

    call-to-action-01 · Free. Closing panel with a very large centred title, three pill actions (call, mail, book) and the founders' faces.

    Open call-to-action-01
  • Pricing (pricing-01)02

    Pricing

    pricing-01 · Free. Three plan cards under a monthly/yearly switch, the middle one framed with a tab, beside a photo card for schools.

    Open pricing-01
  • 03

    All free blocks

    Every one with a live preview, filtered to the ones you can use for free first.

    See them all

Questions

What contrast ratio does WCAG require?

For level AA, normal text needs 4.5:1 against its background and large text needs 3:1 (success criterion 1.4.3). Level AAA asks for 7:1 and 4.5:1 (1.4.6). Buttons, input borders, icons and focus rings need 3:1 against the colors next to them (1.4.11). The ratio runs from 1:1 (the same color twice) to 21:1 (black on white), and 4.49:1 is a fail: WCAG does not round up.

What counts as large text?

At least 18pt (24px in CSS) at a normal weight, or at least 14pt (about 18.66px) in bold. A 20px semibold heading is not large text by this rule, so it needs 4.5:1 like body text.

What is APCA, and should I use it instead of WCAG 2?

APCA (Accessible Perceptual Contrast Algorithm) is the contrast method being drafted for WCAG 3. It scores lightness contrast as Lc from about 0 to 106, and the order matters: dark text on a light ground is positive, light on dark negative. It is designed to handle dark mode and mid tones better than the WCAG 2 ratio does. It is a draft and not a legal standard, so check WCAG 2.2 for compliance and use APCA as a second opinion. This checker runs APCA-W3 0.0.98G-4g; a rough guide is Lc 75 for body text, 60 for other content text and 45 for headlines.

Does shadcn/ui pass WCAG contrast out of the box?

Mostly. In the default neutral theme for Tailwind 4, body text is 19.79:1 and muted-foreground on the page is 4.73:1, both AA. Muted-foreground on the --muted panel is 4.33:1, just under 4.5:1, and the --ring color is 2.59:1 on white, under the 3:1 for focus indicators. Paste your own globals.css in the shadcn/ui theme mode above to see every pair.

How is color blindness simulated?

Protanopia, deuteranopia and tritanopia use the Machado, Oliveira and Fernandes (2009) matrices at full severity, applied in linear sRGB. Achromatopsia turns each color into a grey with the same luminance, so its ratio never changes. Greys look the same to everyone, but saturated colors can move a long way: Tailwind red-600 on white is 4.76:1, 3.85:1 in the deuteranopia view and 7.42:1 for protanopia. The view also shows when color alone carries meaning, such as a red error and a green success that look alike (1.4.1).

How does the "fix it" suggestion pick a color?

It keeps the hue and chroma of your color in OKLCH and moves only the lightness, a small step at a time, until the pair reaches 4.5:1. You get the nearest lighter and darker option for the text and for the background, when one exists, so the fix still looks like your brand color.

Is it free?

Yes. No sign-up, and nothing leaves your browser: the colors and any CSS you paste are checked on your own device. The link in the address bar holds your two colors, so you can share a pair.

UI Pro

Build your next site from finished blocks

Every block, page template and website theme from €199, paid once, with every update and everything we add later. Not ready? The free blocks are open to everyone.

blocks
1401
page templates
55
website themes
29
The About page template from UI Pro, built from its blocks.

This card is a UI Pro block: Rooilijn (call-to-action-07).