CSS to Tailwind
Map plain CSS declarations to their Tailwind utility equivalents.
- Your draft is kept in this tab's session storage and cleared when the tab closes.
Draft kept in this tab
Your draft is kept in this tab's session storage and cleared when the tab closes. - Processing happens in this page. No application server receives your input.
Runs in your browser
Processing happens in this page. No application server receives your input.
CSS declarations
Tailwind classes
Mapping summary
- Preset
- v4
- Arbitrary values
- Enabled
- Mapped classes
- 0
- Unmapped declarations
- 0
Unmapped declarations
| Line | Property | Value | Reason |
|---|---|---|---|
| Enter CSS declarations to see which ones could not be mapped. | |||
What this tool does
Maps plain CSS declarations onto Tailwind v3 or v4 utility classes entirely locally in-page, expanding shorthands, applying responsive @media and pseudo-class prefixes, and reporting every unmapped declaration with its source line instead of dropping it silently.
Mapping rules
- Exact palette colors (such as color: red or background-color: #3b82f6) and spacing scale values (such as 4px -> 1, 16px -> 4) map directly to canonical Tailwind utilities.
- When Arbitrary values is enabled, non-scale values on supported spacing, sizing, typography, color, radius, border, shadow, opacity, and z-index properties emit bracketed utilities (such as margin-top: 13px -> mt-[13px]). When disabled, those declarations are reported in the Unmapped declarations table.
- Shorthand properties (margin, padding, and two-value overflow) expand into their longhand or axis utilities before mapping.
- !important declarations preserve the ! utility prefix (such as !text-blue-500), and @media breakpoint rules (sm, md, lg, xl, 2xl, dark) and pseudo-class selectors (:hover, :focus, :active, :disabled, :first-child, :last-child) prepend their variant prefixes.
- Preset v4 vs v3 applies versioned token names where the scale changed (such as border-radius: 4px -> rounded-sm in v4 vs rounded in v3, outline: none -> outline-hidden in v4 vs outline-none in v3).
- CSS custom properties (--*) and unsupported properties are never silently dropped (FR-CODE-3); every unmapped declaration is listed with its 1-based line number, property, value, and reason.
- Empty or whitespace-only input is the neutral cleared state and produces empty output with no error (GAP-013).
Operational limits & execution
In-page: the mapping runs again on every change of the CSS or of a setting.
Maximum input size: 256.0 KB and 4,096 declarations (returns InputTooLarge above either cap). Unterminated blocks, strings, or comments and malformed declarations return MalformedCss naming the 1-based line number. Runs synchronously in-page with zero external dependencies.
Worked example
Input:
a { color: red; margin-top: 13px; }Expected output:
text-red-500 mt-[13px]Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.