Start a project

Tool 272 of 450 · Tailwind

CSS to Tailwind Converter

Convert plain CSS rules into Tailwind utility classes, flagging values that need arbitrary syntax.

CSS to Tailwind Converter

Your input

Result

SelectorClassesNot mapped
Classes

    01

    What it does

    Convert plain CSS rules into Tailwind utility classes, flagging values that need arbitrary syntax.

    • About 90 properties: spacing, sizing, flex, grid, type, colour, borders, effects
    • Shorthands like margin: 0 auto and padding: 8px 16px
    • @media (min-width) to sm: md: lg:, :hover, :focus-visible and dark mode
    • Hex colours matched to the Tailwind palette exactly

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Classes per selector and what couldn't map, with a Copy and a Download button on every result.

    • Tailwind
    • CSS
    • Utilities

    Why it matters

    Moving a component from plain CSS to Tailwind means looking up the class for every declaration and checking whether the value is on the scale.

    This does the lookup, keeps exact matches exact, and shows every place it had to fall back to an arbitrary value so you can decide whether to change the design or keep it.

    How to use it

    1. Type or paste your input; the example shows the format.
    2. Press Convert. Results also update as you type.
    3. Read the summary line, then the table, notes or output below it.
    4. Copy or download what you need. Nothing leaves this page.

    FAQ

    Why do some values become [13px]?

    They're not on Tailwind's scale. Arbitrary values work fine, but lots of them can mean the design isn't following a spacing system.

    What's different between v3 and v4?

    v4 accepts any multiple of 0.25rem for spacing (p-13 works) and renamed some utilities, such as shadow-sm to shadow-xs and outline-none to outline-hidden. Pick the version you use.

    Does it handle complex selectors?

    Simple class, element and pseudo-class selectors map to variants. Descendant selectors and pseudo-elements are listed so you can apply the classes to the right element.

    Is my input uploaded?

    No. The tool runs in your browser and nothing you type, paste or open is sent anywhere.

    Can I rely on the result?

    It follows the public specification or formula named on this page and says where it simplifies. Check anything critical against the official tool or documentation before you ship it.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk