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.
4.83:1
73.6
APCA 0.0.98G-4g: content text, not long body copy.
Large text is 24px and up, or 18.66px (14pt) and up when bold.
Ship the pricing page today
Body text at 16px. Every plan includes unlimited projects and email support. Read the full comparison before you choose.
A card with 14px text: team roles, audit log and priority support.
you@company.comWCAG 2.2 contrast thresholds
What each level asks for, with the success criterion it comes from. Logos, decoration and disabled controls are exempt.
| What | AA | AAA | Criterion |
|---|---|---|---|
| Normal text (under 24px, or under 18.66px bold) | 4.5:1 | 7:1 | 1.4.3, 1.4.6 |
| Large text (24px and up, or 18.66px bold and up) | 3:1 | 4.5:1 | 1.4.3, 1.4.6 |
| UI components and their states: button and input edges, focus rings, checkboxes | 3:1 | none | 1.4.11 |
| Graphics you need to understand the content: icons, chart lines | 3:1 | none | 1.4.11 |
| Color as the only way to tell things apart | not allowed | 1.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.
| Preset | Light · body | Light · muted | Light · button | Dark · body | Dark · muted | Dark · button |
|---|---|---|---|---|---|---|
| Ledger | 15.14:1 Lc 99 | 6.31:1 Lc 79 | 10.46:1 Lc 98 | 14.54:1 Lc 92 | 10.71:1 Lc 72 | 9.17:1 Lc 66 |
| Offset | 19.67:1 Lc 106 | 6.88:1 Lc 84 | 19.67:1 Lc 108 | 18.04:1 Lc 101 | 9.63:1 Lc 62 | 18.04:1 Lc 100 |
| Galley | 16.56:1 Lc 99 | 7.09:1 Lc 81 | 5.44:1 Lc 82 | 14.47:1 Lc 94 | 8.79:1 Lc 63 | 11.98:1 Lc 77 |
| Linen | 15.11:1 Lc 98 | 5.95:1 Lc 76 | 5.41:1 Lc 82 | 15.95:1 Lc 97 | 9.25:1 Lc 64 | 8.56:1 Lc 62 |
| Charter | 15.16:1 Lc 102 | 7.35:1 Lc 86 | 5.12:1 Lc 80 | 15.91:1 Lc 95 | 9.42:1 Lc 63 | 9.05:1 Lc 63 |
| Handbill | 14.67:1 Lc 96 | 7.37:1 Lc 81 | 11.43:1 Lc 99 | 15.10:1 Lc 93 | 9.87:1 Lc 67 | 8.90:1 Lc 64 |
| Vitrine | 19.57:1 Lc 106 | 7.46:1 Lc 86 | 19.57:1 Lc 108 | 17.79:1 Lc 100 | 11.32:1 Lc 71 | 19.57:1 Lc 106 |
| Openings | 16.67:1 Lc 104 | 7.20:1 Lc 85 | 4.76:1 Lc 78 | 15.93:1 Lc 95 | 9.27:1 Lc 62 | 8.92:1 Lc 68 |
| Cover | 13.87:1 Lc 100 | 7.37:1 Lc 86 | 4.50:1 Lc 76 | 15.05:1 Lc 95 | 8.92:1 Lc 63 | 8.29:1 Lc 62 |
| Passage | 14.35:1 Lc 101 | 6.73:1 Lc 83 | 7.12:1 Lc 88 | 15.58:1 Lc 96 | 9.17:1 Lc 64 | 9.41:1 Lc 63 |
| Dateline | 16.93:1 Lc 99 | 7.03:1 Lc 81 | 6.78:1 Lc 86 | 18.08:1 Lc 100 | 10.10:1 Lc 64 | 9.66:1 Lc 62 |
| Teller | 15.62:1 Lc 103 | 7.45:1 Lc 86 | 8.56:1 Lc 93 | 16.06:1 Lc 96 | 9.28:1 Lc 63 | 9.79:1 Lc 67 |
| Kilowatt | 16.04:1 Lc 103 | 7.37:1 Lc 86 | 17.22:1 Lc 102 | 17.14:1 Lc 101 | 9.52:1 Lc 64 | 17.22:1 Lc 100 |
| Prompt | 17.48:1 Lc 102 | 6.50:1 Lc 80 | 5.42:1 Lc 81 | 16.32:1 Lc 97 | 11.08:1 Lc 72 | 8.94:1 Lc 62 |
| Doorstep | 13.25:1 Lc 95 | 5.92:1 Lc 76 | 12.55:1 Lc 100 | 15.46:1 Lc 94 | 9.18:1 Lc 63 | 10.07:1 Lc 69 |
| Airtime | 14.78:1 Lc 96 | 7.07:1 Lc 80 | 5.77:1 Lc 82 | 18.59:1 Lc 104 | 9.87:1 Lc 64 | 8.89:1 Lc 62 |
| Furrow | 14.70:1 Lc 96 | 6.58:1 Lc 78 | 6.97:1 Lc 87 | 16.91:1 Lc 95 | 10.10:1 Lc 64 | 9.44:1 Lc 62 |
| Docket | 14.23:1 Lc 101 | 6.48:1 Lc 82 | 18.87:1 Lc 107 | 15.44:1 Lc 94 | 9.23:1 Lc 63 | 16.71:1 Lc 97 |
| Clause | 14.68:1 Lc 101 | 7.21:1 Lc 85 | 7.77:1 Lc 91 | 15.08:1 Lc 95 | 9.03:1 Lc 63 | 9.46:1 Lc 64 |
| Copybook | 16.80:1 Lc 98 | 6.77:1 Lc 79 | 5.02:1 Lc 80 | 16.10:1 Lc 95 | 9.35:1 Lc 63 | 12.06:1 Lc 78 |
| Counterfoil | 15.42:1 Lc 97 | 6.86:1 Lc 79 | 5.00:1 Lc 77 | 15.74:1 Lc 95 | 9.18:1 Lc 63 | 8.19:1 Lc 62 |
| Keyfob | 14.62:1 Lc 101 | 6.30:1 Lc 81 | 5.48:1 Lc 80 | 18.59:1 Lc 104 | 9.86:1 Lc 64 | 8.91:1 Lc 62 |
| Parcel | 14.91:1 Lc 96 | 8.20:1 Lc 84 | 7.43:1 Lc 82 | 14.74:1 Lc 91 | 9.56:1 Lc 65 | 9.40:1 Lc 63 |
| Forecourt | 17.39:1 Lc 100 | 5.02:1 Lc 72 | 9.09:1 Lc 95 | 17.25:1 Lc 100 | 9.66:1 Lc 64 | 13.86:1 Lc 86 |
| Lineup | 17.09:1 Lc 100 | 5.09:1 Lc 72 | 13.50:1 Lc 103 | 18.59:1 Lc 104 | 9.86:1 Lc 64 | 8.89:1 Lc 62 |
| Turndown | 16.40:1 Lc 99 | 5.07:1 Lc 72 | 4.94:1 Lc 79 | 18.59:1 Lc 104 | 9.85:1 Lc 64 | 8.84:1 Lc 62 |
| Hearth | 13.90:1 Lc 98 | 6.41:1 Lc 80 | 14.68:1 Lc 104 | 18.59:1 Lc 104 | 9.85:1 Lc 64 | 9.02:1 Lc 62 |
| Tide | 13.40:1 Lc 95 | 6.52:1 Lc 78 | 14.83:1 Lc 104 | 18.59:1 Lc 104 | 9.85:1 Lc 64 | 8.99:1 Lc 62 |
| Quay | 14.73:1 Lc 97 | 8.15:1 Lc 84 | 9.99:1 Lc 97 | 18.57:1 Lc 104 | 9.71:1 Lc 63 | 8.99:1 Lc 62 |
| Matinee | 13.71:1 Lc 95 | 6.56:1 Lc 78 | 11.75:1 Lc 101 | 18.59:1 Lc 104 | 9.85:1 Lc 64 | 8.97:1 Lc 62 |
| Proof | 15.37:1 Lc 97 | 6.67:1 Lc 79 | 6.54:1 Lc 86 | 18.59:1 Lc 104 | 9.85:1 Lc 64 | 8.94:1 Lc 62 |
| Riso | 16.12:1 Lc 98 | 6.82:1 Lc 79 | 5.34:1 Lc 81 | 18.59:1 Lc 104 | 9.85:1 Lc 64 | 8.96:1 Lc 62 |
| Margin | 18.60:1 Lc 105 | 7.49:1 Lc 86 | 4.56:1 Lc 77 | 16.10:1 Lc 95 | 9.35:1 Lc 63 | 8.82:1 Lc 62 |
| Graphite | 19.80:1 Lc 106 | 5.28:1 Lc 76 | 17.73:1 Lc 107 | 18.59:1 Lc 104 | 9.86:1 Lc 64 | 14.92:1 Lc 90 |
| Harbor | 19.79:1 Lc 106 | 5.27:1 Lc 76 | 6.70:1 Lc 87 | 18.59:1 Lc 104 | 9.87:1 Lc 64 | 8.89:1 Lc 62 |
| Moss | 19.77:1 Lc 106 | 5.25:1 Lc 76 | 7.07:1 Lc 89 | 18.57:1 Lc 104 | 9.71:1 Lc 63 | 9.03:1 Lc 63 |
| Ember | 19.80:1 Lc 106 | 5.28:1 Lc 76 | 5.18:1 Lc 80 | 18.59:1 Lc 104 | 9.85:1 Lc 64 | 8.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.
01Call 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
02Pricing
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.
More free tools
- shadcn theme generatorMake a shadcn/ui theme from a primary colour, a grey, a radius and fonts, see it on real blocks in light and dark, contrast-checked, and install it with npx shadcn add.
- Tailwind color palette generatorTurn one color into a 50 to 950 Tailwind palette that steps like the v4 colors, and copy it as an @theme block in OKLCH or hex, or as a v3 config.
- Font pairing37 sans and mono Google Font pairings on a real hero, pricing card and code sample. Swap heading, body and code fonts, then copy the link, Tailwind 4 @theme, next/font or Astro code.
- Placeholder image generatorPlaceholder images from a URL: /ph/1200x630.svg with your own colours, text, radius and font. Builder with presets, live preview and copy-ready HTML, Markdown, Next.js and CSS.
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

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