Tailwind Color Generator
Generate Tailwind CSS color palettes with 11 shades (50-950) from any hex color. Free tool with OKLCH support, WCAG accessibility checking, and export to Tailwind v4, CSS, and SCSS.
Configuration
No Palettes Generated
Add your base colors above and click "Generate Palette" to create beautiful, accessible color systems.
How to Use This Tailwind Color Generator
Getting custom Tailwind CSS color palettes up and running? It takes just a few clicks. Here's how to generate production-ready color shades:
-
Enter your base color: Grab the color picker or type a hex value (like #6366F1) straight into the input field. Want multiple palettes? Click "Add Color" to generate several related palettes at once.
-
Select a harmony type: Pick how additional colors get generated using color theory. You've got complementary (opposite colors), analogous (adjacent colors), triadic (three evenly-spaced colors), or split-complementary (base plus two colors adjacent to its complement).
-
Pick your shade algorithm: This controls how the 11-shade scale (50-950) gets calculated. OKLCH gives you perceptually uniform scales—ideal for modern design systems. HSL is simpler with linear adjustments. Tint & Shade mixes with white and black. Radix matches the professional Radix UI aesthetic.
-
Generate your palette: Hit "Generate Palette" to create complete color scales. Each palette includes all 11 Tailwind shades from 50 (lightest) to 950 (darkest). Ready to go.
-
Export your colors: Switch to the Export tab to copy your palette as CSS variables, Tailwind v4 configuration, SCSS variables, or W3C Design Tokens. Paste directly into your project configuration.
Right-click any generated color swatch to instantly test it in the Accessibility tab. Saves you from manual color entry when checking contrast ratios against WCAG standards.
What is a Tailwind Color Generator?
A tailwind color generator is a specialized tool that creates complete color palettes formatted specifically for Tailwind CSS projects. Unlike generic color pickers, these generators produce the exact 11-shade scale (50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950) that Tailwind uses. Your custom colors integrate smoothly with the framework's utility classes.
The numbering system follows a logical pattern. Lower numbers represent lighter shades, while higher numbers indicate darker tones. The base color typically sits at the 500 position, with tints (lighter values) numbered 50-400 and shades (darker values) numbered 600-950. This standardized approach means you can write predictable CSS like bg-primary-100 or text-primary-900 without second-guessing which shade to use.
Why Color Scale Generation Matters
Creating consistent color scales by hand? Surprisingly difficult. The human eye perceives lightness changes non-linearly, so mathematically even steps between colors often look uneven. Professional color systems like those in Tailwind CSS need careful calibration. Jumping from blue-200 to blue-300 should feel like the same visual step as blue-700 to blue-800.
This tailwind color palette generator solves the problem by using proven algorithms that account for perceptual uniformity. The OKLCH algorithm, in particular, was built specifically to create color scales where lightness changes appear visually consistent. It's the same color space Tailwind CSS v4 now uses for its default palette.
The Science Behind Shade Generation
Color shade generation involves more than simple lightness adjustments. A well-designed color scale maintains the perceived hue throughout the entire range while managing saturation changes that naturally occur as colors approach white or black.
The generator offers four distinct algorithms, each with different tradeoffs:
OKLCH (Perceptual) uses the OKLCH color space, which represents colors using cylindrical coordinates optimized for perceptual uniformity. Bjorn Ottosson introduced it in 2020, and Tailwind CSS v4 adopted it. OKLCH produces scales where each step feels visually equal. Colors stay vibrant across the entire range rather than appearing washed out or muddy.
HSL (Simple) adjusts the lightness channel linearly in the HSL color space. Less sophisticated than OKLCH, but HSL calculations are fast and predictable. Works well for quick prototypes or when you need full control over the mathematical relationship between shades.
Tint & Shade uses the traditional method of mixing colors with pure white (for tints) and pure black (for shades). This preserves saturation better than HSL in some cases and produces results familiar to designers who learned color theory using paint mixing analogies.
Radix UI Style emulates the approach used by the professional Radix UI design system. Radix applies hue-specific curves to create sophisticated palettes optimized for interface design. Building an app that needs to match Radix component aesthetics? This algorithm produces compatible results.
Common Use Cases for Tailwind Color Generators
Tailwind color generators serve developers and designers across numerous scenarios. Knowing when and how to use generated palettes helps you make better decisions for your specific project.
Building Custom Design Systems
Enterprise applications and product teams often need branded color palettes that go beyond Tailwind's defaults. A tailwind css color palette generator lets you start with your brand's primary color and generate a complete scale that maintains brand identity while providing the shade variations needed for UI elements.
Consider a fintech company with brand color #0ea5e9 (a cyan blue). Generating a full palette produces lighter shades for subtle backgrounds (50-200), the brand color for primary actions (500), and darker shades for text and emphasis (700-950). Every component using this palette automatically feels cohesive because the shades were mathematically derived from the same base.
/* Generated Tailwind v4 configuration */
@theme {
--color-brand-50: oklch(0.97 0.02 220);
--color-brand-100: oklch(0.93 0.04 220);
--color-brand-200: oklch(0.87 0.08 220);
--color-brand-300: oklch(0.78 0.12 220);
--color-brand-400: oklch(0.68 0.16 220);
--color-brand-500: oklch(0.58 0.18 220);
--color-brand-600: oklch(0.48 0.16 220);
--color-brand-700: oklch(0.40 0.14 220);
--color-brand-800: oklch(0.32 0.11 220);
--color-brand-900: oklch(0.24 0.08 220);
--color-brand-950: oklch(0.16 0.05 220);
}
Ensuring Accessibility Compliance
Color accessibility isn't optional for modern web applications. WCAG 2.1 requires a minimum contrast ratio of 4.5:1 for normal text and 3:1 for large text. Manually testing every possible color combination in a design system? Tedious. Error-prone.
This tailwind colors generator includes a built-in WCAG contrast checker that displays real-time accessibility ratings. After generating your palette, switch to the Accessibility tab to test any foreground/background combination. The tool shows:
- The exact contrast ratio (e.g., 7.2:1)
- WCAG compliance level (AAA, AA, or Fail)
- Live preview of how text appears at different sizes
WCAG Level AA requires 4.5:1 contrast for normal text (under 18pt) and 3:1 for large text (18pt+ or 14pt bold). Level AAA requires 7:1 and 4.5:1 respectively. Most regulatory requirements reference Level AA as the minimum standard.
Creating Light and Dark Themes
Modern applications need both light and dark mode support. A well-designed color palette works in both contexts, using lighter shades for dark theme backgrounds and darker shades for light theme backgrounds.
The tailwind color scheme generator's 11-shade output naturally supports this pattern:
- Light mode: Use 50-100 for backgrounds, 500 for primary accents, 700-900 for text
- Dark mode: Use 900-950 for backgrounds, 400-500 for primary accents, 100-300 for text
Because both themes draw from the same generated palette, switching modes maintains visual consistency. The brand feels the same regardless of user preference.
Rapid Prototyping
Designers and developers building prototypes need professional-looking colors without spending hours on color theory. The harmony generation feature creates balanced color schemes automatically:
- Complementary: High contrast, bold designs. Great for call-to-action buttons that need to stand out.
- Analogous: Harmonious, subtle transitions. Perfect for gradient backgrounds or multi-section layouts.
- Triadic: Balanced variety with three distinct colors. Works well for dashboards with multiple data categories.
- Split-Complementary: Contrast with more nuance than pure complementary. Useful for designs needing visual interest without overwhelming brightness.
Tailwind Color Generator Features Explained
Algorithm Selection
The algorithm dropdown controls how shades get calculated from your base color. Each option produces visually different scales:
| Algorithm | Best For | Characteristics |
|---|---|---|
| OKLCH | Design systems, accessibility | Perceptually uniform, modern standard |
| HSL | Quick prototypes, simple needs | Linear, predictable, fast |
| Tint & Shade | Traditional design workflows | Preserves saturation, paint-like |
| Radix | UI components, professional apps | Hue-optimized curves, polished feel |
Color Harmony Types
Harmony algorithms generate additional colors based on color wheel relationships:
Complementary selects the color opposite your base on the color wheel (180 degrees apart). These color pairs create maximum contrast and visual tension. Use complementary colors sparingly—high-impact elements like warnings or call-to-actions work best.
Analogous selects colors adjacent to your base (30-60 degrees apart). These combinations feel naturally harmonious because they share similar hue components. Analogous palettes work well for backgrounds, illustrations, and any design requiring subtle variation without stark contrast.
Triadic selects three colors equally spaced around the color wheel (120 degrees apart). Triadic schemes offer balance with variety. They're particularly useful for data visualization, category differentiation, or playful designs.
Split-Complementary selects your base plus the two colors adjacent to its complement. This gives you the contrast of complementary schemes with more flexibility. Designs feel dynamic without the intensity of direct complements.
Export Formats
After generating palettes, export them in whatever format your project needs:
CSS Variables produces standard custom properties that work in any CSS environment:
:root {
--color-primary-50: #f0f9ff;
--color-primary-100: #e0f2fe;
--color-primary-500: #0ea5e9;
--color-primary-900: #0c4a6e;
}
Tailwind v4 outputs the @theme format introduced in Tailwind CSS version 4, using OKLCH colors for wider gamut support:
@theme {
--color-primary-50: oklch(0.97 0.02 220);
--color-primary-500: oklch(0.58 0.18 220);
}
SCSS creates Sass variables for projects using preprocessors:
$color-primary-50: #f0f9ff;
$color-primary-100: #e0f2fe;
$color-primary-500: #0ea5e9;
Design Tokens exports W3C-compliant JSON for design system tooling:
{
"color": {
"primary": {
"50": { "value": "#f0f9ff" },
"500": { "value": "#0ea5e9" }
}
}
}
Accessibility Checker
The Accessibility tab provides WCAG contrast analysis for any two colors. After generating a palette, test combinations by:
- Clicking any swatch to set it as foreground (text) color
- Right-clicking any swatch to set it as background color
- Viewing the live contrast ratio and compliance level
The checker shows preview text at multiple sizes so you can evaluate readability for both body copy and headlines. Results update instantly as you change colors.
Component Demo
The Demo tab applies your generated palette to realistic UI components—buttons, badges, form inputs, cards, and alerts. This preview helps you evaluate how colors work together in context before implementing them in your actual project.
Frequently Asked Questions
How do I add generated colors to my Tailwind CSS project?
After generating your palette, click the Export tab and select your preferred format. For Tailwind v3 projects, copy the CSS output and add it to your CSS file or configuration. For Tailwind v4 projects, use the Tailwind v4 export and paste it into your main CSS file within an @theme block. The colors become immediately available as utility classes like bg-primary-500 or text-primary-100.
What's the difference between Tailwind v3 and v4 color formats?
Tailwind CSS v4 switched from RGB/HEX colors to OKLCH (Oklab Lightness Chroma Hue) format. OKLCH colors can represent a wider gamut than sRGB, allowing more vivid colors on modern displays. The v4 format also defines colors in the @theme block rather than JavaScript configuration. This tailwind palette generator supports both versions so you can export colors appropriate for your project.
Why does my generated palette look different from the default Tailwind colors?
Here's the thing: Tailwind's default palette was hand-picked by the Tailwind team. They balanced colors by eye across thousands of real design tests. Generated palettes follow mathematical algorithms that produce consistent results but may differ in character from the curated defaults. For best results, use the OKLCH algorithm (it matches v4's color space), then fine-tune individual shades if needed.
Can I generate colors that meet WCAG accessibility requirements?
Yes. This tailwind color generator includes a built-in WCAG contrast checker. After generating your palette, use the Accessibility tab to test any two colors. The tool displays the exact contrast ratio and indicates whether combinations pass AA (4.5:1 for text) or AAA (7:1 for text) requirements. You can adjust your base colors until all important combinations pass.
What is OKLCH and why should I use it?
OKLCH is a color space designed for perceptual uniformity. Unlike HSL or RGB where equal numerical steps don't produce equal visual steps, OKLCH was mathematically optimized so that a change of X units always looks like the same amount of change—regardless of the starting color. This produces more natural-looking color scales. Tailwind CSS v4 adopted OKLCH for its default palette, and modern browsers fully support it.
How many colors should I include in a Tailwind color scheme?
Most projects work well with 2-5 color groups: a primary brand color, a secondary accent, neutral grays, and semantic colors for success/warning/error states. Each color group includes 11 shades (50-950), giving you enough variation for any interface element. Too many color groups makes designs feel chaotic and increases CSS bundle size.
Can I use this generator offline?
The generator runs entirely in your browser with no server processing. Once the page loads, all color calculations happen locally. Your color choices never leave your device—safe for confidential brand projects. But you'll need an internet connection to initially load the tool.
What is the 50-950 numbering system?
Tailwind uses an 11-step numbering system for color shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950. The 500 value represents the base color. Numbers below 500 are increasingly lighter (tints), while numbers above 500 are increasingly darker (shades). This convention allows predictable usage like "use -100 for subtle backgrounds" or "use -900 for heading text."
How do I create a color palette from an image?
This generator works with direct color input rather than image extraction. To extract colors from an image, use a tool like Coolors' image picker or ColorGen.dev to identify hex values, then enter those values here to generate complete Tailwind-compatible scales with all 11 shades.
Related Developer Tools
Expand your design and development workflow with these complementary Forgedock tools:
- Layout Builder: Create responsive CSS flexbox layouts visually and export to React, Vue, Svelte, or HTML with Tailwind classes.
- Base64 Encoder/Decoder: Encode images as data URIs for CSS backgrounds or decode API responses during development.