Color Picker
Use Color Picker to choose and convert color precisely — instant and free.
Find the closest Tailwind CSS colour class to any hex — the nearest match from Tailwind's core swatches, with the ready-to-use class name. Runs in your browser.
Your browser is preparing the tool. It runs 100% locally.
Enter a hex colour and the tool returns the nearest Tailwind CSS colour — its class name (such as bg-blue-600) and the swatch's hex. It compares your colour against a curated set of Tailwind's core swatches by straight-line distance in RGB. Because it uses a subset (mostly the -500 shades), treat the result as a close class to start from, not Tailwind's exact nearest shade. It runs in your browser.
Give it a hex code and it tells you the closest Tailwind colour class plus that swatch's hex, so you can drop a Tailwind utility like bg-blue-600 into your markup instead of a hard-coded value.
It is the quick bridge from a design colour to Tailwind's naming — handy when a mockup uses a raw hex and you want the nearest first-party class to keep your styles consistent with the framework.
The tool keeps a list of Tailwind's core swatches with their hex values. When you enter a colour, it converts it to RGB and measures the straight-line distance to each swatch, treating red, green and blue as coordinates.
The swatch with the smallest distance is reported, and the tool builds the matching class name (for example bg-blue-600) from it. The match is fast and repeatable, but the list is a curated subset of Tailwind's full palette, so it points you to a close class rather than scanning every shade.
for each Tailwind swatch:
distance squared = (R − Rs)² + (G − Gs)² + (B − Bs)²
the swatch with the smallest distance wins → bg-(name)#2563EB → bg-blue-600 (exact) · #7C3AED → bg-violet-500The list is mostly the -500 shades plus a few blues and a dark slate, so most matches land on a -500 class even when a lighter or darker shade would be a touch closer.
The match is exact maths, but against a subset. Because the list is mostly -500 shades, your colour usually snaps to a -500 class even when the real nearest in the full palette is a lighter or darker step. Read it as a close starting class.
Distance is measured in raw RGB, which is not how the eye judges colour. Occasionally a swatch that is slightly farther in numbers would look closer, so the nearest-by-distance is approximate.
It returns one class. Tailwind's full palette has many shades per hue, and the exact best fit might be, say, blue-600 versus blue-700 — a difference this subset may not capture. Check the shade ladder in your config to fine-tune.
The class name assumes the default Tailwind palette. If your project customises or renames colours, the suggested class may not exist as-is and will need mapping to your own scale.
Turn a mockup's hex into the nearest first-party class.
Use framework classes instead of scattered hex values.
Grab a close bg- or text- class without opening the palette docs.
See which Tailwind colour a hex is nearest to.
For the precise shade, compare against Tailwind's full colour scale in the docs or your tailwind.config. For a custom palette, map the hex to your own tokens. For an exact colour rather than a class, keep the hex with a hex-to-RGB or HSL converter.
Matches against a curated set of Tailwind swatches (mostly the -500 shades) by RGB distance; honest that it is a subset of the full palette and a starting point, not an exact shade lookup.
Use Color Picker to choose and convert color precisely — instant and free.
Use HEX to RGB Converter to choose and convert color precisely — instant and free.
Use Color Palette Generator to choose and convert color precisely — instant and free.
Use Gradient Generator to choose and convert color precisely — instant and free.
Use Contrast Checker to choose and convert color precisely — instant and free.
RGB to HEX Converter with copy-ready values for design and front-end work.
It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.