Design and media

Grid column widths calculator

Container width includes outer margins. Negative available width is rejected.

Your numbers

Use the units shown. Results update as you change valid inputs.

YOUR RESULT

Container width includes outer margins. Negative available width is rejected.

THE NUMBERS, EXPLAINED

How to use this calculator.

Container width includes outer margins. Negative available width is rejected.

Start with your inputs

Enter container width (px), margin each side (px), columns, gutter (px). Keep amounts in the units shown on each field. The example is a starting point, not a recommended value.

InputExample value
Container width (px)1200
Margin each side (px)20
Columns12
Gutter (px)20

A worked example

With the example inputs above, column width (px) is 78.333333. Change the inputs to explore your own scenario.

Putting the example numbers into the formula

Column width (px)
((1200)-2 × (20)-((12)-1) × (20)) ÷ (12) = 78.333333

All results for the example inputs above
ResultExample answer
Column width (px)78.333333

How this is calculated

Column width (px)

(a-2 × b-(c-1) × d) ÷ c

Symbols and units
a
Container width (px)
b
Margin each side (px)
c
Columns
d
Gutter (px)

Use the units shown. A list keeps the order in which you enter its values. The symbol ^ means “raised to the power of”.

Assumptions and limits

Container width includes outer margins. Negative available width is rejected.

Calculations use the values you enter. Blank or invalid inputs show an error instead of silently substituting zero. Results are displayed to useful precision; calculations retain the underlying numeric precision.

Questions about this tool

What does the result tell me?

Column width (px). The result applies to the method and inputs described above. Check the units and assumptions before using it in a decision.

Why might another calculator differ?

Differences in units, rounding, timing or model definitions can produce different answers. Compare the input definitions and the method, rather than only the final number. For this tool: Container width includes outer margins. Negative available width is rejected.

Are my inputs stored or sent to AI?

Calculations on this page happen in your browser. The separate AI question finder sends its submitted conversation to OpenAI; these calculator fields are not sent. Favourites and recent tool names are stored locally. A shared link contains the inputs you choose to include.

Review status

Software example and browser checks are recorded in our quality report. No external expert review is claimed. Created with coding assistance; calculations run as ordinary browser code.

Read the quality report →