Free ToolsGuidesCase StudiesResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/frontend-tools/tailwind-v3-to-v4-migration

Tailwind v3 to v4 Migration Tool

ToolRuns in your browserNothing is uploadedFree · no sign-up

Paste markup or a list of classes written for Tailwind CSS v3 and get the v4 equivalents: the renamed size scales for shadow, blur and rounded, outline-hidden, ring-3, opacity utilities merged into colour modifiers, and the new @import "tailwindcss" entry point. Every change is listed so you can review it.

Using the Tailwind v3 to v4 Migration Tool

What changed in Tailwind v4

Tailwind CSS v4 renamed several utilities so the size scales line up: the old bare shadow, blur, rounded and drop-shadow became the -sm step, and the old -sm step became -xs. outline-none is now outline-hidden, and the bare ring utility is now 1px, so a v3 ring becomes ring-3 to keep its width.

Opacity utilities are gone

v4 removes bg-opacity-*, text-opacity-*, border-opacity-* and the other opacity utilities. Use the slash modifier instead, so bg-white bg-opacity-75 becomes bg-white/75. The tool merges the pair when both classes sit on the same element and flags any opacity class it cannot merge.

Other renames handled

flex-shrink-* and flex-grow-* become shrink-* and grow-*, overflow-ellipsis becomes text-ellipsis, decoration-slice and decoration-clone gain a box- prefix, the important modifier moves to the end (font-bold!), and CSS variables in arbitrary values use parentheses: bg-(--brand). The three @tailwind directives become one @import "tailwindcss";.

What it does not do

Some v4 changes are about defaults, not class names: borders now default to currentColor instead of gray, ring colour defaults to the current colour, and configuration moves from tailwind.config.js into CSS with @theme. Those need a human decision, so the tool lists them as notes rather than guessing. Tailwind's official upgrade tool can also migrate a whole project.

How do I upgrade a project from Tailwind v3 to v4?

The Tailwind team provides an official upgrade tool that updates dependencies, configuration and templates in a whole project. This page is for the cases around it: checking a component you copied from somewhere, converting a snippet in a CMS or email template, or reviewing what will change before you run the full upgrade.

Worked example: a card

Classes such as shadow-sm rounded-sm bg-black bg-opacity-50 become shadow-xs rounded-xs bg-black/50, because v4 shifted the small sizes down one step and replaced the opacity utilities with colour modifiers. The change list shows each rename so you can check the card still looks the same.

Frequently asked questions

Does it change my files?

No. It works on the text you paste, in your browser, and you copy the result back.

Is the output guaranteed to match v3 visually?

Class renames keep the same look. Default changes such as border colour may still differ, which is why the notes list them.

Can I convert my tailwind.config.js?

Not here. Use the Tailwind config theme builder to create a v4 @theme block from your colours, fonts and radius.

Do I still need tailwind.config.js in v4?

Not necessarily. Version 4 moves most configuration into your CSS with the @theme directive, although a JavaScript config can still be loaded. This tool converts class names, not configuration files.

Will v3 class names stop working?

Some renamed utilities produce different results or nothing at all in v4, which is why reviewing the change list matters. Classes that did not change keep working as before.