Generate a Tailwind scale
Base color plus name, ready for tailwind.config.js
Used as the key in theme.extend.colors
Scale preview
Click any swatch to copy its class
Tailwind config extension
Paste into tailwind.config.js

How to add custom colors to Tailwind

Extend the theme in your Tailwind config, then use the color anywhere in your project with standard Tailwind classes. Colors are automatically available for bg-*, text-*, border-*, ring-*, shadow-* and from-*/to-* gradient utilities.

tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        brand: {
          50: '#eef2ff',
          100: '#e0e7ff',
          200: '#c7d2fe',
          300: '#a5b4fc',
          400: '#818cf8',
          500: '#6366f1',
          600: '#4f46e5',
          700: '#4338ca',
          800: '#3730a3',
          900: '#312e81',
          950: '#1e1b4b',
        },
      },
    },
  },
};

Using the color in markup

HTML \n\n
\n Success message\n
\n\n

\n Gradient heading\n

"> Copy
<button class="bg-brand-600 text-white hover:bg-brand-700">
  Save changes
</button>

<div class="bg-brand-50 border border-brand-200 text-brand-900">
  Success message
</div>

<h1 class="bg-gradient-to-r from-brand-500 to-brand-700 bg-clip-text text-transparent">
  Gradient heading
</h1>

Arbitrary colors vs. extended colors

Tailwind allows arbitrary values with square brackets: bg-[#4f46e5]. This is useful for one-off colors that appear once. For anything reused, extend the config instead — the color becomes a first-class token with a name and scale.

ApproachExampleBest for
Arbitrarybg-[#4f46e5]One-off colors
Extended configbg-brand-600Reused, themeable, scalable
CSS variablesbg-[var(--color-primary)]Runtime theming

Frequently asked questions

Does this work with Tailwind v4?

Yes. Tailwind v4 still uses JavaScript/TypeScript config extensions and accepts the same object format. The output from this helper is compatible with both v3 and v4.

Why does 950 exist?

Tailwind added a 950 step in v3.3 to provide a much darker variant that is still hue-accurate. It sits between 900 and black and is useful for surfaces in dark mode.

How is the scale generated?

The helper adjusts lightness along a fixed map for each step and scales saturation accordingly. Lower numbers (50, 100) are softer and lighter; higher numbers (900, 950) are deeper and more saturated.

Is anything uploaded?

No. All math and exports run in your browser. No account, no server, no upload.

Related tools