Search tools

Tailwind Color Matcher

Paste a colour from a design file and get the closest Tailwind class, plus five runners-up.

Tailwind Color Matcher tool

Matches use the Tailwind CSS v4.3 default palette (all 26 colour families), compared in OKLab, where equal distances look equally different to the eye. Under ΔE 2 is hard to tell apart; above 5 the difference is easy to see side by side.

Exact colour instead of the nearest class

Processing runs in your browser.

Designers hand over colours as HEX codes; Tailwind projects use class names like bg-sky-600. Translating between the two by eye is slow, and guessing often leads to a dozen nearly identical one-off values scattered through a codebase. This matcher tells you which Tailwind colour is closest and how close it really is.

An example

Say a mock-up uses #3a7bd5. Most people would guess a blue class, but the closest Tailwind colour is actually sky-600. You see both colours side by side, the measured difference and a verdict such as “Close — fine for most UI”. If that is good enough, copy bg-sky-600 and move on. If the brand team insists on the exact shade, copy bg-[#3a7bd5] instead.

Why perceptual matching matters

Two colours can be close in RGB numbers and still look clearly different, especially in blues and greens. The matcher measures distance in OKLab, which is built around human vision, so the top result is the one that actually looks most similar.

Keeping a design system tidy

  • If several mock-up colours map to the same Tailwind class, they were probably meant to be the same colour.
  • If a colour has no close match, consider adding it once to your theme rather than repeating an arbitrary value everywhere.
  • Check hover and focus states by moving one step darker in the same family, for example from 600 to 700.

How to use the Tailwind Color Matcher

  1. Paste your colour, or pick one with the swatch.
  2. Choose the utility you need: bg-, text-, border-, ring-, fill- or from-.
  3. Compare your colour with the closest match side by side.
  4. Click Copy class, or click any runner-up to copy it instead.
  5. If no match is close enough, copy the arbitrary value class, such as bg-[#3a7bd5].

Features

  • Searches the full Tailwind CSS v4 default palette: 26 colour families, 286 colours.
  • Matches by perceptual distance in OKLab, not by raw RGB numbers.
  • Shows ΔE for each match with a plain-English verdict.
  • Works with HEX, rgb(), hsl(), oklch() and colour names.
  • Arbitrary value fallback for exact brand colours.

Frequently asked questions

How is the closest colour chosen?

Both colours are converted to OKLab, a colour space where equal distances look like equal differences to the eye. The tool picks the Tailwind colours with the smallest distance. Matching on RGB values often picks colours that look wrong.

What does ΔE mean?

ΔE is the measured difference between two colours, shown here on a 0–100 scale. Under about 2 is very hard to see, 2–5 is a small difference you notice side by side, and above 10 the colours clearly differ.

Should I use the nearest class or an exact value?

If the difference is small, the nearest class keeps your code consistent with the rest of the palette, and hover and dark variants are easy to pick. For a strict brand colour, use an arbitrary value or add it to your @theme as a custom colour.

Does this match Tailwind v3 colours?

It uses the v4 palette, which is defined in OKLCH and is slightly more vivid than v3. The family names and steps (such as blue-500) are the same, so the match will usually still be the right choice for v3.

Written by