Tailwind Color Palette Generator
Enter one brand color. Get a complete Tailwind palette with a 50 to 950 scale, neutrals, an accent, semantic colors, a live preview, and ready-to-paste code.
Your brand scale
The outlined chip holds your exact color. Select any chip to copy its HEX.
Neutral, accent, and semantic scales
Recommended pairs and contrast
Live interface preview
Export your Tailwind theme
What is a Tailwind color palette generator?
A Tailwind color palette generator turns one brand color into a full set of Tailwind-style scales with steps from 50 to 950. This generator keeps your exact color on the matching step, builds a neutral scale, an optional accent scale, and four semantic scales (success, warning, danger, info), then exports everything for Tailwind CSS v4, Tailwind CSS v3, plain CSS, JSON, and shadcn/ui.
Key takeaways
- Your exact brand color stays unchanged on the anchor step. The generator calculates the other ten steps around it.
- The generator works in OKLCH and follows the lightness curve of the Tailwind v4 default palette.
- The Insights list tells you the step where white text first passes WCAG AA, so you can pick button colors with confidence.
- You get a matching neutral scale, an accent scale, and semantic colors in one export.
- You copy Tailwind v4 @theme code, a Tailwind v3 config, CSS variables, JSON, or a shadcn/ui theme.
How to generate a Tailwind color palette from one color
You can turn a single HEX code into a production-ready theme in about a minute. Follow these steps.
- Enter your brand colorType a HEX, rgb(), hsl(), or oklch() value, pick a color with the color picker, or select one of the preset swatches.
- Check the anchor stepThe generator places your exact color on the Tailwind step that matches its lightness, such as 500 or 600. Change the anchor step if you want your color on a different step.
- Choose a neutral tint and an accent harmonySelect a pure, subtle, or tinted gray scale built from your brand hue. Add a complementary, split, triadic, or analogous accent scale.
- Review contrast and preview the interfaceRead which steps pass WCAG AA with white or black text, check the recommended pairs, and switch the preview between light and dark mode.
- Select an export formatChoose Tailwind v4 (OKLCH or HEX), Tailwind v3, CSS variables, shadcn/ui, or JSON, then copy or download the code.
- Paste the theme into your projectAdd the @theme block to your main CSS file for Tailwind v4, or add the colors object to tailwind.config.js for Tailwind v3. Then use classes such as bg-brand-600.
What the Tailwind shade numbers mean
Tailwind names each step with a number from 50 to 950. Lower numbers mean lighter colors. Use this table as a starting point for your own design system.
| Step | Typical use |
|---|---|
| 50 | Page tints and very subtle backgrounds |
| 100 | Hover backgrounds, badges, selected rows |
| 200 | Borders, dividers, subtle fills |
| 300 | Disabled states, outer focus rings |
| 400 | Icons and links in dark mode |
| 500 | Brand base color, charts, illustrations |
| 600 | Primary buttons with white text, links on light backgrounds |
| 700 | Button hover and active states |
| 800 | Text on tinted backgrounds |
| 900 | Headings and text on 100 backgrounds |
| 950 | Deepest text and dark mode surfaces |
How this generator builds your scale
Most generators only lighten and darken a color in HSL. That approach shifts perceived brightness unevenly, so a blue 500 and a green 500 do not look equally bright. This generator works differently.
- It converts your color to OKLCH. OKLCH separates lightness, chroma (color intensity), and hue, and keeps lightness consistent across hues.
- It picks the anchor step. The tool compares your lightness with the Tailwind step curve, adjusts for hue (yellows and greens look lighter at the same step), and locks your exact HEX value on the closest step.
- It calculates the other steps. Lighter steps move toward the 50 tint and darker steps move toward the 950 shade, following the lightness and chroma curves of the Tailwind v4 default palette.
- It maps each color back to sRGB. When a color falls outside the sRGB gamut, the generator lowers chroma until the color fits and preserves lightness and hue.
The neutral scale reuses your hue with very low chroma, so grays feel related to your brand. The accent scale rotates the hue by the harmony you choose. The semantic scales use fixed hues for success, warning, danger, and info, and match their intensity to your brand color so alerts do not clash with your design.
Read more about the color space in the OKLCH Color Picker, or convert existing values with the HEX to OKLCH Converter.
Add the palette to Tailwind CSS v4
Tailwind v4 reads theme values from CSS. Add an @theme block to your main stylesheet and paste the generated variables. Tailwind then creates utilities such as bg-brand-600, text-brand-700, and border-brand-200 automatically.
@import "tailwindcss";
@theme {
--color-brand-50: oklch(0.971 0.012 276.1);
--color-brand-500: oklch(0.620 0.230 277.0);
--color-brand-600: oklch(0.511 0.262 276.9);
--color-brand-950: oklch(0.257 0.090 277.0);
}
To remove every default Tailwind color and use only your own scales, add --color-*: initial; at the top of the @theme block.
Use the colors in markup
<button class="bg-brand-600 text-white hover:bg-brand-700 focus-visible:ring-2 focus-visible:ring-brand-400"> Get started </button>
Add the palette to Tailwind CSS v3
Tailwind v3 reads colors from tailwind.config.js. Open the Tailwind v3 tab, copy the object, and paste it under theme.extend.colors. The export includes a DEFAULT value for your brand scale, so both bg-brand and bg-brand-600 work. Move the object from extend to theme if you want to replace the default palette. Upgrading an older project? Try the Tailwind v3 to v4 Helper.
Dark mode with your generated palette
The live preview shows how the scales behave in both themes. In dark mode, the generator uses neutral 950 for the page, neutral 900 for cards, and a lighter brand step for links so text stays readable. Tailwind v4 applies the dark: variant with the system color scheme by default. To switch themes with a class instead, add this line to your CSS:
@custom-variant dark (&:where(.dark, .dark *));
Need to convert an existing light design? Use the Light to Dark Theme Converter.
Export a shadcn/ui theme from your brand color
shadcn/ui styles components with CSS variables such as --primary, --background, and --border. The shadcn/ui export maps your scales to those variables for light and dark mode:
- Primary uses the darkest-needed brand step that gives white text AA contrast.
- Background, card, and popover use white in light mode and neutral 950 or 900 in dark mode.
- Muted, secondary, border, and input use neutral steps tinted by your brand hue.
- Accent uses a light brand tint in light mode and a deep brand shade in dark mode.
- Destructive and chart colors use your danger, success, warning, and info scales.
Paste the result into globals.css, and every shadcn/ui component adopts your brand.
Pick accessible button and text colors
A palette only works when people can read it. WCAG 2.2 requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text and interface components. The generator checks both:
- Each brand chip shows its best text color and contrast level.
- The Insights list names the first step where white text passes AA.
- The pairs table tests real combinations, including primary buttons, links, badges, body text, muted text, and dark mode text.
If a pair fails, move to a darker step for light backgrounds or a lighter step for dark backgrounds. For a deeper audit, test your final pairs in the Color Contrast Checker and the APCA Contrast Checker, and confirm that your colors work for color-blind users with the Colorblind Palette Checker.
Common Tailwind palette mistakes
- Lightening and darkening in HSL. Scales built this way look uneven. Use a perceptual space such as OKLCH.
- Using step 500 for every button. Many brand colors fail white-text contrast at 500. Check the AA step first.
- Mixing pure gray with a colorful brand. A subtle brand tint in the neutral scale makes the interface feel cohesive.
- Skipping semantic colors. Define success, warning, and danger scales early so alerts and charts match your brand.
- Ignoring dark mode. Test your links, borders, and muted text on neutral 950 before you ship.
Frequently asked questions
What is a Tailwind color palette generator?
A Tailwind color palette generator turns one brand color into a full set of Tailwind-style color scales with steps from 50 to 950. This tool also builds a matching neutral scale, an optional accent scale, and four semantic scales for success, warning, danger, and info, then exports them as Tailwind code.
How do I generate a Tailwind palette from one brand color?
Enter your brand color, review the scale, and copy the export. The generator keeps your exact color on one step and calculates the other ten steps in OKLCH so the lightness progression matches the Tailwind default palette.
What do the Tailwind shade numbers 50 to 950 mean?
The numbers rank a color from lightest to darkest. Step 50 is the faintest tint, step 500 is the mid-tone, and step 950 is the deepest shade. Most interfaces use 50 to 200 for backgrounds and borders, 500 to 700 for buttons and links, and 800 to 950 for text and dark surfaces.
How do I add custom colors in Tailwind CSS v4?
Add an @theme block to your main CSS file and define variables such as --color-brand-500. Tailwind v4 then creates utilities like bg-brand-500, text-brand-700, and border-brand-200 automatically. Copy the Tailwind v4 export from this tool to get the full block.
How do I add custom colors in Tailwind CSS v3?
Add a colors object under theme.extend in tailwind.config.js. Copy the Tailwind v3 export from this tool. It includes all steps and a DEFAULT value, so both bg-brand and bg-brand-600 work.
Which shade should I use for buttons?
Use the darkest step that still gives white text a contrast ratio of at least 4.5:1. The Insights list shows that step for your color. For many brand colors it falls between 600 and 700.
Can I replace the default Tailwind colors?
Yes. In Tailwind v4, add --color-*: initial; at the top of your @theme block to remove every default color, then define only your own scales. In Tailwind v3, define colors directly under theme instead of theme.extend.
How does the generator keep my exact brand color?
The generator converts your color to OKLCH, finds the Tailwind step with the closest lightness, and locks your HEX value on that step. It then calculates the lighter and darker steps from your color, so your brand color appears unchanged in the scale.
Why does the generator use OKLCH instead of HSL?
OKLCH keeps lightness consistent across hues, so a blue 500 and a green 500 look equally bright. HSL does not guarantee that. Tailwind v4 also defines its default palette in OKLCH, which makes the generated scales feel native.
Does the generator support dark mode?
Yes. The live preview switches between light and dark mode, the recommended pairs include dark mode text checks, and the shadcn/ui export contains both :root and .dark variables.
Can I export a shadcn/ui theme?
Yes. Select the shadcn/ui tab to copy CSS variables for background, foreground, primary, secondary, muted, accent, destructive, border, input, ring, and chart colors in light and dark mode. Paste them into your globals.css file.
Why does my brand color land on step 600 instead of 500?
The generator places your color by lightness, not by a fixed rule. A darker brand color matches the lightness of step 600 or 700, while a lighter color matches step 400 or 500. Use the Anchor step menu to override the choice.
Is the Tailwind color palette generator free and private?
Yes. The tool is free, needs no account, and runs entirely in your browser. The generator never sends your colors to a server.