Tailwind Class Sorter
Sort Tailwind classes and detect conflicting utilities with a winner explanation.
OpenTurn one spacing value into consistent stack, row and padding classes.
Type the gap in pixels you want to standardise on.
Get .stack, .row and .pad using that same value.
Add a suffix such as -sm or -lg when you create several sets.
Copy the classes or download spacing.css.
Every form in the admin panel uses slightly different spacing between fields: 12 px here, 15 px there, margin-bottom somewhere else. You want one value applied everywhere through a couple of tiny classes. Type the value and copy them.
Enter a gap in pixels (the default is 16). The tool produces three one-line classes. .stack is a flex column with that gap, for vertical lists of fields, cards or paragraphs. .row is a flex row with the same gap, for button groups and inline controls. .pad applies the value as padding on all sides. All three update together, so your vertical rhythm, horizontal spacing and inner padding stay in step.
Using gap instead of margins on the children has a practical advantage: there is no stray margin after the last item, and you do not need :last-child overrides. If the row needs to wrap on small screens, add flex-wrap: wrap to the copied .row rule, since it is not included. Many teams generate two or three of these sets (for example 8, 16 and 32) and suffix the class names. To express the value in rem instead, run it through the px and rem converter. For alignment and direction options beyond a plain stack, use the visual flexbox generator.
The classes are rebuilt instantly as you change the number.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
No. The output covers gap for stacks and rows and padding for containers. Gap usually replaces margins between siblings, which is why margin classes are not included.
Yes. They are independent flex containers, so a vertical stack can sit inside a horizontal row and each keeps its own gap.
The input is in pixels because that is how most design files are measured. Convert the number to rem if you want spacing to scale with the user's font size.