Tailwind color palette generator

A Tailwind color generator turns one HEX color into a full 50–950 shade scale (11 steps from lightest to darkest) that you can paste into a v3 tailwind.config or a v4 @theme block as a custom color.

Paste one HEX color and get a full 50–950 Tailwind shade scale, check each shade's contrast against white and black, and copy it as a v3 config or v4 @theme CSS.

Click a swatch to copy its HEX. ★ marks your input color. W and B are the WCAG contrast ratios against white and black.

Tailwind v3 config

colors: {
  brand: {
    50: '#f0f6ff',
    100: '#deebff',
    200: '#c4dbff',
    300: '#9cc2ff',
    400: '#639eff',
    500: '#3b82f6',
    600: '#3375e0',
    700: '#235fc1',
    800: '#164ea7',
    900: '#0e4191',
    950: '#001f54',
  },
},

Tailwind v4 @theme CSS

@theme {
  --color-brand-50: oklch(97.1% 0.014 259.8);
  --color-brand-100: oklch(93.6% 0.031 259.8);
  --color-brand-200: oklch(88.5% 0.056 259.8);
  --color-brand-300: oklch(80.8% 0.097 259.8);
  --color-brand-400: oklch(70.4% 0.155 259.8);
  --color-brand-500: oklch(62.3% 0.188 259.8);
  --color-brand-600: oklch(57.7% 0.177 259.8);
  --color-brand-700: oklch(50.5% 0.165 259.8);
  --color-brand-800: oklch(44.4% 0.154 259.8);
  --color-brand-900: oklch(39.6% 0.143 259.8);
  --color-brand-950: oklch(25.8% 0.104 259.8);
}

How the shade generator works

The generator converts your HEX color to OKLCH, a color space where lightness matches how bright a color looks to the eye. It reads the color's lightness, chroma (how vivid it is) and hue, then finds the step from 50 to 950 whose lightness is closest. That step keeps your exact color.

Every other step gets a fixed lightness, from very light at 50 to very dark at 950, with the same hue as your color. Chroma eases off the further a step is from your color, so the palest and darkest shades stay soft instead of neon. Greys keep zero chroma, so a grey input gives a clean neutral scale. To read a single HEX colour as OKLCH, use the HEX to OKLCH converter.

Some vivid colors can't be shown on screen at every lightness. When that happens the generator lowers only the chroma until the shade fits in sRGB, leaving the lightness alone, so the scale always runs in order from light to dark. Check the contrast numbers before using a shade for text, or test a pair in the color contrast checker.

Related color tools

Convert or pick the base color first, then build the scale here.

Frequently asked questions

Which shade does my input color become?

Your color is placed on the step whose lightness is closest to its own, so a mid blue usually lands on 500 or 600 and a pale yellow on 100 or 200. That step keeps your exact HEX, and the other ten shades are built around it.

Why are the shades always in order from light to dark?

Every step uses a fixed OKLCH lightness, from 0.971 at 50 down to 0.258 at 950. When a shade is too saturated to display in sRGB, the generator lowers its chroma and never its lightness, so 50 is always the lightest and 950 always the darkest.

How do I use the palette in Tailwind CSS v3 and v4?

For Tailwind v3, paste the copied colors block inside theme.extend in tailwind.config.js. For Tailwind v4, paste the @theme block into your main CSS file. Either way you can then write classes such as bg-brand-500, text-brand-900 or border-brand-200.

What do the W and B numbers on each swatch mean?

They are the WCAG contrast ratios of the shade against white (W) and black (B). Normal body text needs at least 4.5:1 for WCAG AA, so they show at a glance which shades can carry white text and which need dark text.

More color tools

Image tools

CSS generators

Image & SVG tools

Typography & units

More free tools

All free tools