Flexbox & Grid

flex to Tailwind

The shorthand has a handful of named forms (flex-1, flex-auto, flex-initial, flex-none); anything else becomes arbitrary.

The 30 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 flex.

flex values and their classes

CSSTailwind
flex: 0 auto;flex-initial
flex: 1;flex-1
flex: 2;flex-2
flex: 3;flex-3
flex: 4;flex-4
flex: 5;flex-5
flex: 6;flex-6
flex: 7;flex-7
flex: 8;flex-8
flex: 8.333333%;flex-1/12
flex: 9;flex-9
flex: 10;flex-10
flex: 11;flex-11
flex: 12;flex-12
flex: 16.666667%;flex-1/6
flex: 20%;flex-1/5
flex: 25%;flex-1/4
flex: 33.333333%;flex-1/3
flex: 40%;flex-2/5
flex: 41.666667%;flex-5/12
flex: 50%;flex-1/2
flex: 58.333333%;flex-7/12
flex: 60%;flex-3/5
flex: 66.666667%;flex-2/3
flex: 75%;flex-3/4
flex: 80%;flex-4/5
flex: 83.333333%;flex-5/6
flex: 91.666667%;flex-11/12
flex: auto;flex-auto
flex: none;flex-none

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.

flex-[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