Flexbox & Grid

gap to Tailwind

Gap uses the spacing scale, so gap: 12px becomes gap-3 on the default 0.25rem base.

The 35 mappings below are read straight out of Tailwind v4.3.3, not maintained by hand, so this is what the converter will actually produce for gap.

gap values and their classes

CSSTailwind
gap: 0;gap-0
gap: 0.125rem;gap-0.5
gap: 0.25rem;gap-1
gap: 0.375rem;gap-1.5
gap: 0.5rem;gap-2
gap: 0.625rem;gap-2.5
gap: 0.75rem;gap-3
gap: 0.875rem;gap-3.5
gap: 1px;gap-px
gap: 1rem;gap-4
gap: 1.25rem;gap-5
gap: 1.5rem;gap-6
gap: 1.75rem;gap-7
gap: 2rem;gap-8
gap: 2.25rem;gap-9
gap: 2.5rem;gap-10
gap: 2.75rem;gap-11
gap: 3rem;gap-12
gap: 3.5rem;gap-14
gap: 4rem;gap-16
gap: 5rem;gap-20
gap: 6rem;gap-24
gap: 7rem;gap-28
gap: 8rem;gap-32
gap: 9rem;gap-36
gap: 10rem;gap-40
gap: 11rem;gap-44
gap: 12rem;gap-48
gap: 13rem;gap-52
gap: 14rem;gap-56
gap: 15rem;gap-60
gap: 16rem;gap-64
gap: 18rem;gap-72
gap: 20rem;gap-80
gap: 24rem;gap-96

The spacing scale

gap is written with gap-*, which counts in steps of 0.25rem. The step number is the multiplier, so the class number is the value divided by that step rather than a pixel count.

Values that are not on the scale

Anything without a named class is written as an arbitrary value in square brackets. The converter falls back to this rather than rounding your CSS to the nearest class, because silently changing a value is worse than an ugly class name.

gap-[your value]

Other flexbox & grid properties

Converting a whole stylesheet?

Paste it into the converter and get every rule at once, shorthands expanded, media queries turned into breakpoint variants, and the parts that have no Tailwind equivalent flagged rather than dropped.

Open the converter