Skip to content

Menu

Tailwind to CSS

Convert Tailwind classes to plain CSS

Runs entirely in your browserConvertersFree, no sign-up
Loading tool

01What is Tailwind to CSS?

Sometimes you need the plain CSS behind a Tailwind class string. Maybe a component is moving into a CSS modules codebase, or you're writing an HTML email where utility classes are useless. Paste the classes here and the tool writes the matching declarations inside a single .element rule. It works from a lookup table of 214 utilities. The values were checked against what Tailwind CSS 3.4 generates with its default theme, as listed in the official Tailwind docs. There is one deliberate difference. Tailwind's own output routes shadows and some other values through --tw-* custom properties, and this tool writes the final resolved values instead, which is what you want when you leave Tailwind behind. Tailwind v4 expresses spacing and colors differently again, so expect gaps if you compare against a v4 build. The table covers display, position, flexbox, padding and margin on the 0.25rem spacing scale, widths and heights including fractions and screen units. It also knows font sizes from text-xs to text-3xl with their paired line heights, font weights and families, text alignment and decoration, leading and tracking, border radius and width. Opacity steps, shadows, gap, overflow, z-index, cursor, pointer events, user-select and inset are in there too. The conversion itself is simple on purpose. Your input is split on whitespace and each class is looked up in order. A match adds one or more declarations. A miss is kept in the output as a /* unknown: class */ comment and listed in a warning under the panels. A counter shows how many classes were converted out of the total. For example, text-sm font-semibold w-1/2 gives font-size: 0.875rem, line-height: 1.25rem, font-weight: 600 and width: 50%. Notice that text-sm produces two lines. One utility can expand to several properties, and truncate expands to three. Now the honest part. Variant prefixes such as hover: and md: are not handled, nor are arbitrary values like w-[37px], and most color classes aren't in the table. Your tailwind.config theme is ignored, so customised spacing or fonts won't show up. Declarations are written in the order you typed the classes, so p-4 px-2 gives padding followed by padding-left and padding-right. That happens to match the cascade result here, but Tailwind orders its own CSS by utility type rather than by your class order. The lookup happens in your browser, and the class list you paste isn't uploaded.

Front-end developers who need the plain CSS behind a Tailwind class string when moving a component out of Tailwind or building an email. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Tailwind to CSS

  1. Paste utilities into Tailwind Classes, or load Card Component, Button Styles or Page Layout.
  2. Check the counter that shows how many classes were converted.
  3. Review the CSS Output and the red box listing any unrecognized classes.
  4. Click Copy, rename .element to your own selector and write the unknown ones by hand.

03Worked examples

Input: flex items-center justify-between
Result: .element { display: flex; align-items: center; justify-content: space-between; }
Three classes, three declarations, in the order you typed them.
Input: p-4 rounded-lg shadow-md
Result: .element { padding: 1rem; 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); }
The shadow is written as the resolved value, without Tailwind's --tw-* variables.
Input: text-sm font-semibold w-1/2
Result: .element { font-size: 0.875rem; line-height: 1.25rem; font-weight: 600; width: 50%; }
text-sm sets both font-size and line-height, and fractions become percentages.
Input: truncate
Result: .element { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
One utility class can expand to several CSS declarations.
Input: p-4 px-2
Result: .element { padding: 1rem; padding-left: 0.5rem; padding-right: 0.5rem; }
Declarations follow your class order, so the later px-2 overrides the sides set by p-4.
Input: hover:bg-blue-500 mt-4
Result: .element { /* unknown: hover:bg-blue-500 */ margin-top: 1rem; }
Variant classes aren't converted. They stay as a comment and show up in the unrecognized list.

04Common use cases

  • Moving a card or button component from a Tailwind project into a codebase that uses CSS modules or styled-components
  • Writing inline styles for an HTML email template based on a design that was built in Tailwind
  • Reading someone else's JSX and working out what a long utility string does to layout
  • Teaching flexbox and spacing to developers who learned layout through Tailwind classes first
  • Checking which exact rem value a spacing or font-size class maps to before matching it in a Figma spec
  • Producing a plain CSS fallback for a widget that gets embedded on pages without Tailwind loaded

05Tips

  • Strip variant prefixes before pasting, then convert each hover: or md: group separately and wrap it in :hover or a media query yourself.
  • Tailwind's border class relies on preflight setting border-style: solid, so add that line in plain CSS or the border won't show.
  • text-sm and friends also set line-height. Delete that line if your target styles already control it.
  • If your project customises the theme, run the Tailwind CLI on a file holding just those classes to see config-aware output.

06Related concepts

Tailwind CSS, Utility-first CSS, CSS declarations, Design tokens, CSS modules.

Frequently Asked Questions

What is Tailwind to CSS?

Tailwind to CSS is a free, browser-based developer tool on AIDToolStack. Convert Tailwind classes to plain CSS It requires no installation or sign-up and works entirely in your browser.

Is Tailwind to CSS free to use?

Yes. No sign-up, no fees and no usage cap.

Does Tailwind to CSS store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe