Grid Calculator: Column Width, Gutters and Span Formulas

Open Tool Grid Width Calculator

One formula settles column width

Available width is container width minus both margins minus all gaps, divided evenly among columns: column width equals container minus twice the margin minus gaps times columns minus one, all over the column count. The four inputs map to exactly these quantities. Output is a width table per span, so two- and three-column spans are lookup values.

Steps

  1. Enter container 1200, columns 12, gutter 24 and margins 40.
  2. Calculate for single-column and span widths.
  3. A span equals that many column widths plus the gaps between them.
  4. Copy results into design specs, or load the standard twelve-column example.
  5. Clear to recalculate with new values.

Why spans are not simple multiples

Two columns means two widths plus one gap; three means three widths plus two gaps. Larger spans accumulate more gaps, so treating a span as a multiple undershoots and breaks alignment. At twelve columns, 1200 wide, 24 gutters and 40 margins, a column runs about 56, a two-span about 136, a four-span about 296. Verify against the actual spec.

Recalculating responsively

Twelve columns on desktop often become eight or six on tablets and four or two on phones. Changing the count invalidates every width, so recompute at breakpoints or switch to percentages and fr units and let the browser divide. Gutters shrink too, commonly 24 to 16 on small screens, or content gets pinched. Margins likewise drop to 16 or zero.

Common problems

Scrollbar width steals a dozen pixels and overflows the last column. Fractional widths accumulate rounding error, so the final column absorbs it. Gutters and margins get conflated — one sits between columns, the other at container edges. Column counts that do not divide the width evenly force redesign. And design tools may measure content box versus border box, shifting results.

Fit and misfit:It serves web and app layout planning, design specs, pre-slice dimension checks and poster columns. It does not serve free layouts that deliberately break the grid, optical rather than mathematical alignment, or masonry driven by image heights. A grid is a constraint, not a goal — break it only after mastering it. Always test with real content, since text lengths and image ratios challenge the numbers.

⏫︎