Tailwind Color Converter
Convert between Tailwind CSS colors and regular formats like HEX, RGB, HSL. Find the closest Tailwind color match for any color.
Input
Output
Readme
What is Tailwind CSS and why do colors matter?
Tailwind CSS is a utility-first CSS framework that provides a comprehensive set of pre-defined color classes. Instead of writing custom CSS like background-color: #3b82f6, developers use utility classes like bg-blue-500. This approach ensures design consistency, speeds up development, and makes maintaining color schemes across large projects much easier.
Tailwind's color palette includes 22 color families (slate, gray, zinc, neutral, stone, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose) with 11 shades each (50-950), totaling over 240 carefully crafted colors designed to work harmoniously together.
How do color conversions work?
Color conversion between formats involves mathematical transformations. HEX colors represent RGB values in hexadecimal notation (#RRGGBB), while RGB uses decimal values (0-255) for red, green, and blue channels. When converting a custom color to Tailwind, the tool calculates the "color distance" using the Euclidean distance formula in RGB color space, finding the Tailwind color with the smallest perceptual difference from your input.
Tool description
The Tailwind Color Converter is a bidirectional conversion tool that bridges the gap between Tailwind CSS color classes and standard color formats. It operates in two modes: converting Tailwind colors to HEX/RGB values, or finding the closest Tailwind match for any custom color. This eliminates guesswork when integrating brand colors into Tailwind projects or extracting exact color values from Tailwind classes.
Examples
Tailwind to Color:
- Input:
blue-500→ Output:#3b82f6,rgb(59, 130, 246) - Input:
emerald-700→ Output:#047857,rgb(4, 120, 87) - Input:
rose-400→ Output:#fb7185,rgb(251, 113, 133)
Color to Tailwind:
- Input:
#ef4444→ Output:red-500(exact match) - Input:
#5271ff→ Output:indigo-500(closest match, distance: 12.45) - Input:
rgb(34, 197, 94)→ Output:green-500(exact match)
Features
- Bidirectional conversion: Convert from Tailwind to color codes or find Tailwind matches for any color
- Complete Tailwind palette: Access to all 22 color families and 11 shade levels (50-950)
- Multiple input formats: Supports HEX, RGB, and OKLCH color formats