Calculate column widths for your grid layouts
CSS Grid is a two-dimensional layout system that divides a container into rows and columns, letting you precisely control element placement and sizing in web designs.
Column Width
78.00px
Column (%)
6.50%
Total Gutters
264px
| Span | Width (px) | Width (%) |
|---|---|---|
| 1 column | 78.00px | 6.50% |
| 2 columns | 180.00px | 15.00% |
| 3 columns | 282.00px | 23.50% |
| 4 columns | 384.00px | 32.00% |
| 6 columns | 588.00px | 49.00% |
| 12 columns | 1200.00px | 100.00% |
display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; max-width: 1200px;
Auto-fit responsive variant:
display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 24px; max-width: 1200px;
The column width is calculated by subtracting all gutter space from the container width, then dividing by the number of columns.
Total Gutter Space = Gutter × (Columns - 1)
Column Width = (Container - Total Gutters) / Columns
Example: (1200 - 264) / 12 = 78px per column| System | Columns | Gutter |
|---|---|---|
| Bootstrap | 12 | 30px |
| Material | 12 | 24px |
| Tailwind | 12 | 32px |
Formula
Total Gutters = Gutter × (Columns − 1) | Column Width = (Container − Total Gutters) / ColumnsGutter = Gap between each column in pixels
Columns = Total number of columns in the grid
Container = Total pixel width of the grid container
Worked Example
12-column grid, 1200px container, 24px gutter
Did you know? The 12-column grid became standard because 12 is divisible by 2, 3, 4, and 6 — making it easy to create halves, thirds, quarters, and sixths without fractions. Bootstrap popularized this convention in 2011.
Sources
Convert text to ASCII codes and back. Supports decimal, hex, binary, and octal formats.
Convert width/height to aspect ratios, scale dimensions, and generate responsive embed CSS for any layout.
Calculate required internet bandwidth based on devices and activities in your household.
Encode and decode Base64 strings. Convert text for data URIs, APIs, and safe data transmission.
Create CSS border-radius with visual controls for each corner. Generate circles, pills, and custom shapes.
Create CSS box shadows with multiple layers, live preview, and copy-ready code.