CSSMar 30, 2026 · Updated Oct 13, 2026 · 3 min read

How to Generate a Custom Tailwind CSS Color Scale

Tailwind's built-in color palette covers most needs, but brand colors rarely match a pre-defined shade. The Tailwind Color Scale generator takes any base color and produces a complete 50-950 scale that follows Tailwind's naming convention and lightness distribution — ready to paste into your tailwind.config.js.

Paint, brush, splash — illustrating How to Generate a Custom Tailwind CSS Color Scale
🎨
Try the Tailwind Color Scale
Free, no signup
→
DG
Derek Giordano
Designer & Developer
In this guide
01Why Generate Custom Scales?02Generating Your Scale03Checking Scale Quality04Integration with Tailwind

Why Generate Custom Scales?

Brand colors need full shade ranges for different UI states: 50-100 for backgrounds, 200-300 for borders, 400 for secondary text, 500 for the base brand color, 600-700 for hover states, 800-900 for dark text. Tailwind's built-in colors provide this range, but custom brand colors don't — the scale generator fills this gap.

Generating Your Scale

Enter your brand color; it becomes the 500 shade exactly. The tool builds the other ten shades by moving HSL lightness up towards 96% and down towards about 10% while keeping the hue — a simple, predictable method, but not a perceptual one, as the measurement below shows. Output is ready for a Tailwind v3 tailwind.config.js (theme.extend.colors) or as CSS variables.

Checking Scale Quality

There is no contrast checker in the tool, so check pairs yourself before shipping. We compared its scale for Tailwind's own blue-500 (#3b82f6) with Tailwind v3.4's blue palette, using OKLCH lightness (L, 0–1, computed with culori 4.0.2; script in our test folder, October 13, 2026).

ShadeToolLTailwind blueL
50#f1f4f90.966#eff6ff0.970
200#c8d9f30.881#bfdbfe0.882
500#3b82f60.623#3b82f60.623
700#0848b10.437#1d4ed80.488
900#0a25510.273#1e3a8a0.379
950#06152d0.198#1725540.282

The light end matches Tailwind closely (but greyer: #f1f4f9 against #eff6ff). The dark end runs much darker — the tool's 900 is about as dark as Tailwind's 950 would be if it continued — so tool-generated 800–950 shades suit near-black text more than Tailwind-style deep blues. Neither scale has equal steps: Tailwind's own lightness steps range from 0.038 to 0.097. Contrast to check: 500 on white is 3.68:1 for both, below the 4.5:1 that WCAG 1.4.3 requires for body text, so use 600 or 700 for text on light backgrounds (the tool's 700 on its 50 is 7.41:1; Tailwind's is 6.16:1).

Integration with Tailwind

Paste the generated config into your tailwind.config.js:

module.exports = {
  theme: {
    extend: {
      colors: {
        brand: {
          50: '#fef2f2',
          100: '#fde8e8',
            ...
          900: '#7f1d1d',
          950: '#450a0a',
        }
      }
    }
  }
}

This creates utilities like bg-brand-500, text-brand-900, border-brand-200 throughout your project.

In Tailwind CSS v4, which configures themes in CSS rather than in tailwind.config.js, put the same values in an @theme block — --color-brand-500: #3b82f6; and so on — and utilities such as bg-brand-500 are generated from them.

Frequently Asked Questions

How do I create a custom color scale for Tailwind?+
Enter your base color into the Tailwind Color Scale generator. It produces a complete 50-950 shade scale following Tailwind's conventions. Paste the output into your tailwind.config.js.
How many shades does Tailwind use per color?+
11 shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950. The 500 shade is typically the base/primary color.
Can I use multiple custom color scales?+
Yes. Add as many custom color objects as you need in the extend.colors section. Each gets its own utility class prefix (bg-brand-500, bg-accent-300, etc.).
Try it yourself

Use the Tailwind Color Scale — free, no signup required.

⚡ Open Tailwind Color Scale
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.
⚡ Try the free Color to Tailwind Finder →