Layout Grid Calculator

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.

Example breakpoints

ViewportColumnsGutter / marginColumn width
360 px416 / 16 px70 px
768 px824 / 32 px67 px
1,280 px1224 / 64 px74 px
1,440 px1232 / 80 px77.3 px

When to use it

  1. Set up the column grid for a new design system.
  2. Hand developers exact column and span widths.
  3. Check that columns stay on an 8-point grid.
  4. Convert a Figma layout grid into CSS.
  5. Compare grid options for tablet and desktop.

How to Use

  1. Edit or add breakpoints.
  2. Set columns, gutter, margin and max width.
  3. Read column widths and grid fit.
  4. Copy the CSS or batch a breakpoint list.

Features

  1. Column, content and span widths
  2. 8-pt grid check and snapping
  3. Visual grid preview
  4. Responsive CSS output
  5. Breakpoint batch
  6. 100% client-side

FAQs

How do I calculate column width?

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.

What is an 8-point grid?

A system where sizes and spacing are multiples of 8 px, which keeps layouts consistent and scales cleanly on common screen densities.

Should columns be fixed or fluid?

Fluid columns between breakpoints are standard; a max content width keeps lines readable on wide screens.

How many columns should I use?

4 on phones, 8 on tablets and 12 on desktop is the most common pattern.

Is anything uploaded?

No. Everything runs in your browser.

Technical Details

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.

Web & CSS Tools

Web & CSS Tools

  • Design Tokens Converter
  • SVG Sprite Builder
  • Font Subsetter and WOFF2 Converter
  • Viewport Meta Tag Generator
  • Web App Manifest Generator
  • CSS Button Generator
  • CSS Text Shadow Generator
  • Glassmorphism Generator