b2KIT

Tailwind to CSS Converter

Convert Tailwind CSS utility classes to standard CSS properties with proper grouping and formatting.

Tested tool guide Tested browser tools Checked August 16, 2026

What Tailwind to CSS Converter does, with a checked example

Paste the class attribute of a Tailwind-styled element - or a bare class string - and this tool returns the equivalent CSS declarations, grouped so related properties sit together and formatted one declaration per line. Each utility token is resolved against Tailwind's default scales and value tables. Two things trip people up. The output is declarations, not a complete rule: it carries no selector, and responsive or state variants like md: or hover: keep none of their trigger context, so that behavior has to be rebuilt by hand. And the step number in a spacing class is not pixels: p-4 means 1rem, not 4px.

Worked example

A concrete input and expected output from the current implementation.

Input

flex items-center justify-between p-4 rounded-lg

Expected output

display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem;
border-radius: 0.5rem;

Each token resolves to its Tailwind default: flex to display: flex, items-center to align-items: center, justify-between to justify-content: space-between, p-4 to 1rem on the 0.25rem spacing scale, and rounded-lg to the 0.5rem corner radius. The declarations are then emitted grouped - layout and alignment first, then spacing, then shape.

How the result is produced

1

Class recognition

The input string is split into tokens on whitespace. Each token is matched against the utility grammar: a base such as p-, m-, w-, bg-, text-, rounded-, flex, or grid, optionally followed by a scale step like 4, 500, or lg. Recognized patterns resolve to one or more declarations, with step values from built-in tables: spacing is 0.25rem times the step, and named steps pick from the size table. Tokens it does not recognize produce no declarations.

2

Grouping and formatting

Declarations from every recognized token are collected, then emitted in a fixed family order rather than input order - layout and display first, then spacing, typography, colors, and effects - so the output reads like a hand-written rule. Formatting is uniform: one declaration per line, lowercase property names, a semicolon after every declaration, so the block can be copied straight into a stylesheet.

Good uses

  • Porting a component out of a Tailwind template or project into a plain-CSS codebase: paste the element's class string and drop the returned declarations into your stylesheet.
  • Checking what a class actually computes to - p-4, rounded-lg, text-2xl - without opening the docs or running a Tailwind build.
  • Hand-writing a small static page and using the converter as the lookup step for the few utilities you want, instead of pulling in the full framework.

Limits and checks

  • The step number is not pixels: the spacing scale is 0.25rem times the step, so p-4 is 1rem (16px) and p-2 is 0.5rem (8px). Read the returned values, not the class numbers.
  • The result is a declaration list with no selector attached, and it cannot represent the trigger behind hover:, md:, or dark: prefixes - you must add the :hover rule or media query yourself for those to work.
  • Values come from one version's default tables. Tailwind v4 defines its palette in OKLCH rather than v3's hex, and some scales were renamed (v3's shadow-sm became shadow-xs). Classes written for the other version can resolve to values you did not intend - spot-check the output against your version's docs.

Common questions

Can it convert responsive and state variants like md: or hover:?

A variant names a trigger - a breakpoint or a state - and a flat list of declarations cannot carry it. Whatever the converter does with the prefix, the usable result is the underlying declaration, and you re-attach the trigger yourself: a :hover rule for hover:, a media query for md:. That reconstruction is the part no class-to-property conversion can do for you.

Does it understand arbitrary values like w-[17px] or my custom tailwind.config.js?

An arbitrary value carries its literal CSS value inside the brackets, so w-[17px] can resolve directly to width: 17px if the converter supports the syntax. Values you defined in your own tailwind.config.js - custom colors, fonts, or renamed steps - are invisible to a converter built around default tables, so expand those classes by hand before converting.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools