Home › Image Tools › Tailwind Color Generator

Tailwind Color Generator

Pick your brand color and get a complete Tailwind-style scale from 50 to 950. Your exact color stays in the palette, the other shades are built in the perceptual OKLCH color space, and you can copy the code straight into your project.

Last updated:

Click a swatch to copy its HEX code. “AA” badges show which text color passes WCAG AA (4.5:1) on that shade.

Export

Advertisement
Advertisement

How to use the Tailwind Color Generator

  1. Enter your color as a HEX code or pick it with the color picker.
  2. Name the color, for example brand, primary or accent; the name is used in the exported code.
  3. Keep Closest shade (auto) or choose the shade where your exact color should sit.
  4. Press Generate palette and check the 11 swatches; click one to copy its HEX code.
  5. Choose an export format and press Copy code or Download to add the palette to your project.

How the 50–950 scale is calculated

The tool works in OKLCH: L is perceived lightness (0 to 1), C is chroma (colorfulness) and H is the hue angle. Equal steps in L look like equal steps to the eye, which is why Tailwind v4 also defines its palette in OKLCH.

  1. Your HEX color is converted to OKLCH, for example #3b82f6 → L 0.623, C 0.188, H 259.8°.
  2. The reference lightness of each shade (averaged from Tailwind's palettes) is compared with your L. The closest is 500 (reference 0.661), so #3b82f6 becomes blue-500.
  3. Lighter shades are remapped between your L and 1 (white): Li = 1 − (1 − refi) × (1 − L) ÷ (1 − refanchor). Darker shades between 0 and your L: Li = refi × L ÷ refanchor.
  4. Chroma follows Tailwind's curve, peaking around 600, and is scaled from your color's chroma. The hue stays constant.
  5. Each shade is converted back to sRGB; if it falls outside the screen gamut, chroma is lowered step by step until it fits.

Reference lightness of each shade

ShadeOKLCH LRelative chromaTypical use
500.9756%Page and card backgrounds
1000.94313%Hover backgrounds, badges
2000.89725%Borders, dividers
3000.82945%Disabled states, focus rings
4000.73473%Icons, placeholders
5000.66192%Primary brand color
6000.583100%Buttons, links
7000.50793%Button hover, text on light backgrounds
8000.43977%Headings
9000.38959%Dark sections
9500.26538%Deepest backgrounds, high-contrast text

Tips for a usable brand palette

  • Check text contrast. For white text on a colored button, 600 or 700 usually passes WCAG AA; use the badges on the swatches.
  • Very light or very dark inputs compress one side of the scale. If your brand color is pale, consider placing it at 200 or 300 and using 600 for buttons.
  • Neutral grays work too. A gray with a hint of hue (for example #64748b) gives a slate-style neutral scale.
  • Keep names semantic. Names like primary, accent and danger make it easy to swap colors later.

Frequently asked questions

How does the generator create the shades?

It converts your color to OKLCH, a perceptual color space, and uses lightness and chroma curves averaged from Tailwind's built-in palettes. Lighter shades are spread between your color and white, darker shades between your color and black, keeping the same hue. Any shade outside the sRGB range has its chroma reduced until it fits.

Which shade will my color be?

In auto mode the tool compares your color's OKLCH lightness with the reference curve and places it at the closest shade. A mid blue like #3b82f6 lands on 500, a dark green may land on 700 or 800. You can force any shade with the Place my color at menu.

How do I add the colors to Tailwind CSS v3?

Copy the tailwind.config.js export into the theme.extend.colors section of your config. Then use classes such as bg-brand-500, text-brand-700 or border-brand-200. The DEFAULT key also enables bg-brand.

How do I use the palette with Tailwind v4?

Tailwind v4 is configured in CSS. Paste the @theme block into your main CSS file after @import "tailwindcss"; the --color-brand-500 style variables automatically create utilities like bg-brand-500.

What do the contrast numbers mean?

Each swatch shows whether white or dark text is easier to read on it and the WCAG contrast ratio. 4.5:1 or more (marked AA) is the minimum for normal body text; 3:1 is enough for large text and icons.

Can I use the colors without Tailwind?

Yes. The CSS variables, SCSS and JSON exports work in any project, design token pipeline or component library.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Color Palette GeneratorGenerate beautiful color palettes and export them.Color Shades GeneratorTurn one HEX color into a 50-950 scale plus tints, shades and tones, ready to export.HEX to HSLConvert HEX colors to HSL and back with interactive sliders.HEX to RGBConvert HEX colors to RGB and other formats.Color Code ConverterConvert a color between HEX, RGB, HSL, HSV, CMYK, LAB, LCH and OKLCH with a live swatch.Color PickerPick any color and get HEX, RGB, HSL, HSV and CMYK codes, shades and a screen eyedropper.CSS Background Pattern GeneratorMake pure-CSS stripes, dots, checkerboard, zigzag and grid backgrounds and copy the code.HSL to HEXConvert HSL and HSLA colors to HEX and RGB with sliders and a live preview.RGB to HEXConvert RGB to HEX with sliders, live swatch and one-click copy.RGB to CMYK ConverterConvert RGB and HEX colors to CMYK for print, and back.Color Contrast CheckerCheck WCAG contrast ratios and find accessible text colors.Pantone to HEXLook up approximate HEX, RGB and CMYK values for Pantone colors.Color Name FinderFind the closest color name for any HEX or RGB color.Color Blindness SimulatorSee any image as people with protanopia, deuteranopia, tritanopia or achromatopsia see itImage Color PickerPick any pixel colour from an image and get HEX, RGB, HSL plus a paletteColor MixerMix two colors in sRGB, linear, OKLab or OKLCH, or blend them with Photoshop-style modes.Random Color GeneratorGenerate random HEX colors one at a time or in batches, with hue, saturation and lightness ranges.Color WheelFind complementary, triadic, analogous and other color harmonies on an interactive wheel.HTML Color CodesAll 140 HTML color names with HEX and RGB codes, plus the 216 web-safe colors. Click to copy.Color Palette from ImageExtract the main colors of any photo as HEX codes, CSS variables and a palette PNG.Replace Color in ImageClick a color in a picture and swap it for a new color or transparency, keeping the shading.CMYK to RGBConvert CMYK percentages to RGB and HEX color codes with sliders and a live preview.HEX to RGBAConvert HEX color codes to CSS rgba() with an opacity slider and one-click copy.RGBA to HEXConvert rgba() colors to 8-digit HEX, or flatten transparency onto any background.HEX to CMYKConvert HEX color codes to CMYK percentages for print, with a live preview.HEX to PantoneFind the 5 closest Pantone-style solid coated colors for any HEX or RGB, ranked by Delta E.Color Temperature to RGBConvert a color temperature in kelvin (1000-40000 K) to RGB and HEX with a live swatch.RAL to HEXLook up RAL Classic codes as HEX, RGB and CMYK, search by name or find the nearest RAL.RGB to HSLConvert RGB values to HSL, HSV and HWB with a live swatch and copy-ready CSS.Room Paint Color VisualizerUpload a room photo, select the walls and preview any paint color or HEX with real lighting.Photo to Pop ArtMake Warhol-style pop art from a photo: posterized color tiles in 1, 4 or 9 grids with custom palettes.Screen Color PickerPick any pixel color from anywhere on your screen and copy it as HEX, RGB or HSL.Solid Color Image GeneratorMake a plain single-color or transparent image in any size, like 1920x1080, as PNG or JPG.White Balance CorrectorFix color casts: click a neutral gray point or use auto gray world, then fine-tune temperature and tint.CMYK to HEXConvert CMYK percentages to a HEX color code and RGB, with a live swatch and shades.Photo Color MatchCopy the color grading of a reference photo onto your image (Reinhard color transfer).Underwater Photo Color CorrectionRestore lost reds and remove the blue or green cast from underwater photos by depth.
See all 38 Color Tools →