Add to Chrome
Code for AI

How to get Tailwind classes from a website

There are two different problems hiding in this question: the site already uses Tailwind and you want its classes, or it does not and you want its design written as Tailwind. Here are three ways to get there.

The short answer

If the site is built with Tailwind, the classes are in the markup: select the element in DevTools and read its class attribute. If it is not, you need the element’s computed CSS translated into utilities. With Design Toolkit, select the element and use the code export in the side panel to copy it as Tailwind classes, or copy a whole section as Tailwind.

1. Find out whether the site uses Tailwind

Select an element in the Elements panel and look at its class attribute. Tailwind sites have a recognizable look:

If you see readable component names instead, such as .card or .hero-title, the site writes its own CSS or uses a different framework, and you are in the next section.

2. If it does, read the classes

Then the class attribute is the answer, including the prefixes. Copy it from the Elements panel with Copy → Copy element or select the class value directly. Two things to keep in mind:

3. If it does not, translate the CSS

Read the element's values in the Computed tab and map them onto Tailwind's scales. These are the defaults:

CSSTailwind
padding: 16pxp-4 (the scale is 4px per step: p-5 is 20px, p-6 is 24px, p-8 is 32px)
gap: 16pxgap-4
border-radius: 12pxrounded-xl (8px is rounded-lg, 16px is rounded-2xl, 24px is rounded-3xl)
font-size: 18pxtext-lg (14px is text-sm, 16px text-base, 20px text-xl, 24px text-2xl, 48px text-5xl)
font-weight: 600font-semibold (500 is font-medium, 700 is font-bold)
display: flex; align-items: centerflex items-center

When a value is not on the scale, write it as an arbitrary value in square brackets instead of rounding it: w-[232px], rounded-[20px], text-[#111111]. Rounding to the nearest step is how a copy drifts.

Add the states and the widths as prefixes: the hover rule becomes hover:, a rule inside @media (min-width: 768px) becomes md:, and anything at a width Tailwind has no name for becomes min-[900px]:.

4. Or export it

Doing that for one element is fine. Doing it for a hero with thirty elements is the afternoon you wanted to avoid. Design Toolkit reads the computed styles and writes them out for you:

The side panel Export code card for a section: a live preview, buttons for Tailwind, HTML, React, Vue and Elementor, and a Copy button.
Choose Tailwind, check the preview, then Copy Tailwind.

Check it before you trust it

Make the copy fit your own project

A copy taken from a live page carries that page's exact values, so a lot of them arrive as bracketed values. That is right for matching the design, and wrong for living in your codebase for a year. The clean-up is boring and quick:

What you copiedWhat to keepWhy
text-[#141218]text-ink (your own token)Brand colors change in one place
p-[24px]p-624px is already on the scale
rounded-[999px]rounded-fullSame result, easier to read
font-[Inter]font-sansSet the family once, in the theme

If the site used breakpoints that are not Tailwind's (640, 768, 1024, 1280 and 1536px), you will see variants like min-[900px]:. Leave them while you check the copy at phone, tablet and desktop width, then decide whether to move your own breakpoints or round theirs.

This is a good job to hand to an AI coding tool. Paste the copied markup together with your theme (the @theme block in v4, or tailwind.config.js in v3) and ask it to swap bracketed values for tokens you already have, and to leave the rest alone.

Use what you copy well

A site's design belongs to its makers. Use what you read as a reference, to learn how it was built or to rebuild your own page, and not to publish someone else's work as yours.

Turn any element into Tailwind

Select an element or a whole section and copy it as Tailwind classes. Free for 7 days.

Add to Chrome

No accountRuns locally14-day refund

Common questions

How can I tell whether a website uses Tailwind?

Look at an element’s class attribute. Long lists of short utilities such as flex items-center gap-4 px-6, responsive prefixes such as md: and bracketed values such as w-[232px] point to Tailwind. Readable component names such as .card point to hand-written CSS.

Why do some values come out as w-[232px]?

Tailwind has no class for every value. An exact value that is not on the scale is written as an arbitrary value in square brackets, which keeps the copy accurate instead of rounding it to the nearest step.

Can I get Tailwind classes for a whole section at once?

Yes. Select the section, open the Export card in the side panel and choose Tailwind. The preview shows it at phone, tablet and desktop widths before you copy it.

Does this work for Tailwind v3 and v4?

The utility classes themselves are the same in both. What differs is where custom values are declared: v4 reads its theme from CSS variables and v3 from a config file, so declare any custom color or font in the place your version expects.

Read next

From the blog