/* <div class="flex flex-col items-center p-6 rounded-2xl bg-white shadow-md"> */ .div { display: flex; flex-direction: column; align-items: center; padding: 1.5rem; border-radius: 1rem; background-color: #ffffff; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); } /* <img class="size-48 rounded-lg shadow-xl"> */ .img { width: 12rem; height: 12rem; border-radius: 0.5rem; box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); } /* <div class="mt-4 text-center"> */ .div-2 { margin-top: 1rem; text-align: center; } /* <h2 class="text-lg font-semibold text-gray-900"> */ .h2 { font-size: 1.125rem; font-weight: 600; color: #111827; } /* <p class="text-sm text-gray-500 mt-1"> */ .p { font-size: 0.875rem; color: #6b7280; margin-top: 0.25rem; } /* <button class="mt-4 px-6 py-2 rounded-full bg-blue-600 text-white text-sm font-medium hover:bg-blue-700 transition"> */ .button { margin-top: 1rem; padding-left: 1.5rem; padding-right: 1.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; border-radius: 9999px; background-color: #2563eb; color: #ffffff; font-size: 0.875rem; font-weight: 500; transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; } .button:hover { background-color: #1d4ed8; }
Tailwind to CSS Converter — Expand Utility Classes to Plain CSS Online
What's included
Features
About this tool
See What Tailwind Classes Actually Do — Expand Any Class to Plain CSS Instantly
You're debugging a layout and items-center isn't centering what you expect — but you're not sure if it's the wrong class or a parent container issue. You want to share a Tailwind className string with a teammate who doesn't know Tailwind. Or you're removing Tailwind from a project and need the equivalent CSS for each component's class list. Paste the class string here and see the exact CSS it produces in one click.
This converter expands Tailwind utility classes to their exact CSS declarations in real time. Paste one class, a full className attribute, or an entire HTML or JSX snippet — the right panel instantly shows the CSS grouped into a clean .element { } rule block. Supports 200+ utilities covering every display mode, all flexbox and grid properties, the complete spacing scale, all sizing utilities, the full typography system, colors, borders, effects, transitions, and transforms. All processing runs in your browser — no server, no sign-up.
Arbitrary value classes are handled in full: w-[420px] expands to width: 420px, bg-[#3b82f6] expands to background-color: #3b82f6, and translate-x-[calc(50%_-_8px)] expands correctly to transform: translateX(calc(50% - 8px)). Responsive variants like md:flex expand to @media (min-width: 768px) { .element { display: flex; } }, hover:bg-blue-500 expands to .element:hover { background-color: #3b82f6; }, and dark:text-white expands to an @media (prefers-color-scheme: dark) block. The full five-breakpoint system (sm, md, lg, xl, 2xl), all pseudo-class variants, and dark/print/motion media variants are all supported.
Step by step
How to Use
- 1Paste Tailwind classes into the left panelPaste a space-separated class list like
flex items-center justify-between p-4 bg-white rounded-lg shadow, or an HTML element with aclass="..."attribute, or a JSX element withclassName="...". The tool strips markup and attribute syntax automatically and processes only the class values. Multiple elements can be pasted at once. - 2Review the live CSS outputThe right panel updates instantly. Base classes appear in a single
.element { }block. Responsive variant classes likemd:flexorlg:grid-cols-3appear in separate@media (min-width: ...)blocks below. State variants likehover:bg-blue-500appear in.element:hover { }selectors. Dark mode classes likedark:text-whiteappear in@media (prefers-color-scheme: dark)blocks. - 3Handle arbitrary value classesArbitrary value classes like
w-[420px],text-[#1f2937],mt-[calc(100vh-4rem)]expand to their exact CSS property and value. Underscores inside arbitrary values convert to spaces:translate-x-[50%_-_8px]becomestransform: translateX(50% - 8px). All standard arbitrary value patterns includingcalc(), CSS custom properties, and URL values are supported. - 4Switch between CSS, SCSS, and JS Object outputUse the tabs in the header to switch output format. CSS gives a clean rule block. SCSS gives nested output with pseudo-class and media variants nested inside the selector. JS Object gives a JavaScript styles object with camelCased property names — useful for React inline styles or styled-components. Selector labels auto-generate from the HTML tag (
.div,.button, etc.) and can be clicked to rename. - 5Upload a file for bulk conversionClick Upload or drag and drop a
.html,.jsx,.tsx, or.txtfile onto the input panel. The tool reads the file, extracts allclass=""andclassName=""attribute values it finds, and converts them. Each element gets its own CSS block with an annotated comment. You can rename the auto-generated selectors using the selector strip that appears below the toolbar. - 6Copy or download the CSS outputClick Copy CSS, Copy SCSS, or Copy JS (depending on the active tab) to copy to clipboard. Click Download to save the output as a
.css,.scss, or.jsfile. The History panel stores the last 15 conversion sessions automatically — click any entry to restore that input and output instantly.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
Paste the Tailwind class name into the input panel — for example flex, p-6, or text-gray-700 — and the CSS it produces appears instantly on the right: display: flex, padding: 1.5rem, or color: #374151. You can paste a single class, a full space-separated class list, or an entire HTML/JSX snippet with a class or className attribute. The converter strips the markup and converts just the class values.
Paste the arbitrary value class directly and the converter expands it to the corresponding CSS property and value. w-[420px] becomes width: 420px, bg-[#3b82f6] becomes background-color: #3b82f6, and p-[1.5rem] becomes padding: 1.5rem. Underscores inside brackets are converted to spaces, so translate-x-[calc(50%_-_8px)] expands correctly to transform: translateX(calc(50% - 8px)). All standard arbitrary value patterns including calc() expressions, CSS variables, and URL values are supported.
Responsive variants are converted to @media (min-width: ...) rules using Tailwind's default breakpoints: sm at 640px, md at 768px, lg at 1024px, xl at 1280px, and 2xl at 1536px. For example, md:flex becomes @media (min-width: 768px) { .element { display: flex; } } and lg:grid-cols-3 becomes @media (min-width: 1024px) { .element { grid-template-columns: repeat(3, minmax(0, 1fr)); } }. All five standard Tailwind breakpoints are supported.
Pseudo-class variants (hover:, focus:, active:, disabled:, placeholder:, checked:) are converted to the appropriate CSS pseudo-class selectors — for example hover:bg-blue-500 becomes .element:hover { background-color: #3b82f6; }. Dark mode (dark:) is converted to @media (prefers-color-scheme: dark). Print (print:) becomes @media print. Motion-safe and motion-reduce variants are converted to @media (prefers-reduced-motion: ...) equivalents.
Yes. The converter detects and strips class="..." and className="..." attributes from pasted HTML or JSX automatically. Paste a full element like <button className="flex items-center gap-2 hover:bg-gray-100 px-4 py-2 rounded"> and it extracts and converts all the class values. You can also upload a .jsx, .tsx, or .html file — the tool reads all class and className attributes it finds and converts them.
The history panel stores up to 15 recent conversions automatically with a timestamp and a preview of the first few classes. Click any history entry to restore that input and output instantly — useful for comparing two class lists or returning to a string you were analyzing earlier.
No. All conversion runs entirely in your browser using JavaScript. Your class strings and any file contents you upload are never sent to any server, never stored, and never logged. Safe to use with proprietary component code, internal design systems, and client project code.
The converter uses Tailwind's stable class naming conventions which are compatible with both v3 and v4. Utility class names for spacing, typography, flexbox, grid, colors, and effects are the same in both versions. Some v4-specific changes to custom property naming and certain new utilities may not be reflected, but the vast majority of classes produce identical output across both versions.