CSS Grid Generator
Visually build a CSS grid — drag tracks, gaps and named areas — with a live preview, then copy the exact CSS and HTML.
- 🎨 Design Tool
- ✓ Free
- ✓ No sign-up
- ✓ Private — runs in your browser
- ✓ Any device
1 – 12 tracks
1 – 12 tracks
Only non-default values are written to the CSS. justify-content / align-content only show movement when the tracks don't fill the container (e.g. fixed px sizes).
Tip: paint a top row as header, the middle row as nav / main / aside, and the bottom as footer for the classic “holy grail” layout.
🔒 100% in your browser — nothing is uploaded. Drag to paint areas, watch the grid morph live, then copy paste-ready CSS & HTML. Your layout is auto-saved on this device.
Why you’ll love CSS Grid Generator
How to use it
- 01
Open it
No download and no login — the tool is ready right at the top of this page.
- 02
Use it
Enter your details or start interacting. Everything updates live as you go.
- 03
Get your result
Copy, download or share your result in a single tap. That’s it.
About CSS Grid Generator
This CSS grid generator lets you design a real grid layout visually and copy exact, paste-ready code. Step up to 12 columns and 12 rows, then size each track individually — fr, px, %, auto, min-content, max-content or a full minmax() with separate min and max units. Column and row gaps (0–60px, linkable), plus justify-items, align-items, justify-content and align-content are all controlled by eye against a live preview that morphs as you change values.
The Named areas mode is where it saves the most typing: pick an area name — header, nav, main, aside, footer or your own — and drag across the paint matrix to place it. The tool validates that every area forms a solid rectangle, exactly as the CSS specification requires, and flags stray cells before they become an invalid stylesheet. It then emits a neatly column-aligned grid-template-areas block, one .name { grid-area: name } rule per region, and the matching HTML skeleton.
Four presets (Holy Grail, card gallery, sidebar + main, dashboard) give you a working starting point, and only non-default properties are written to the output, so the CSS stays minimal. Everything runs in your browser — nothing is uploaded — and your layout auto-saves on your device so you can come back to it later.
Popular uses
- ✦ Scaffolding a page shell (header, sidebar, main, footer) without hand-writing grid-template-areas
- ✦ Learning CSS grid by watching how fr, minmax() and gaps interact in real time
- ✦ Prototyping dashboard layouts before committing them to component code
- ✦ Translating a designer's mockup into exact track definitions and clean starter CSS
- ✦ Producing paste-ready CSS + HTML for CodePen demos and quick client prototypes
Frequently asked questions
What is the difference between the Tracks mode and the Named areas mode?
Why does the tool say my area "isn't a solid rectangle"?
When should I use fr instead of % or minmax()?
Why don't justify-content and align-content appear to do anything?
Can I make the generated grid responsive?
Is CSS Grid Generator free to use?
Can I use the output commercially?
More design & visual tools
All design & visual toolsPeople also use
We built this. We can build yours.
CSS Grid Generator is one of our free tools. Need a website, app, AI agent or automation? Fixed price — and you own the code.