Tailwind Color Contrast Checker

Check WCAG contrast ratios between Tailwind CSS colors — compatible with Tailwind CSS v3 & v4

Colors

or custom hex:
Preview:
or custom hex:
Preview:

Results

4.72 : 1

AA Normal

✅ PASS

AA Large

✅ PASS

AAA Normal

❌ FAIL

AAA Large

❌ FAIL

Sample Text

The quick brown fox jumps over the lazy dog.

Quick Reference

Text Background Ratio AA Normal

What is a Tailwind Color Contrast Checker?

A Tailwind color contrast checker tests whether a foreground color and a background color are readable together. It calculates the WCAG contrast ratio between the two colors and reports which accessibility levels they meet, so you can choose Tailwind shades that are actually legible instead of guessing.

The tool covers 22 Tailwind color families — slate, gray, zinc, neutral, stone, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, and rose — each with 11 shades from 50 through 950, plus pure white and black. You can also type a custom hex value for either side.

The ratio is derived from relative luminance, which linearizes every sRGB channel before combining them as 0.2126 red plus 0.7152 green plus 0.0722 blue. The contrast ratio is then the lighter luminance plus 0.05 divided by the darker luminance plus 0.05, which produces a number between 1 and 21.

Results are scored against four WCAG thresholds: AA normal text needs 4.5, AA large text needs 3, AAA normal text needs 7, and AAA large text needs 4.5. A quick-reference table below lists around 20 common Tailwind pairings sorted by ratio, and the whole checker runs in your browser with no sign in.

Key Concepts

  • Contrast ratio — a value from 1 to 21 that compares the luminance of two colors.
  • Relative luminance — brightness computed after linearizing each sRGB channel.
  • AA thresholds — 4.5 for normal text and 3 for large text.
  • AAA thresholds — 7 for normal text and 4.5 for large text.
  • Color coverage — 22 families with 11 shades each, plus white and black.
  • Quick reference — about 20 ready-made pairings sorted from highest to lowest ratio.

How to Use

  1. Pick a foreground color — choose a text color from any Tailwind color family and shade.
  2. Pick a background color — choose the background the text will sit on.
  3. Enter a custom hex — optionally type or pick a custom hex value for either the text or the background.
  4. Read the ratio and ratings — check the ratio and the AA and AAA pass or fail badges for normal and large text.
  5. Scan the quick reference — use the table of common pairings to find combinations that already pass.

Contrast Reference

Level Normal text Large text
AA4.5:13:1
AAA7:14.5:1
Item Details
Color families22 families: slate, gray, zinc, neutral, stone, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, and rose.
Shades per family11 steps: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, and 950.
Extra colorsWhite and black, plus any custom hex value for either side.
Quick referenceAbout 20 common pairings sorted by contrast ratio.
Step Formula
Linearize channelc = c / 12.92 when c <= 0.03928, otherwise c = ((c + 0.055) / 1.055) ^ 2.4
Relative luminanceL = 0.2126 R + 0.7152 G + 0.0722 B
Contrast ratio(L lighter + 0.05) / (L darker + 0.05)

Worked Examples

  • White on gray-900 — #ffffff text on #111827 background gives a ratio of about 17.74, passing AA and AAA for both normal and large text.
  • White on gray-800 — #ffffff on #1f2937 gives about 14.68, which also passes AAA at every size.
  • White on blue-600 — #ffffff on #2563eb gives about 5.17, passing AA normal and AAA large but not AAA normal.
  • White on green-600 — #ffffff on #16a34a gives about 3.30, which fails AA normal text but passes the AA large text threshold of 3.
  • Blue-600 on blue-50 — #2563eb text on #eff6ff gives about 4.75, just clearing AA normal text.
  • Slate-700 on slate-100 — #334155 on #f1f5f9 gives about 9.45, comfortably passing AAA normal text.

Tips and Common Mistakes

  • Aim for AA at minimum — 4.5:1 is the baseline for normal body text, and anything below that is hard to read.
  • Large text needs less contrast — headings of about 24px, or 19px bold, only need 3:1 for AA, but do not rely on that for body copy.
  • Pair dark shades with light tints — a 700 or 800 shade on a 50 or 100 tint of the same family usually passes comfortably.
  • Do not rely on color alone — contrast is only one part of accessibility; also provide labels, icons, or text for status.
  • Check interactive states — verify hover, focus, and disabled colors, since a passing default can fail once a state changes the background.
  • Reuse the quick reference — if a pairing is already listed as passing, you can copy it rather than testing from scratch.

Common Use Cases

Contrast affects whether a user can read your interface at all, so checking it early saves rework later. These are some of the most common ways the checker helps.

  1. Accessible buttons — confirm that button labels stay readable on filled backgrounds.
  2. Text on colored panels — choose a text shade that works on a colored card or alert.
  3. Dark mode palettes — test light text against dark surfaces such as gray-800 or slate-900.
  4. Form labels and placeholders — make sure helper text is legible and not too faint.
  5. Badges and charts — pick paired colors that remain distinguishable for small elements.
  6. Auditing existing designs — check a brand palette to find combinations that fail WCAG.

Frequently Asked Questions

What contrast ratio do I need for WCAG AA?

AA requires a ratio of at least 4.5:1 for normal text and at least 3:1 for large text.

What is the difference between AA and AAA?

AAA is the stricter level. It requires 7:1 for normal text and 4.5:1 for large text, while AA requires 4.5:1 and 3:1 respectively.

What counts as large text?

Under WCAG, large text is roughly 18 point (24px) regular or 14 point (about 19px) bold and larger. Large text is allowed a lower contrast ratio.

How is the contrast ratio calculated?

Each sRGB channel is linearized, then relative luminance is 0.2126 red plus 0.7152 green plus 0.0722 blue. The ratio is the lighter luminance plus 0.05 divided by the darker luminance plus 0.05.

Which Tailwind colors are included?

There are 22 families with 11 shades each (50 through 950), plus white and black, for a total of over 240 preset colors.

Can I check my own hex colors?

Yes. Both the foreground and the background can be set to a custom hex value using the picker or the hex input.

Is the ratio rounded?

The ratio is shown to two decimal places, which is precise enough to compare against the 4.5, 7, and 3 thresholds.

Is my data sent anywhere?

No. All contrast calculations run in your browser and no colors or values are uploaded or stored.