Search Tools

Calculate one column's width and the grid-area width of a spanning element in an equal-column layout.

What to calculate

Reference width including side padding, excluding borders and scrollbars.

Number of columns spanned by the element. Enter a whole number from 1 to the column count.

Results

Results update automatically when the required values are entered.

Method, applicability and sources

Calculation method

Available width = container width − left padding − right padding. Total gaps = (column count − 1) × gap. Flexible column width = (available width − total gaps) ÷ column count. Fixed mode uses the entered column width; unallocated width = available width − total gaps − column count × fixed width. Span width = span × column width + (span − 1) × gap. Negative remaining width is rejected.

Worked example (hypothetical values)

With container width 1200 px, left and right padding 24 px each, 12 columns, and gap 24 px, each flexible column is 74 px wide and a 3-column span is 270 px wide.

Applicability and limitations

Explicit equal-width columns in one row direction, with definite widths and gutters in CSS px. Subtract borders and scrollbars before entering values. Excludes content-dependent auto/min-content/max-content sizing, unequal fr ratios, auto-fill/auto-fit, subgrid, implicit columns, extra spacing from justify-content, column start positions and auto-placement, and actual element box-sizing/min-width effects.

Methods used

  • Equal flexible columns (minmax(0, 1fr)) (CSS Grid Layout Level 2 CRD 2025-03-26): scope Tracks with a definite container width, equal flex factors, and a minimum width of 0; region Global
  • Equal fixed columns (px) (CSS Grid Layout Level 2 CRD 2025-03-26): scope Identical fixed pixel widths; surplus stays unallocated; overflowing configurations cannot be calculated; region Global

Method and sources

Method: Equal-column arithmetic v1.0 / CSS Grid Layout Level 2 CRD 2025-03-26. Data recorded: 2026-11-14.