Color Picker
Pick a colour and read it as HEX, RGB, HSL and CMYK.
Find the closest Tailwind CSS colour class to any hex: the nearest match from Tailwind's core swatches, with the class name ready to paste.
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. The Tailwind Color Converter runs in this browser tab.
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 maps a design colour to Tailwind's naming. Use it when a mockup has a raw hex and you want the nearest built-in class, so your styles stay 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. It covers a subset of the full palette, so treat the result as a starting point, not an exact shade lookup.
Pick a colour and read it as HEX, RGB, HSL and CMYK.
A hex colour split into its red, green and blue numbers.
Analogous, complementary, triadic or monochrome sets from one colour.
Two colours and an angle become copy-ready CSS.
Pass or fail for text and background at each WCAG level.
Red, green and blue values packed into a #RRGGBB code.
Every conversion happens in your browser. It's free, with no account.