Free ToolsGuidesCase StudiesResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/frontend-tools/tailwind-to-css-converter

Tailwind to CSS Converter

ToolRuns in your browserNothing is uploadedFree · no sign-up

Paste a list of Tailwind classes, or a whole element, and get the equivalent plain CSS. Layout, flexbox, grid, spacing, sizing, typography, borders, shadows and arbitrary values are converted, including hover:, focus: and responsive prefixes. Anything that depends on your theme is listed.

Using the Tailwind to CSS Converter

What is converted

Display, position, flexbox and grid, spacing (padding, margin, gap and space utilities), width, height and max sizes, typography (sizes, weights, line height, letter spacing, alignment, transforms), borders and radius, shadows, opacity, transitions, translate, scale and rotate, plus any arbitrary value or arbitrary property such as w-[340px] or [mask-type:luminance].

Spacing and sizes

Tailwind's spacing scale steps by 0.25rem, so p-4 is 1rem and gap-6 is 1.5rem. Font size utilities set both the size and a matching line height, exactly as Tailwind does, and fractions such as w-1/2 become percentages.

Variants

hover:, focus:, focus-visible:, active: and disabled: become pseudo-class rules, and sm: to 2xl: become min-width media queries at Tailwind's default breakpoints. Dark mode classes are converted to a prefers-color-scheme: dark query.

Theme colours

Named colours such as bg-blue-500 come from your Tailwind theme and their values differ between versions, so the converter does not guess them. They are listed under unconverted classes; replace them with your theme's value or an arbitrary colour like bg-[#5B8CFF].

When to keep Tailwind instead

Converting is useful for moving a component into a project without Tailwind, but within a Tailwind project utility classes are usually easier to maintain than a parallel stylesheet. If a class list is getting long, consider extracting a component in your framework rather than converting it to CSS.

How do I see what a Tailwind class does?

Paste the class, or a list of classes, and read the CSS declaration each one produces. For example px-4 becomes left and right padding of 1rem, and md:flex becomes display: flex inside a media query for medium screens and wider.

Worked example: a button

inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 becomes one CSS rule with display, alignment, gap, border radius, background, padding and colour, plus a :hover rule for the darker background. Anything that depends on your own theme is listed separately so you can fill in the exact values.

Frequently asked questions

Why convert Tailwind to CSS?

To reuse a Tailwind component in a project without Tailwind, to understand what a class list does, or to move styles into a component stylesheet.

Does it handle every utility?

It covers the core utilities that most components use. Unrecognised classes are listed rather than dropped, so you always know what is missing.

Can it go the other way?

Yes, with the CSS to Tailwind converter.

Does it use my project's theme?

No. It uses Tailwind's default scale for spacing and sizes. Where your project changes the theme, check the listed theme-dependent values.

Can I paste a whole HTML element?

Yes. You can paste markup straight from a template instead of copying the class list by hand.