This layout grid calculator works out the column grid for each breakpoint of a design. Enter the viewport width, number of columns, gutter and margin (and a maximum content width for large screens), and it gives the content and column widths, whether columns land on your 8-point grid, snapped values that do, and the width of common spans. It previews the grid and writes responsive CSS grid code. Paste a list of breakpoints to calculate them all. It runs in your browser.
| Viewport | Columns | Gutter / margin | Column width |
|---|---|---|---|
| 360 px | 4 | 16 / 16 px | 70 px |
| 768 px | 8 | 24 / 32 px | 67 px |
| 1,280 px | 12 | 24 / 64 px | 74 px |
| 1,440 px | 12 | 32 / 80 px | 77.3 px |
Subtract both margins and all gutters from the viewport, then divide by the number of columns. 1,440 px with 12 columns, 24 px gutters and 72 px margins gives 86 px columns.
A system where sizes and spacing are multiples of 8 px, which keeps layouts consistent and scales cleanly on common screen densities.
Fluid columns between breakpoints are standard; a max content width keeps lines readable on wide screens.
4 on phones, 8 on tablets and 12 on desktop is the most common pattern.
No. Everything runs in your browser.
For each breakpoint, content width = viewport − 2 × margin (capped at a maximum content width if set) and column width = (content − (columns − 1) × gutter) ÷ columns. A span of n columns = n × column + (n − 1) × gutter. The column is checked against the base unit (8 px by default); the snapped values round it down to a multiple and move the remainder into the margins. The breakpoints are also written out as mobile-first CSS grid rules.