🧾 JSON Formatter
Format, validate and beautify JSON — handy for Tailwind config snippets and API responses.
Open tool →Paste your CSS and instantly get clean, optimized Tailwind utility classes — spacing, colors, typography, flexbox, grid, responsive breakpoints, hover/focus states and dark mode, all mapped automatically. Nothing is uploaded; the whole conversion runs in your browser.
Paste CSS on the left — Tailwind classes appear live on the right
Paste CSS on the left, or load the sample, to see Tailwind classes here.
These can't become a single utility class — use them as arbitrary values like bg-[var(--brand)], or add them to tailwind.config.js under theme.extend.
💡 Tip: drag & drop a .css file anywhere on the input panel, or paste CSS with Ctrl/Cmd+V. Conversion runs live as you type — nothing is ever uploaded.
Built for real-world stylesheets, not just single-property demos — with variant awareness, validation and multiple export formats.
Your CSS is parsed and converted entirely in your browser. Nothing is uploaded to a server, ever.
Classes regenerate as you type, with instant validation and warnings — no “Convert” button required.
Hex, RGB, HSL and named colors are matched against Tailwind's actual default palette, with opacity modifiers preserved.
@media breakpoints, hover/focus/active/disabled states, ::before/::after and dark mode all map to proper Tailwind variants.
Unsupported properties fall back to Tailwind's arbitrary value syntax and are flagged in a warnings panel — not discarded.
Copy plain utility classes, or export as HTML, JSX, TSX, Vue, Svelte, Angular, Blade or Astro-ready snippets.
No install, no sign-up — go from a stylesheet to utility classes in seconds.
Paste, type, drag & drop a .css file, or load the sample to see it working instantly.
Choose Tailwind v3 or v4 utility naming — the output updates immediately.
Check the warnings panel for anything that needed an arbitrary value or a manual look.
Copy the plain classes, or switch to an HTML/JSX/Vue/Svelte export tab and paste into your project.
A quick reference for teams deciding whether — and how — to migrate to Tailwind.
| Aspect | Tailwind CSS | Traditional CSS |
|---|---|---|
| Where styles live | Directly in your markup as utility classes | In separate stylesheets with custom class names |
| Naming | No naming decisions — utilities are pre-named | Requires a naming convention (BEM, etc.) |
| CSS file growth | Stays roughly constant as the app grows | Grows with every new component/page |
| Unused styles | Purged automatically at build time | Easy to accumulate unused, dead CSS |
| Design consistency | Enforced by a shared spacing/color scale | Depends on developer discipline |
| Aspect | Tailwind CSS | Bootstrap |
|---|---|---|
| Approach | Low-level utility classes you compose | Pre-built components (navbar, card, modal…) |
| Visual identity | Custom by default — no “Bootstrap look” | Recognizable default theme unless customized |
| Learning curve | Utility names to learn, but stays in HTML | Component markup + class conventions to learn |
| Bundle size | Small after purging unused utilities | Larger unless components are cherry-picked |
| Aspect | Utility-first | Component CSS (BEM/OOCSS) |
|---|---|---|
| Context switching | Style while looking at markup | Switch between HTML and CSS files |
| Refactoring | Change classes on one element, no ripple effect | Editing a shared class can affect many elements |
| Reusability | Reuse utilities everywhere; extract components later | Reuse via shared class names from the start |
| Aspect | Tailwind v4 | Tailwind v3 |
|---|---|---|
| Configuration | CSS-first (@theme in your CSS file) | JavaScript tailwind.config.js |
| Engine | New Oxide engine, faster builds | PostCSS-based build pipeline |
| Utility naming | Same core utilities as v3 (grow, shrink, rounded-*) | Same core utilities (this converter targets both) |
| Browser support baseline | Modern browsers (uses native CSS cascade layers) | Broader legacy browser support |
Tailwind CSS is a utility-first CSS framework: instead of writing custom class names and CSS rules for every component, you compose a look by combining small, single-purpose utility classes directly in your HTML — flex, items-center, gap-4, rounded-lg, bg-blue-500. Each utility maps to exactly one CSS declaration (or a very small, predictable set of them), drawn from a consistent design scale for spacing, color, typography and more. Rather than inventing a new class name every time you need a new look, you assemble one from existing building blocks — which is also exactly what this converter automates for CSS you already have.
“Utility-first” means the smallest reusable unit of styling is a utility class, not a component class. Traditional CSS encourages naming things — .card-header, .btn-primary — and then writing the rules that make them look right. Utility-first flips that: the rules already exist as pre-named utilities, and you reach for the ones you need. The tradeoff is more classes in your markup in exchange for never having to invent a name, hunt through a separate stylesheet, or worry that changing one class will unexpectedly affect other elements that happen to share it.
Teams usually convert existing CSS to Tailwind for one of three reasons: migrating a legacy codebase onto a modern utility-first workflow, prototyping faster by pasting styles from a design tool export and turning them into utilities immediately, or simply learning Tailwind by seeing familiar CSS translated side-by-side into its utility equivalents. Manually translating even a modest stylesheet is tedious and error-prone — you have to memorize (or constantly look up) Tailwind's spacing scale, color palette, and naming conventions for dozens of properties. An automated converter removes that friction and gives you a first-pass result to refine, rather than a blank page.
The core difference is where the styling decisions live. In traditional CSS, a rule like .card { padding: 16px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.1); } lives in a stylesheet, separate from the markup that uses it. In Tailwind, the same result is expressed directly on the element as class="p-4 rounded-lg shadow". Neither approach is “correct” in isolation — Tailwind trades a longer class attribute for the elimination of an entire category of problems: unused CSS, specificity wars, and the mental overhead of naming things. This converter exists precisely to bridge the two: keep writing or receiving CSS the way you always have, and get the Tailwind equivalent without manual lookup.
Tailwind v4 introduced a new, faster engine (nicknamed Oxide) and moved configuration from a JavaScript tailwind.config.js file to a CSS-first @theme block, but the vast majority of utility class names stayer identical between the two versions — flex, p-4, bg-blue-500 and md:hover:underline all work the same way in both. The handful of naming differences (for example v3's later versions already use grow/shrink rather than the old flex-grow-0 style) are handled by the version toggle above, so you can target whichever major version your project uses.
Tailwind's spacing scale is based on a 0.25rem (4px) unit: 1 = 0.25rem, 2 = 0.5rem, 4 = 1rem, and so on up through 96 = 24rem, plus a few in-between fractional steps like 0.5 and 1.5. This converter matches your CSS pixel and rem values against that exact scale for margin, padding, gap, width and height, and falls back to an arbitrary value like p-[19px] only when a number genuinely doesn't land on the scale — so you always get an accurate result, never a rounded approximation presented as exact.
Font sizes map to Tailwind's named scale (text-sm, text-base, text-lg…), font weights map to font-medium/font-semibold/font-bold and so on, line-heights map to leading-tight/leading-normal/leading-relaxed, and letter-spacing maps to tracking-tight/tracking-wide. Text alignment, transform, decoration and white-space all have direct one-to-one utility equivalents as well.
Colors are the trickiest part of any CSS-to-Tailwind conversion, because your original CSS almost certainly wasn't written using Tailwind's exact palette. This converter first checks for an exact hex match against Tailwind's default 22-hue, 10-shade color system; if there isn't one, it looks for the closest color within a tight tolerance and uses that; and if nothing is close enough to be a fair substitute, it falls back to an arbitrary value like bg-[#2f6fed] so your exact color is preserved rather than silently shifted. RGBA and HSLA colors with an alpha channel are converted using Tailwind's opacity modifier syntax, like bg-blue-500/50.
display: flex becomes flex, flex-direction: column becomes flex-col, and alignment properties like justify-content and align-items map directly to justify-* and items-* utilities. Modern gap is supported directly (gap-4, gap-x-2, gap-y-6), and the flex shorthand's common values (1 1 0%, 1 1 auto, none) map to flex-1, flex-auto and flex-none respectively.
display: grid becomes grid, and the very common grid-template-columns: repeat(N, minmax(0, 1fr)) pattern converts to grid-cols-N. Column and row spans written as span N / span N convert to col-span-N / row-span-N. Anything more exotic — named grid lines, grid-template-areas, uneven track sizes — falls back to an arbitrary value so it's still captured, just not simplified to a named utility.
Tailwind's default breakpoints are sm (640px), md (768px), lg (1024px), xl (1280px) and 2xl (1536px), applied as a prefix like md:flex meaning “apply this utility from the md breakpoint upward.” This converter reads your @media (min-width: …) and @media (max-width: …) rules, matches the width against those defaults, and prefixes every utility generated from declarations inside that block accordingly — including an arbitrary min-[900px]: style prefix for non-standard breakpoints.
Both @media (prefers-color-scheme: dark) blocks and a .dark ancestor class selector (the two most common ways dark mode is implemented in hand-written CSS) are recognized and converted to Tailwind's dark: variant, which by default works the same way — either following the OS color scheme or toggling via a .dark class on a parent element, depending on your tailwind.config setting.
Pseudo-class selectors like :hover, :focus, :focus-visible, :active, :disabled, :checked, :first-child and :last-child map to Tailwind's state variants (hover:, focus:, active:, disabled:, first:, last:…), and ::before/::after map to before:/after:, including converting the CSS content value into Tailwind's content-[…] arbitrary utility. More complex selectors — descendant combinators, :nth-child(), :not() — are flagged in the warnings panel rather than guessed at, since mapping them safely usually requires restructuring the markup (for example into Tailwind's group/peer pattern) rather than a mechanical translation.
Tailwind's square-bracket arbitrary value syntax — top-[13px], bg-[#2f6fed], grid-cols-[repeat(auto-fill,minmax(120px,1fr))] — lets you express any CSS value without waiting for a named utility to exist. This converter leans on it deliberately: whenever a value doesn't cleanly match Tailwind's default scale, or a property has no dedicated utility at all, the tool emits an arbitrary value (or, for entirely unmapped properties, an arbitrary property like [mask-type:luminance]) instead of silently dropping the declaration. Every arbitrary value used is also counted in the stats panel so you can see at a glance how much of your CSS mapped cleanly versus how much needs a second look.
A converter can only work with Tailwind's default design tokens — it has no way of knowing about custom colors, spacing, or fonts defined in your project's own tailwind.config.js (v3) or @theme block (v4). If your output contains a lot of arbitrary values that are visually close to each other, that's usually a sign worth extending your theme with a named token instead — for example turning three different bg-[#2f6fed]-ish arbitrary colors into a single brand color you can reuse as bg-brand.
CSS variables (--brand: #2f6fed;) can't become a single Tailwind utility class on their own, so this tool surfaces them separately in a “CSS variables detected” panel instead of guessing. When a variable is actually used as a value elsewhere (color: var(--brand)), the converter preserves that reference directly as an arbitrary value — text-[var(--brand)] — which is valid Tailwind syntax and keeps your design token live rather than baking in a static color.
A first-pass conversion is a starting point, not a finished component. Once you have the utility classes for a repeated pattern like a button or card, the idiomatic next step in Tailwind is to either keep repeating the utility list everywhere it's used (Tailwind is designed for this — repetition is cheap once compressed by gzip and gets easier to manage with editor snippets), or extract a framework component (a React/Vue component, a Blade partial, an Astro component) that wraps the class list once. This converter's HTML/JSX/Vue/Svelte/Angular/Blade/Astro export tabs give you a ready-made starting snippet for exactly that second step.
React uses className instead of class, so the JSX and TSX export tabs generate the exact same utility list wrapped in a className="…" attribute on a generic element, ready to paste into a component and adjust the tag/children as needed.
Vue templates use the standard HTML class attribute, so the Vue export tab mirrors the HTML output — paste it directly into a <template> block in a single-file component.
Laravel's Blade templates also use a plain class attribute; the Blade export tab uses Blade-style {{-- comment --}} annotations above each block so you can quickly identify which original CSS selector each utility list came from while wiring it into your .blade.php views.
Next.js apps are React under the hood, so the same JSX/TSX export applies — paste the generated className string into your Server or Client Components. If you're using the Next.js App Router with Tailwind already configured, no additional setup is needed beyond having Tailwind's build pipeline watching your files.
:nth-child(), etc.) to safely auto-map; check the warnings panel for the exact selector.[mask-type:luminance] — Tailwind has no dedicated utility for that CSS property; the arbitrary property syntax is the correct, valid way to express it.animate-[name].Because Tailwind's build step scans your markup and only ships the utility classes you actually use, production CSS bundles are typically smaller and grow much more slowly than a hand-maintained stylesheet, where old rules tend to accumulate rather than get deleted. Fewer, more predictable CSS rules also reduce specificity conflicts and the amount of dead code review needed over a project's lifetime — the migration effort up front tends to pay for itself in reduced long-term CSS maintenance.
Converting CSS to Tailwind is mostly mechanical — matching values against Tailwind's design scale, mapping selectors to variants, and falling back to arbitrary values when nothing fits — which is exactly the kind of repetitive, detail-sensitive work a browser-based tool can do instantly and privately. Paste your CSS above to get a working first draft, then use the warnings panel and this guide to refine anything that needs a human decision.
Other browser-based tools that pair well with a CSS/Tailwind workflow.
Everything developers usually ask before migrating CSS to Tailwind.
Tailwind CSS is a utility-first CSS framework where you style elements by composing small, single-purpose classes like flex, p-4 or text-blue-500 directly in your markup, instead of writing custom CSS rules.
This tool parses your CSS into selectors and declarations, then maps each property/value pair to the closest matching Tailwind utility class using Tailwind's default spacing, color, typography and breakpoint scales — falling back to an arbitrary value when nothing matches closely.
Yes. A version toggle switches the generated utility names between Tailwind v3 and v4 conventions.
Yes. @media (min-width: …) and (max-width: …) rules are mapped to Tailwind's sm:, md:, lg:, xl: and 2xl: breakpoint prefixes, or an arbitrary variant when the width doesn't match a default breakpoint.
Yes, including @media (prefers-color-scheme: dark), which is converted to Tailwind's dark: variant.
Yes — display: flex, flex-direction, justify-content, align-items, flex-wrap, gap and related properties all map to their Tailwind flex utilities.
Yes — display: grid, grid-template-columns/rows using repeat(), grid-column/row spans, and grid gap are supported.
You can export the generated classes as a JSX or TSX snippet using className, ready to paste into a React or Next.js component.
Yes, choose the Vue export tab to get a class-based snippet formatted for a Vue single-file component template.
Common pseudo-classes like :hover, :focus, :active, :disabled, :first-child and :last-child are mapped to Tailwind state variants, and ::before/::after are mapped to the before:/after: variants.
No. Parsing and conversion run entirely in your browser using JavaScript. Your CSS is never sent to ToolAdda or any server.
Once the page has loaded, conversion itself works without an internet connection since it runs locally in your browser.
Yes, completely free with no sign-up, no watermark and no usage limits.
CSS custom properties are detected and listed separately since they can't become a single utility class — the tool suggests using them as arbitrary values or adding them to your tailwind.config theme.
Yes. Whenever a value doesn't cleanly match Tailwind's default design scale, the tool falls back to Tailwind's square-bracket arbitrary value syntax, so nothing is silently dropped.
The converter doesn't edit your tailwind.config file, but detected CSS variables and repeated arbitrary values are good candidates to add to your theme.extend.
Properties with no direct Tailwind utility are converted using Tailwind's arbitrary property syntax, like [mask-type:luminance], and flagged in the warnings panel.
Yes, the parser processes the whole stylesheet at once and lists results per selector; very large files may take a moment longer since conversion runs on your device's CPU.
Yes. Duplicate classes are removed, repeated CSS properties within one rule resolve to only the last value, and classes can be sorted into a logical, Tailwind-like order.
Yes. Load the sample CSS to see a working example, and the warnings panel explains in plain language anything that needed a fallback.
Yes, breakpoint context from @media rules is carried through as a variant prefix on every utility class generated from declarations inside that block.
The output panel is read-only by design so it always reflects your current CSS input exactly, but you can copy it anywhere and edit it freely from there.
Yes, both for the tool's own interface and for conversion — .dark ancestor selectors and prefers-color-scheme: dark media queries both map to Tailwind's dark: variant.
Common animation values matching Tailwind's built-in spin, ping, pulse and bounce keyframes are recognized; custom @keyframes animations are flagged for you to add to your Tailwind config.
Yes, 100%. There is no backend — parsing, mapping and rendering all happen with JavaScript running locally on your device.
No sign-up, no install, no upload — paste your CSS and get Tailwind classes instantly.
🧩 Start converting now