CSS Grid Generator

Define columns and rows, choose track sizes like 1fr or minmax(), set gaps and instantly see the grid your CSS will produce.

Last updated: · Runs 100% in your browser

// controls
Presets
3
3
12px
12px
Live preview
Generated CSS
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  column-gap: 12px;
  row-gap: 12px;
}

// Example output

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  column-gap: 12px;
  row-gap: 12px;
}

// Features

  • ▸1–12 columns and rows
  • ▸fr, auto, px and minmax tracks
  • ▸Separate row and column gaps
  • ▸Numbered preview cells
  • ▸Clean grid-template output

// How to use

  1. 01Adjust the controls on the left or pick a preset to start the CSS Grid Generator.
  2. 02Watch the live preview update instantly as you change each setting.
  3. 03Fine-tune the generated CSS by hand in the code panel if you like.
  4. 04Click Copy CSS or Download CSS, or Share to send a link to your design.

// FAQ

Your data never leaves your browser. This tool runs 100% locally — no upload, no logging, no analytics on your inputs.

// Related tools