🌊 Tailwind CSS to Plain CSS Converter

Convert Tailwind CSS utility classes to plain CSS and back. Supports Tailwind v3 classes including spacing, colors, flexbox, grid. Free online converter.

Paste a list of Tailwind classes (like flex items-center p-4 text-lg font-bold) and get the equivalent plain CSS properties. Switch direction for CSS → Tailwind conversion. Useful when migrating projects or working without Tailwind in scope.

How to Use

1

Choose direction

Select "Tailwind → CSS" to convert class names to CSS properties, or "CSS → Tailwind" to go the other way.

2

Paste your code

Type or paste Tailwind classes (space-separated) or CSS properties in the input area.

3

Copy the output

Click Convert and then Copy to use the result in your project.

Frequently Asked Questions

What does Tailwind CSS do? +
Tailwind CSS is a utility-first CSS framework where you compose designs using small single-purpose classes directly in your HTML, like text-lg, font-bold, p-4, flex, items-center. Each class maps to one or a few CSS declarations.
When should I convert Tailwind to plain CSS? +
When you need styles in a non-HTML context (email templates, React Native, PDF generators), when working with a team that does not use Tailwind, or when extracting styles for a CSS component library.
Does this converter support all Tailwind classes? +
This tool covers the most common Tailwind v3 utility classes: spacing, typography, colors, flexbox, grid, sizing, borders, shadows, and more. Arbitrary value classes (like w-[350px]) are not supported.
How do I convert CSS back to Tailwind? +
Switch the direction to CSS → Tailwind and paste your CSS properties. The tool maps declarations like margin: 0.5rem to m-2, display: flex to flex, etc.
Is JIT mode supported? +
The converter handles standard Tailwind v3 classes including responsive prefixes (sm:, md:, lg:) and state variants (hover:, focus:, dark:). JIT arbitrary values ([value]) are not converted.


Complete Guide: CSS to Tailwind Converter

Tailwind CSS has become one of the most popular CSS frameworks in web development, shifting the paradigm from semantic class names to utility-first composition. Converting an existing CSS codebase — or translating hand-written CSS into Tailwind classes — is a common task when migrating projects or prototyping with a design system. This guide covers the utility-first philosophy, the most common CSS-to-Tailwind mappings, and the practical boundaries of what Tailwind handles well versus where plain CSS remains necessary.

The Utility-First Approach

Traditional CSS methodology encourages semantic class names: .card, .hero-button, .sidebar-nav. You write CSS rules that describe what these components look like. Tailwind inverts this: you apply small, single-purpose utility classes directly in your HTML, composing the final look from primitives like flex, p-4, text-lg, and bg-blue-500. The advantage is that you never write CSS directly for most UI work — the utility classes are the CSS. The trade-off is more verbose HTML markup.

Common CSS to Tailwind Mappings

Here are the most frequently converted CSS properties:

JIT Mode and Arbitrary Values

Tailwind's Just-In-Time (JIT) compiler generates only the classes you actually use, keeping your production CSS bundle small. JIT also enables arbitrary values — any CSS value can be expressed using bracket notation:

w-[337px]        /* width: 337px */
text-[#1a2b3c]   /* color: #1a2b3c */
mt-[clamp(1rem,5vw,3rem)]  /* custom clamp() value */
grid-cols-[1fr_2fr_1fr]    /* custom grid template */

Arbitrary values are a pragmatic escape hatch — use them when a design requires a specific value that doesn't fit Tailwind's default scale.

The @apply Directive

When the same combination of utility classes repeats across many elements, the @apply directive lets you extract them into a reusable CSS class:

.btn-primary {
  @apply px-6 py-3 bg-blue-600 text-white font-semibold rounded-lg
         hover:bg-blue-700 focus:outline-none focus:ring-2
         focus:ring-blue-500 focus:ring-offset-2;
}

Use @apply sparingly — it reintroduces the abstraction layer that Tailwind's utility-first approach was designed to eliminate. The Tailwind team recommends using it only for third-party content you don't control or very high-frequency repeated patterns.

When NOT to Use Tailwind

Tailwind excels at layout, spacing, typography, and color. It struggles with:

Tailwind Config Customization

Extend Tailwind's default theme in tailwind.config.js without overriding built-in values:

module.exports = {
  theme: {
    extend: {
      colors: {
        brand: { 500: '#e63946', 600: '#c1121f' }
      },
      fontFamily: {
        display: ['"Cal Sans"', 'sans-serif']
      },
      spacing: {
        18: '4.5rem',
        88: '22rem'
      }
    }
  }
};

Migration Workflow: Existing CSS to Tailwind

  1. Audit your existing CSS to identify repeated patterns and component-level styles
  2. Convert layout and spacing rules first — these have the most direct Tailwind equivalents
  3. Convert typography and color rules, updating to your Tailwind palette as you go
  4. Handle edge cases with arbitrary values (w-[337px]) rather than maintaining a parallel CSS file
  5. Replace repeated utility combos with @apply in component CSS as a final cleanup step

For generating glassmorphism effects that need custom backdrop-blur values, see CSS Glassmorphism. For gradient backgrounds that translate to Tailwind gradient utilities, use the Gradient Generator.

🧰 50+ Tools