Skip to content
Omnikalc

Grid columns calculator: how wide is each column?

Enter the container width, the number of columns, the gutter and the margin to get the width of one column and of spans of 2, 3, 4 and 6 columns for a web layout.

Updated on
Your inputs
px

Value out of range

Value out of range

px

Value out of range

px

Value out of range

Results

Width of one column

78.00 px

Workable columns
Width of a 2-column span
180.00 px
Width of a 3-column span
282.00 px
Width of a 4-column span
384.00 px
Width of a 6-column span
588.00 px
Total width of the gutters
264 px

Before a layout is built, designers need to know how wide a column is. The grid columns calculator takes the container width, the number of columns, the gutter and the outer margin to give the width of one column, the width of spans of 2, 3, 4 and 6 columns and the total width of the gutters.

How the calculation works

  • Width of a column = (container width − 2 × outer margin − (columns − 1) × gutter) ÷ columns. The gutters sit between the columns, so there is one fewer gutter than columns.
  • Width of a span of k columns = k × column width + (k − 1) × gutter. A span includes the gutters inside it.
  • Total gutter width = (columns − 1) × gutter.
  • A 12-column grid is the most common because 12 divides by 2, 3, 4 and 6, so a row can hold two, three, four or six equal blocks.

Example

A container of 1,200 px with 12 columns, a 24 px gutter and no outer margin has gutters of 11 × 24 = 264 px in total. The columns share the rest, so each one is (1,200 − 264) ÷ 12 = 78 px. A 3-column span is 3 × 78 + 2 × 24 = 282 px, a 4-column span is 384 px and a 6-column span is 588 px.

Why it matters

Knowing the exact widths helps you to size images, cards and ad slots so they fit the grid, and to check a design file against a coded page. It also shows quickly when the gutters leave too little room for the columns.

Good to know

The result is for a fixed container. A fluid grid changes with the viewport, so calculate the key widths, for example the widest and the narrowest. Remember that the outer margin is counted on both sides. Columns narrower than about 40 px are hard to use on their own, though they can still make a good building block when you group them in spans.

The golden ratio calculator gives pleasing proportions for a layout and the aspect ratio calculator keeps the shape of images that fill the columns.

Frequently asked questions

How do I calculate the width of a grid column?

Subtract the outer margins and all the gutters from the container width, then divide by the number of columns. The gutters are the gaps between columns, so there are one fewer gutters than columns. For 1,200 px, 12 columns and 24 px gutters, the column is 78 px.

Why is a 12-column grid so common?

Twelve divides evenly by 2, 3, 4 and 6, so you can split a row into halves, thirds, quarters or sixths with whole columns. Frameworks such as Bootstrap and many design systems use 12 columns. Other layouts use 4 columns for phones, 8 for tablets or 16 for dense pages.

Should I use fixed pixels or percentages?

Modern CSS grid lets you write columns as fractions, such as repeat(12, 1fr) with a gap, and the browser does the sums. The pixel values here are useful for a design file, for checking images and for deciding on sizes, at the container width you expect.

What gutter size is best?

Gutters of 16 to 32 px are common, often chosen from the spacing scale of the design, for example 24 px. Smaller gutters suit dense interfaces and larger ones give an airy look. On phones gutters are usually smaller, at 12 to 16 px.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.