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.
Build CSS grid layouts by tapping cells. Name areas, set column and row sizes and gaps, and copy CSS, HTML or Tailwind code.
Used CSS Grid Generator? Share how it went to help others.
About this tool
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.

Or start with an empty grid.
Tap two corner cells.
Columns, rows and gaps.
CSS, HTML or Tailwind.
No line numbers to work out.
Named areas like a map.
Areas stack on small screens.
They fit without media queries.
Rows and columns together
Header, sidebar, main and footer.
ExampleChoose Page with sidebar.
Tiles of different sizes.
ExampleChoose Dashboard and rename the areas.
One large and several small pictures.
ExampleChoose Photo wall.
Cards that fit every screen.
ExampleUse the cards mode.
See what each value does.
ExampleChange 1fr to 2fr and watch.
Classes for an uneven layout.
ExampleOpen the Tailwind tab.
Layouts that do not break
Use minmax(0, 1fr) so a column can shrink below its content.
Let the content decide the height where you can.
Keep the HTML in reading order. Screen readers follow it.
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
Featured on
Toolyconvert is listed on these product directories and launch platforms.