🧱 CSS Masonry Layout Generator

Visually create a Masonry/Pinterest layout and export the CSS code

Zero Dependencies Β· Works Offline

βš™οΈ Layout Parameters

πŸ“± Responsive Breakpoints

🎨 Preview Content

πŸ‘οΈ Live Preview

πŸ“‹ Generated Code

πŸ“– What Can the CSS Masonry Layout Generator Do?

The CSS Masonry Layout Generator is an online visual tool for quickly creating Masonry/Pinterest-style page layouts. Tune the parameters and preview the layout live, then generate the CSS code. It supports both CSS Columns and CSS Grid masonry implementations, plus responsive breakpoint configuration.

Features

How to Use

  1. Adjust the column count, gap, and other parameters β€” the preview updates live
  2. Configure the column count for each responsive breakpoint
  3. Choose an implementation method (CSS Columns is recommended)
  4. Click "Generate" to view the complete CSS code
  5. Click "Copy" to paste the code into your project

Use Cases

Image Gallery

For images of different sizes, the masonry layout lets each image keep its natural proportions, with smaller images automatically filling the gaps.

Blog Post List

When post summaries have different lengths, the masonry layout avoids large empty white spaces and fits more content per screen.

Card Feeds

For cards with mixed content β€” with or without images, with or without text β€” the masonry layout automatically adjusts the height to fit.

Technical Notes

CSS masonry builds on the CSS Multi-column Layout Module with the column-count and column-gap properties. Items are laid out from top to bottom and left to right, and move to the next column when one is full. The break-inside: avoid rule prevents cards from being split across columns. The masonry value in CSS Grid Level 3 is more natural for reading order, but browser support is currently limited, so CSS Columns is recommended.

πŸ“– FAQ

Is the CSS Masonry Layout Generator free to use?

Yes, it is completely free and requires no signup. Everything runs locally in your browser β€” your settings and generated code never leave your device.

Does it work on mobile devices?

Yes. The tool is fully responsive and works on phones, tablets, and desktops. The generated CSS also includes media queries so your layout adapts to any screen size.

Can I export the generated code?

Yes. Click "Generate" to produce the complete CSS, then "Copy" to copy it to your clipboard. The output includes responsive media queries for all breakpoints.

Which method should I choose, CSS Columns or CSS Grid masonry?

For maximum browser compatibility choose CSS Columns. Choose CSS Grid with the masonry value if your target audience uses Firefox, where it is currently supported as an experimental feature.

Do I need to install any software?

No. It is a pure online tool β€” just open the page in your browser. No downloads, plugins, or installations are needed.