CSS to Tailwind Converter
Convert vanilla CSS to Tailwind CSS utility classes with property mapping and spacing scale conversion
CSS to Tailwind Converter
37 CSS properties converted
CSS input
Paste CSS declarations or full rule blocksTailwind output
37 classes generatedflex flex-col items-center justify-between w-full max-w-96 pt-6 pr-8 pb-6 pl-8 mt-0 mr-auto mb-0 ml-auto bg-gray-800 border border-solid border-gray-700 rounded-lg shadow-md text-sm font-semibold text-gray-100 cursor-pointer transition-all overflow-hidden relative z-10 opacity-95 gap-4 text-2xl font-bold text-center no-underline tracking-tight leading-tight whitespace-nowrapdisplay: flex→flexflex-direction: column→flex-colalign-items: center→items-centerjustify-content: space-between→justify-betweenwidth: 100%→w-fullmax-width: 384px→max-w-96padding-top: 24px→pt-6padding-right: 32px→pr-8padding-bottom: 24px→pb-6padding-left: 32px→pl-8margin-top: 0→mt-0margin-right: auto→mr-automargin-bottom: 0→mb-0margin-left: auto→ml-autobackground-color: #1f2937→bg-gray-800border-width: 1px→borderborder-style: solid→border-solidborder-color: #374151→border-gray-700border-radius: 8px→rounded-lgbox-shadow: 0 4px 6px rgba(0, 0, 0, 0.1)→shadow-mdMatched closest Tailwind shadow
font-size: 14px→text-smfont-weight: 600→font-semiboldcolor: #f3f4f6→text-gray-100cursor: pointer→cursor-pointertransition: all 200ms ease-in-out→transition-alloverflow: hidden→overflow-hiddenposition: relative→relativez-index: 10→z-10opacity: 0.95→opacity-95gap: 16px→gap-4font-size: 24px→text-2xlfont-weight: 700→font-boldtext-align: center→text-centertext-decoration: none→no-underlineletter-spacing: -0.025em→tracking-tightline-height: 1.25→leading-tightwhite-space: nowrap→whitespace-nowrapUpdated . Provided as is. Check the output before you rely on it in production.
How to use CSS to Tailwind Converter
- 1
Paste CSS rules
Paste CSS declarations or full rule blocks, for example color: red; padding: 1rem;, or load the sample.
- 2
Get the Tailwind classes
The tool shows the combined class string, for example text-red-500 p-4, as you type.
- 3
Review the property breakdown
Each declaration is listed with its Tailwind class and a confidence label: exact match, nearest scale value, arbitrary [value] or needs manual review.
- 4
Handle responsive and state styles
For media queries use breakpoint prefixes (sm:, md:, lg:); for :hover and :focus use the hover: and focus: variants.
- 5
Copy or download
Copy the combined classes or download the result.
Questions and answers
What is CSS to Tailwind Converter?
Does it support all CSS properties?
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Browser workflow
Runs instantly in the browser with private local processing and copy/export-ready output.
Browser Workflow
This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.
/tailwind-converter/
For automation planning, fetch the canonical contract at /api/tool/tailwind-converter.json.