Tailwind to CSS Converter

Translate Tailwind CSS utility classes to their equivalent raw CSS output. Debug styles, prepare email templates, understand what Tailwind generates under the hood. Free tool.

How to use Tailwind to CSS Converter

  1. 1

    Enter your Tailwind utility classes (e.g., flex items-center justify-between p-4).

  2. 2

    The tool outputs the equivalent CSS declarations.

  3. 3

    Responsive and state modifiers output as media queries and selector variants.

  4. 4

    Copy the CSS for use in email templates, testing, or documentation.

Frequently Asked Questions

Why would I convert Tailwind classes back to CSS?

Common reasons: debugging what CSS is applied, preparing email templates (which require inline CSS), writing unit tests against CSS properties, or migrating away from Tailwind.

Are responsive variants converted correctly?

Yes. md:text-lg outputs as @media (min-width: 768px) { font-size: 1.125rem; } with proper media query wrapping.

Does this support Tailwind v4?

The converter supports all common Tailwind v3 utilities. For v4-specific features using OKLCH colors and CSS property syntax, manual verification is recommended.

Detailed Guide

When You Need Tailwind → CSS

Tailwind is fantastic for building UIs, but there are moments when you need the raw CSS:

  • Debugging: Something looks wrong and you need to see exactly what CSS properties are being applied.
  • Writing tests: CSS-in-JS testing libraries work with CSS properties, not class names.
  • Documentation: Showing colleagues or clients the actual CSS output without requiring Tailwind knowledge.
  • Email templates: Most email clients don't support Tailwind classes — you need inline CSS.
  • Migrating away from Tailwind: Extracting the CSS values to move to a different styling approach.
  • Understanding Tailwind: Learning what each class actually does under the hood.

What This Tool Does

Paste a list of Tailwind utility classes and the tool outputs the equivalent CSS declarations:

Input:

flex items-center justify-between p-4 bg-blue-500 text-white rounded-lg shadow-md

Output:

display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem;
background-color: rgb(59 130 246);
color: rgb(255 255 255);
border-radius: 0.5rem;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

Responsive and State Modifiers

Tailwind's real power comes from modifier prefixes. The converter also handles these:

Responsive:

md:text-lg lg:text-xl

→ Outputs as media query blocks:

@media (min-width: 768px) {
  font-size: 1.125rem;
  line-height: 1.75rem;
}
@media (min-width: 1024px) {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

State modifiers:

hover:bg-blue-600 focus:ring-2 focus:ring-blue-500

→ Outputs as selector variants:

&:hover { background-color: rgb(37 99 235); }
&:focus { --tw-ring-shadow: ...; box-shadow: ...; }

The Tailwind CSS Variable System

Tailwind v3 and v4 use CSS custom properties internally for many values. For example, shadow-md actually generates:

--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);

This tool shows you the simplified, human-readable CSS output, not the internal variable chain.


Email Template Use Case

Email clients (Gmail, Outlook, Apple Mail) don't execute stylesheets. Inline CSS is required for reliable ...

Looking for a more detailed deep-dive and advanced tips?

Read Full Article on our Blog