CSS to Tailwind
Convert simple CSS rules or declarations to suggested Tailwind 4 classes. Review conflicts and unsupported selectors.
Select “Rule blocks” or “Declarations” in “Mode”, paste CSS and use “Convert”. Review selector mappings and warnings. Method and limits
Unsupported syntax or value.
Declarations
Method and limits
Method and limits
Tailwind 4 default-theme migration is advisory and grouped by simple selector. Choose Rule blocks or Declarations explicitly. Exact named equivalents or arbitrary property utilities preserve values, including pixels, colors, three-value spacing, borders, shadows, transitions and important suffixes. Font size does not silently add line height. Conflicting shorthand/longhand or repeated fallback declarations remain in original order for manual migration; unrelated safe classes may still be returned. Nested rules, at-rules and complex selectors are retained with warnings. Unsupported or unsafe values get reasons. Selector specificity, cascade, custom themes and preflight are not reproduced; classes are never applied to this page.
Tool input is processed locally in a worker, without uploads, storage or source logging. Ads and the rest of the site may make network requests. Assets must load first; offline operation is not guaranteed.
Input 1 MiB UTF-8; output 2 MiB; 5 s including loading. CSS/HTML: depth 128, nodes 50000. Worker termination mitigates resources; it is not heap isolation.
Copied
Copy failed. Select the result and copy it manually.
About CSS to Tailwind
Useful when migrating a legacy stylesheet or an old component to Tailwind. Parsing happens in your browser; the CSS is never uploaded.
.x { display:flex; padding:1rem; color:#ffffff; } → flex p-4 text-white
Versioned technical method; no calendar or legal reference year applies.
Use Cases
How to use
Paste CSS into “Input”, or use “Load sample” to load an example.
Select “Rule blocks” or “Declarations” in “Mode”, paste CSS and use “Convert”. Review selector mappings and warnings.
Click Copy to take the generated classes to your clipboard.
Use “Clear” to empty the draft and result; “Cancel” stops current work.
Pro Tips
- Use keyboard shortcuts (Ctrl/Cmd+A to select all, Ctrl/Cmd+C to copy) to speed up your workflow inside the CSS To Tailwind.
- The CSS To Tailwind does not log or store your input. If you need history, copy important outputs to a local file or note app.
- Review warnings and the output before copying. A successful transform is not proof of compatibility with your application.
Frequently Asked Questions
Tailwind 4 default-theme migration is advisory and grouped by simple selector. Choose Rule blocks or Declarations explicitly. Exact named equivalents or arbitrary property utilities preserve values, including pixels, colors, three-value spacing, borders, shadows, transitions and important suffixes. Font size does not silently add line height. Conflicting shorthand/longhand or repeated fallback declarations remain in original order for manual migration; unrelated safe classes may still be returned.
Nested rules, at-rules and complex selectors are retained with warnings. Unsupported or unsafe values get reasons. Selector specificity, cascade, custom themes and preflight are not reproduced; classes are never applied to this page.