Tailwind Colour Generator
Generate a full Tailwind CSS colour palette from your brand colour for free — 11 shades from 50 to 950 built in the OKLCH colour space with Tailwind-style lightness and chroma curves, your exact colour kept in the scale, and WCAG contrast shown on every swatch. Export Tailwind v4 @theme (OKLCH or hex), a v3 config object, CSS variables or JSON.
100% private — everything runs in your browser. Conversion happens on your device; nothing is uploaded.
Shades are built in the OKLCH colour space using lightness and chroma curves modelled on Tailwind’s own palettes, so 50 is a soft tint and 950 a deep shade with the same hue. Each swatch shows its contrast ratio with white or black text. Click a swatch to copy its hex.
How to generate a Tailwind colour palette
- Enter your brand colour (or pick one).
- Name the colour, e.g. brand or primary.
- Check the shades and contrast ratios.
- Choose an export format and copy the code into your project.
What you can use it for
- Turn a brand colour into a complete design-system scale
- Create custom Tailwind colours that match the built-in palettes
- Generate accessible light and dark shades for UI states
- Share colour tokens between design and development
More free tools
Building for the web?
Format, minify, convert and generate code with our free, private developer tools.
See all free tools →Frequently asked questions
How do I add a custom colour to Tailwind v4?
Copy the @theme block into your main CSS file. Classes like bg-brand-500 and text-brand-900 then work automatically.
And for Tailwind v3?
Choose “Tailwind v3 config” and paste the object into theme.extend.colors in tailwind.config.js.
Where does my colour end up?
It's placed at the step whose lightness matches it best — usually 500 or 600 — and kept exactly, with the other shades built around it.
Why OKLCH?
OKLCH is perceptually even, so every step looks like the same colour getting lighter or darker, without the muddy or neon shifts you get mixing with white and black. Tailwind v4 uses OKLCH for its own palette.
Which colour formats can I enter?
Type a hex code with or without the # (3 or 6 digits, such as #e11d48), an rgb() or hsl() value, or a CSS colour name such as teal. You can also use the colour picker, or press Random colour for a new starting point. Any transparency value is ignored, because each shade is a solid colour. If the tool can't read what you typed, it shows a message with examples.
How are the other shades calculated?
Each step has a fixed target lightness, from 97.1% at 50 down to 28.2% at 950. Colour strength (chroma) follows a curve that peaks around 500 and 600 and tapers off towards both ends, scaled from your own colour's strength. The hue turns slightly from step to step, in the opposite direction for oranges and yellows, and any shade a screen can't show is toned down until it fits.
What do the numbers on each swatch mean?
Each swatch shows its step, its hex code and a contrast ratio such as 4.8:1. The ratio is worked out with the WCAG formula against both white and black, and the swatch shows whichever is higher, with its label drawn in that text colour. Use it to see at a glance which shades suit light or dark text, then test exact pairs in our Contrast Checker.
What does “Keep my exact colour in the scale” do?
When it's ticked, which is the default, your colour is used unchanged at the step it matches, and that swatch is outlined. Untick it to let the tool rebuild that step from its own lightness and chroma curves as well. The step may then differ slightly from your input, but it sits more evenly with the shades either side. The other ten shades are the same either way.
Can I use the palette without Tailwind?
Yes. Choose CSS variables to get a :root block with one variable per shade, such as –brand-500, that you can use with var() in any stylesheet. Choose JSON for a simple object that maps each step, 50 to 950, to its hex code, which suits design-token files and scripts. Every export except Tailwind v4 @theme (OKLCH) gives hex values, and Copy code copies the whole block.
Can I make several custom colours, like primary and secondary?
Yes, one scale at a time. Give the first colour a name, such as primary, copy its code, then change the colour and the name and copy again. The name goes into every variable, such as –color-primary-500, so keep it short: it's lowercased, and spaces or symbols become hyphens. Because each scale carries its own name, the lines don't clash when you paste them together.
Is it free, and can I use the palettes commercially?
Yes. The generator is free, with no sign-up and no limit on how many palettes you make. The shades and code it gives you are yours to use in any project, including client and commercial work, and no credit is needed. Everything is worked out in your browser, so your colours aren't sent anywhere.