Why clean up a Tailwind class list?
After a few iterations your `className` looks like this: `"flex p-4 hover:bg-blue-500 px-4 text-sm hover:bg-blue-600 md:p-6 md:p-8 font-medium bg-white"`. Three problems hide in there: `p-4` is partially overridden by `px-4` (redundant), two `hover:bg-blue-...` (hover conflict), `md:p-6` overridden by `md:p-8` (breakpoint conflict). And it is all jumbled up.
The tool detects conflicts ("p-4 overridden by p-2", "md:p-4 vs md:p-8") and redundancies (`p-4` + `px-4` is wasteful). Then it sorts the survivors in the conventional order: layout → positioning → sizing → spacing → typography → background → border → effects → states.
The result is readable and bug-free. You see what got removed, how many groups got sorted, and a stats summary.
How to use
- Paste a long className string (from a React/Vue/HTML component) into the left panel.
- On the right you get the cleaned version plus a list of detected issues.
- Each issue has a description ("p-4 overridden by p-2") - easy to understand why the class disappeared.
- Toggle "Sort only" for safe mode - the tool drops nothing, just reorders (useful if you do not trust the conflict detection).
- Hit "Copy" and paste the result back into your JSX.
When this helps
Common situations:
- Long-running components. A product card after 10 design iterations has 30 classes - most of them useless. After cleanup you keep 12.
- Cleaning up designer-generated classes. A Figma-to-Tailwind plugin spits out bloated strings - run them through.
- Code review. The comment "classes are messy" - run the file through the tool, get consistent styling. Pairs nicely with prettier-plugin-tailwindcss, but here you also get conflict detection.
- Migrating to a new Tailwind version. v4 changes how some classes behave - it is easy to see what survives.
- Team onboarding. A junior writes `p-4 px-4 py-4` thinking it is "extra safe" - the tool explains that `p-4` already means `px-4 py-4`.
- Cleaning up AI-generated code. AI loves to spit out bloated className strings. Filter them.
- Side-by-side with the palette generator - for color choices see the Tailwind palette generator.
For specificity calculations see the specificity calculator. For CSS gradients see the gradient generator.