🚀 Pockit is now on Chrome!

Stop searching on Google. Access tools instantly with 1-click.

Add to Chrome - It's Free

Privacy Guaranteed

All processing happens locally in your browser. Your data never leaves this device.

CSS Grid Generator

Build CSS Grid layouts visually—no syntax to memorize. Set columns, rows, gaps, alignment, and sizing (1fr, auto, minmax). Preview your grid live and copy clean CSS.

Grid Container

3
2
10px
10px
Grid Items: 6

Generated CSS

.container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  column-gap: 10px;
  row-gap: 10px;
  justify-items: stretch;
  align-items: stretch;
  justify-content: start;
  align-content: start;
}

Live Preview

1
2
3
4
5
6

Pro Tip: Use '1fr' for equal-width columns. For responsive layouts without media queries, try 'minmax(250px, 1fr)' with auto-fit or auto-fill.

CSS Grid Layout Generator & Template Builder

Create CSS Grid layouts without writing code from scratch. This visual grid generator lets you configure columns, rows, gaps, and all alignment properties. Experiment with 1fr, auto, and minmax() sizing. See your layout update in real-time and export clean CSS with grid-template-columns, grid-template-rows, and gap properties—ready for production.

1When to use this tool?

💡Build responsive page layouts for websites
💡Create card grid galleries for portfolios or products
💡Design dashboard and admin panel layouts
💡Prototype grid structures before writing code
💡Learn CSS Grid interactively—see how properties affect layout

2Features

  • Visual grid layout builder—no CSS syntax needed
  • Real-time preview with numbered grid items
  • Full control: columns, rows, gaps, all alignment properties
  • Sizing options: 1fr (fractional), auto, minmax() for responsive grids
  • Clean CSS output with grid-template shorthand
  • Works offline—100% client-side, no data uploaded

3How to Use

  • Choose the number of columns and rows for your grid layout.
  • Set column/row sizing using 1fr (equal), auto, or minmax() for responsive behavior.
  • Configure gaps and alignment (justify-items, align-items, justify-content, align-content).
  • Watch the live preview and copy the generated CSS code.

FAQ

Q. What's the difference between CSS Grid and Flexbox?

A. Grid is 2-dimensional (controls rows AND columns), perfect for page-level layouts. Flexbox is 1-dimensional (row OR column), ideal for component layouts. Use Grid for structure, Flexbox for alignment within components.

Q. What does '1fr' mean in CSS Grid?

A. '1fr' means one fraction of available space. For example, '1fr 2fr' makes the second column twice as wide as the first. It's the key to flexible, equal-width columns.

Q. How do I make a responsive grid without media queries?

A. Use 'repeat(auto-fit, minmax(250px, 1fr))' or auto-fill. This creates columns that are at least 250px wide and automatically wrap to new rows on smaller screens.

Q. What's the difference between auto-fit and auto-fill?

A. auto-fill creates as many tracks as possible, even empty ones. auto-fit collapses empty tracks so items stretch to fill the container. Usually auto-fit is what you want.