Skip to content

CSS to Tailwind Converter

Turn a stylesheet into Tailwind utility classes, with variants for hover and breakpoints.

Drop a .css file here, or click to choose one

Converted on your device — the file is never uploaded

Tailwind classes

Quick Tool Overview

The CSS to Tailwind Converter maps a stylesheet onto Tailwind’s utility scale, turning media queries into responsive prefixes and pseudo-classes into variants, with arbitrary values where the scale does not reach.

What it does
Turns CSS rules into Tailwind classes
You give it
A stylesheet or a component’s CSS
You get back
Classes per selector, HTML, or @apply rules
Best for
Migrating a project to Tailwind
Converters Free, unlimited use No sign-up Runs in your browser

About the CSS to Tailwind Converter

Moving a project to Tailwind means rewriting every rule as utilities, and the tedious part is not the thinking — it is remembering that 1rem is 4, that 8px is rounded-lg, and that #3b82f6 is blue-500.

Paste a stylesheet and get the classes. Spacing, sizing, colour, typography, borders, radius, shadows, flexbox, grid, position, overflow and transitions are all mapped to Tailwind’s own scale, and anything that has no place on it becomes a valid arbitrary value such as p-[13px] rather than being silently rounded. Media queries turn into responsive prefixes, :hover and ::before turn into variants, and prefers-color-scheme: dark turns into dark:. Take the result as a plain list, as ready-made HTML, or as @apply rules for a gradual migration.

Key features of the CSS to Tailwind Converter

The whole common scale

Spacing, sizing, colour, type, borders, radius, shadow, flex and grid.

Variants from selectors

:hover, ::before, breakpoints and dark mode become prefixes.

Honest about odd values

13px becomes p-[13px] rather than being rounded to something else.

Exact colour matching

Palette names only where the value matches exactly, never a near miss.

Three output shapes

A list per selector, ready-made HTML, or @apply for a staged migration.

How to use the CSS to Tailwind Converter

  1. 1

    Paste or drop your CSS

    A whole stylesheet, or the rules for one component.

  2. 2

    Pick the output shape

    A list per selector, HTML with class attributes, or @apply rules.

  3. 3

    Check the arbitrary values

    They show where your design does not sit on Tailwind’s scale.

  4. 4

    Copy the classes

    Selector by selector, from the table underneath.

Frequently asked questions

It keeps its exact value as text-[#123456]. Matching it to the nearest palette colour would change your design without saying so, which is worse than an arbitrary value.

Reviews of the CSS to Tailwind Converter

What people who use the CSS to Tailwind Converter think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the CSS to Tailwind Converter. It takes half a minute and no account.

Write the first review

More converters