RootUtils

Tailwind Sorter

Client-Side Secure

Free online Tailwind Class Sorter. Automatically sort and deduplicate your Tailwind CSS classes. Keep your code clean and organized.

Tailwind Tidier

Official Sort Order & De-duplication.

Multi-line Grouping

Is this tool broken?

Let us know if you found a bug or have a feature request.

Tailwind CSS Class Sorter & Cleaner

Automatically sort your Tailwind utility classes, remove duplicates, and organize them into logical groups. This tool follows the Official Prettier Plugin order (Layout → Spacing → Sizing → Typography → Decoration) to make your code readable and maintainable.

Stop wasting time manually ordering `flex items-center justify-between p-4`. Just paste your messy class string, and get a standardized, clean result instantly.

Standard Sorting

Classes are sorted by category impact: Layout affects document flow, so it comes first. Decoration (shadows, colors) comes last. This makes scanning code much faster.

Conflict Detection

If you accidentally use `block` and `flex` together, or `p-4` and `p-8` on the same element, our tool will flag these conflicts so you can fix the layout logic.

Deduplication

Merging branches often leads to duplicate classes like `class="p-4 bg-white p-4"`. We instantly strip duplicates to keep your HTML payload small.

The Official Sort Order

  • 1
    Layout (The "Box")container, display (flex/grid), position, z-index
  • 2
    Positioning & Spacingtop/right/bottom/left, margin, padding, space-between
  • 3
    Sizingwidth, height, min/max-width
  • 4
    Typographyfont-size, weight, alignment, whitespace
  • 5
    Visuals (Decoration)backgrounds, borders, shadows, opacity
  • 6
    Interactivitytransitions, transforms, cursor, pointer-events