Skip to content
Layout → CSSDeveloper tools

CSS Grid Generator

Build CSS grid layouts by tapping cells. Name areas, set column and row sizes and gaps, and copy CSS, HTML or Tailwind code.

Did this tool work for you?

Used CSS Grid Generator? Share how it went to help others.

About this tool

About CSS Grid Generator

CSS Grid Generator lets you draw a layout and gives you the code for it. Start with a ready layout, such as a page with a sidebar, three columns, a dashboard or a photo wall, or with an empty grid. To make an area, tap one empty cell and then the opposite corner; the cells between them become one part of the layout. Tap an area to give it a name or to remove it. Add or remove columns and rows, up to twelve of each, and choose a size for every one: a share of the free space such as 1fr or 2fr, a fixed width, a percentage, auto, or minmax. The gap between rows and between columns can be set on its own. The CSS uses named areas, which is the most readable way to write a grid. You see the layout in the code as a small map, for example header header on the first line and sidebar main on the second, and you can change it later by editing that map. For phones, a rule is added that stacks all areas in one column in reading order on screens under 640 pixels. The HTML with matching class names and a version for Tailwind are in the other tabs. The second mode is for cards. Choose the smallest width a card may have, and the grid puts as many cards in a row as fit and moves the rest to the next row. This works without media queries, and on very narrow screens a card is never wider than the page. Grid and flexbox are good at different things. Use grid when rows and columns belong together, as in page layouts and galleries. Use flexbox for things in one line, such as a menu or a row of buttons. All modern browsers support grid. Nothing you build here leaves your browser.

CSS Grid Generator tool

What grid layouts are for

Rows and columns together

Page layouts

Header, sidebar, main and footer.

ExampleChoose Page with sidebar.

Dashboards

Tiles of different sizes.

ExampleChoose Dashboard and rename the areas.

Photo galleries

One large and several small pictures.

ExampleChoose Photo wall.

Product lists

Cards that fit every screen.

ExampleUse the cards mode.

Learning grid

See what each value does.

ExampleChange 1fr to 2fr and watch.

Tailwind projects

Classes for an uneven layout.

ExampleOpen the Tailwind tab.

CSS grid tips

Layouts that do not break

Long words break columns

Use minmax(0, 1fr) so a column can shrink below its content.

Auto rows

Let the content decide the height where you can.

Keep the order

Keep the HTML in reading order. Screen readers follow it.

Only one line?

Flexbox is simpler.

Open Flexbox Generator

Real data?

Use a table instead.

Open HTML Table Generator

Check the HTML

Find unclosed tags.

Open HTML Validator
Built & tested by

HemantInsights

Senior Software Engineer · Developer of Toolyconvert

Hemant developed CSS Grid Generator and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.

Last updated 25 November 2026

Answers and guidanceFrequently Asked Questions
How do I make a CSS grid?
Set display to grid and describe the columns. Here you draw the layout and copy the finished code.
What does 1fr mean?
One share of the free space. With 1fr 2fr the second column gets twice the share of the first.
What are grid areas?
Names for parts of the grid. You place an element by giving it the name.
How do I make a responsive grid?
Use the cards mode, or keep the rule that stacks the areas on phones.
Grid or flexbox?
Grid for rows and columns together, flexbox for one line of things.
Can areas overlap?
Not with named areas. They are always rectangles without overlap.
Can I use it with Tailwind?
Yes. Copy the code from the Tailwind tab.
More tools for your workflowRelated Tools

Featured on

Toolyconvert is listed on these product directories and launch platforms.