Developer

Tailwind CSS Color Generator

Turn any color into a Tailwind 50–950 shade scale for tailwind.config.js or @theme.

Developer

Why Use the Tailwind CSS Color Generator?

Paste in a brand color and this Tailwind CSS color generator builds a full 11-step scale from 50 to 950, matching the naming Tailwind uses for its built-in palettes. Shade 50 is the lightest tint, 950 is the deepest shade and your base color sits near 500. You get the scale twice: as a colors object for tailwind.config.js and as Tailwind v4 @theme CSS variables, so the same palette works whether your project uses the older JavaScript config or the newer CSS-first setup.

How to Use the Tailwind CSS Color Generator

  1. Enter your base color using the picker or by typing a HEX, rgb(), hsl() or CSS color name value.
  2. Review the 11 swatches from 50 to 950 and click any swatch to copy its HEX code.
  3. For Tailwind v3 projects, copy the tailwind.config.js colors object and place it under theme.extend.colors so the default palette stays available.
  4. For Tailwind v4 projects, copy the @theme CSS variables into your main CSS file, then use utilities such as background, text and border classes with the new shade numbers.

Best For

  • Turning a single brand HEX code from a style guide into a complete primary scale for a new Tailwind project.
  • Adding a secondary or accent scale that behaves like the built-in Tailwind palettes in hover and dark mode classes.
  • Migrating a custom palette from a v3 config file to Tailwind v4 @theme variables.
  • Generating consistent light backgrounds, borders and dark text colors for a dashboard from one accent color.

Pro Tip

Mid-scale shades around 500 often fall below the 4.5:1 contrast ratio needed for small white text, so check 600 and 700 before using them for buttons with white labels. A reliable pattern is 50 or 100 for tinted backgrounds, 200 or 300 for borders, 600 or 700 for buttons and links, and 900 or 950 for headings. In dark mode, flip the scale and test the lighter shades against your dark background.

FAQ

Tailwind CSS Color Generator FAQ

How do I add custom colors to Tailwind CSS?

In Tailwind v3, add a colors object inside theme.extend in tailwind.config.js, which keeps the default colors and adds yours. In Tailwind v4, declare CSS variables named with the --color- prefix inside an @theme block in your CSS file. Either way, Tailwind then generates utilities such as bg, text and border classes for every shade.

What do the numbers 50 to 950 mean in Tailwind colors?

The numbers are lightness steps within one hue. 50 is the lightest, 950 is the darkest and 500 is roughly the middle, with 100 to 900 in between. Using the same numbering for every color lets you swap one hue for another without rethinking which shade to use for backgrounds, borders or text.

What changed about colors in Tailwind CSS v4?

Tailwind v4 moved configuration into CSS, so custom colors are defined as variables in an @theme block instead of a JavaScript config file. Those variables are also available as regular CSS custom properties anywhere in your styles. The default palette in v4 is defined in the OKLCH color space, while HEX values still work for custom colors.

Does my brand color have to be the 500 shade?

No, the 500 position is a convention, not a rule. This generator places your base near 500 so the scale has room to lighten and darken evenly. If your brand color is very light or very dark, you may find it matches a lighter or darker step better, and you can use whichever shade passes contrast for each job.

Learn more

Guides for the Tailwind CSS Color Generator

Mastering Tailwind CSS Color Scales

Understand how to craft custom 50-900 color scales for your Tailwind CSS configuration files.

Read Guide

Monochromatic Color Schemes: How to Design With a Single Hue

Learn how to build a monochromatic color scheme for the web: create a single-hue scale, assign UI roles, keep text accessible and adapt it for dark mode.

Read Guide

Tints, Shades, and Tones: What They Are and How to Use Each

Tints, shades, and tones explained: how each maps to HSL lightness and saturation, how to build UI color scales, and how to stop dark shades looking muddy.

Read Guide
Copied