← All tools

Tailwind Class Sorter

Group common classes, deduplicate exact tokens and inspect overlapping properties per variant.

tailwind-class-sorterLOCAL WORKSPACE

Enabling local controls…

Tailwind v4 workbench

Preview uses native CSS, not a Tailwind runtime. Every change updates the result locally. Text and settings stay in page memory.

Limits: 16,000 UTF-8 bytes per text area, 1,000 classes, 24 layout items, 8 cards/shadow layers, 20 × 12 table cells. No input HTML, scripts, URLs or commands execute.

Converters use common documented rules. Arbitrary values and modifier characters are preserved, but unknown tokens are marked unsupported. Real cascade, custom themes and plugins require a Tailwind build.

References checked: · Theme · Responsive design · v4 upgrade guide · Colors

Preview & output

Result updated locally. Review before using in your project.

Supported base utilities only; modifiers are shown in exported CSS.

Review notes

  • Cleanup assumes later list entries cover earlier properties with identical variants and importance. Real Tailwind cascade order comes from generated CSS; sorting is not the official Prettier ordering. Unknown classes are kept.
  • Exact duplicates removed: p-6
  • p-4 ↔ px-2: padding-right, padding-left
  • p-4 ↔ p-6: padding-top, padding-right, padding-bottom, padding-left
  • px-2 ↔ p-6: padding-left, padding-right
Mappings / reference (7)
Current settings: utility mappings and values
ClassCSSStatus
text-whitecolor: #fffmapped
p-4padding: 1remmapped
flexdisplay: flexmapped
px-2padding-left: 0.5rem; padding-right: 0.5remmapped
hover:p-8padding: 2remmapped
bg-blue-600background-color: oklch(54.6% 0.245 262.881)mapped
p-6padding: 1.5remmapped
Classes

Preview: first 32,000 characters. Copy, download and expanded text retain all content. Select complete text if copying fails.

flex px-2 hover:p-8 p-4 p-6 bg-blue-600 text-white
Expand complete selectable text
flex px-2 hover:p-8 p-4 p-6 bg-blue-600 text-white

HTML

Preview: first 32,000 characters. Copy, download and expanded text retain all content. Select complete text if copying fails.

<div><p>Supported base utilities only; modifiers are shown in exported CSS.</p></div>
Expand complete selectable text
<div><p>Supported base utilities only; modifiers are shown in exported CSS.</p></div>

CSS

Preview: first 32,000 characters. Copy, download and expanded text retain all content. Select complete text if copying fails.

.text-white {
  color: #fff;
}

.p-4 {
  padding: 1rem;
}

.flex {
  display: flex;
}

.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.hover\3a p-8:hover {
  padding: 2rem;
}

.bg-blue-600 {
  background-color: oklch(54.6% 0.245 262.881);
}

.p-6 {
  padding: 1.5rem;
}
Expand complete selectable text
.text-white {
  color: #fff;
}

.p-4 {
  padding: 1rem;
}

.flex {
  display: flex;
}

.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.hover\3a p-8:hover {
  padding: 2rem;
}

.bg-blue-600 {
  background-color: oklch(54.6% 0.245 262.881);
}

.p-6 {
  padding: 1.5rem;
}

How to use this tool

Edit the labelled controls to update a native CSS preview and copy or download Tailwind v4 output. Examples and reset stay in page memory.

When not to use it

No Tailwind runtime or full compiler. Converters support a documented common subset and list unknown utilities. Class conflicts and dark colors are suggestions requiring review in your built project. Input 16,000 UTF-8 bytes, 1,000 classes; no scripts or input HTML execute.