01What is CSS to Tailwind?
Moving an old stylesheet into Tailwind usually means sitting with the docs open and translating one declaration at a time. This converter does the lookup part for you. Paste CSS and you get back a space-separated list of Tailwind utility classes. It strips comments first. If it finds rule blocks with braces, it pulls out only the declarations inside them, so you can paste whole selectors or bare property lines. Each declaration is lowercased and !important is dropped. The property:value pair is then looked up in a built-in table of roughly 500 exact mappings. The table covers display, position, flexbox, grid, spacing, sizing, typography, borders, overflow, cursor, z-index, transforms, filters, blend modes, aspect ratio and more. Matching is literal. padding: 24px becomes p-6 and font-size: 14px becomes text-sm. A value that isn't in the table, such as a brand hex color or 1.5rem padding, goes into an "Unmapped properties" comment below the classes instead of being guessed. Class names follow Tailwind CSS v4, as described in the official Tailwind documentation. We compiled every entry in the table with Tailwind 4 and compared the generated CSS with the declaration it is mapped from. That is why border-radius: 2px gives rounded-xs, since v4 moved rounded-sm to 4px. It is also why border-radius: 50% gives the arbitrary class rounded-[50%] rather than rounded-full, which draws a pill. Here is a quick example. Paste .card { border-radius: 2px; } followed by .a { border-radius: 50% !important } and the output is rounded-xs rounded-[50%]. The comment and the !important flag simply disappear. A few mappings are close rather than identical. Tailwind's ease-in, ease-out and ease-in-out use slightly different cubic-bezier curves from the CSS keywords. The font-size classes such as text-sm and text-lg also set a line-height, which plain font-size never does. There are honest gaps too. If you paste rules wrapped in @media, the declarations inside are still picked up, but the breakpoint isn't turned into a sm: or md: prefix. Classes from every selector land in one merged list, so the tool can't tell you which element each class belonged to. Multi-part shorthands like margin: 0 auto rarely match. Colors outside the table always end up unmapped. The toolbar shows how many declarations mapped and how many didn't. Copy Output copies only the class string, not the comment. Your CSS is converted by JavaScript in the page itself, so the stylesheet you paste never leaves your browser tab.
Front-end developers migrating stylesheets to Tailwind, and people learning Tailwind who already know plain CSS. The tool runs entirely in your browser, so your data never leaves your device.
02How to use CSS to Tailwind
- Paste CSS declarations or full rule blocks into the CSS Input panel
- Read the generated classes in the Tailwind Output panel as you type
- Check the toolbar counts for mapped and unmapped declarations
- Review the Unmapped properties comment and handle those manually
- Click Copy Output to copy just the class list, or Reset to clear the input
03Worked examples
- Input:
display: flex; justify-content: space-between; align-items: center; - Result:
flex justify-between items-center - Input:
padding: 16px; margin-top: 8px; border-radius: 9999px; - Result:
p-4 mt-2 rounded-full - 16px and 8px fall on Tailwind's default spacing scale (4px per step), so they map to p-4 and mt-2.
- Input:
position: absolute; top: 0; z-index: 50; - Result:
absolute top-0 z-50 - Input:
font-weight: 700; color: #ff0000; width: 37px; - Result:
font-bold /* Unmapped properties: color: #ff0000 width: 37px … - Values with no matching utility in the lookup are listed as unmapped instead of being guessed; use an arbitrary value such as w-[37px] yourself if you need one.
- Input:
.card { border-radius: 2px; } /* x */ .a{border-radius:50% !important} - Result:
rounded-xs rounded-[50%] - Comments and !important are removed. 2px is rounded-xs in Tailwind v4, and 50% gets an arbitrary class because rounded-full is a pill shape.
- Input:
@media (min-width: 640px) { .b { display: none; padding: 1.5rem; } } - Result:
hidden /* Unmapped properties: padding: 1.5rem … - Declarations inside @media are read, but no sm: prefix is added. The rem value is not in the px-keyed table, so it is listed as unmapped (output trimmed).
04Common use cases
- Moving a legacy component's stylesheet into a Next.js project that uses Tailwind
- Converting styles copied from browser DevTools into utility classes for a quick prototype
- Learning which Tailwind class corresponds to a familiar CSS declaration
- Cleaning up a Bootstrap-era card or button style while rewriting it in React
- Checking which declarations in a block will need arbitrary values or theme extensions
- Auditing a design handoff to see how many declarations fall off Tailwind's default spacing and radius scales
05Tips
- The table is keyed on pixel values from Tailwind's default scale. Convert rem values to px (1rem = 16px) before pasting to get far more matches.
- Off-scale numbers like padding: 18px won't map. Either round to the nearest scale step or write an arbitrary class such as p-[18px].
- Classes from multiple selectors are merged into one list, so paste one rule at a time if you need classes per element.
- Shorthand values with several parts, like margin: 0 auto or padding: 8px 16px, rarely match. Split them into longhand properties first.
06Related concepts
utility-first CSS, Tailwind spacing scale, CSS declarations, arbitrary values, design tokens.
Frequently Asked Questions
What is CSS to Tailwind?
CSS to Tailwind is a free, browser-based developer tool on AIDToolStack. Convert CSS to Tailwind utility classes It requires no installation or sign-up and works entirely in your browser.
Is CSS to Tailwind free to use?
Yes. No sign-up, no fees and no usage cap.
Does CSS to Tailwind store my data?
No. It runs in your browser; nothing is uploaded.