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
- 01Adjust the controls on the left or pick a preset to start the CSS Grid Generator.
- 02Watch the live preview update instantly as you change each setting.
- 03Fine-tune the generated CSS by hand in the code panel if you like.
- 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
Flexbox Playground
Learn and build flexbox layouts interactively — direction, wrap, justify, align and gap with live items.
CSS Card Generator
Generate content cards with background, border, radius, padding, shadow and hover-lift effects.
Border Radius Generator
Round each corner independently or together and copy the exact CSS border-radius shorthand.