CSS Flexbox Generator
Design ToolsVisual flexbox playground with copyable CSS
FreePrivateInstant
flex-direction
flex-wrap
justify-content
align-items
align-content (when wrapping)
gap
12px
Items
5
1
2
3
4
5
CSS
.container{min-height:170px;background:#ede9fe;border-radius:12px;padding:10px}.item{min-width:56px;min-height:48px;padding:10px;background:#7c3aed;color:#fff;font:700 15px sans-serif;border-radius:8px;display:flex;align-items:center;justify-content:center}.item:nth-child(3n){min-height:80px;background:#a855f7}.item:nth-child(4n){background:#6d28d9}
.container {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: stretch;
gap: 12px;
}HTML
<div class="container"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> </div>
The .item styles in the preview are only for display — copy .container for your layout. Preview styles are included at the top of the CSS box.
Similar tools you may like
History
All history →CSS Flexbox Generator — at a glance
Visual flexbox playground with copyable CSS.
direction: row
justify: space-between
Generate
.container { display:flex … }
How to use it — step by step
Just your input — nothing to install or sign up for.
1
Pick the options
Choose direction, wrapping, alignment, gap and item count.
2
Watch the preview
The boxes move as you change each option.
3
Copy the code
Press Copy CSS (and Copy HTML) and paste into your project.
Pro tips
Small things that make the result better.
✦justify-content works along the main axis, align-items across it.
✦Use gap instead of margins between items.
Quick facts
Freeno signup, no limit
Instantresult in a moment
Privatenothing is uploaded
Any devicephone, tablet or PC
Frequently Asked Questions
Is my data safe?+
Yes. Everything runs inside your own browser. Your text, files and images are never uploaded to any server.
Is this tool really free?+
Yes — completely free, no signup, no watermark and no usage limit.
More Free Tools
Guides you might like
All guides →Color ConverterHEX, RGB and HSL: three ways to write the same colour, and which to usePX to REM Converterpx vs rem: why your font sizes should be allowed to scaleAspect Ratio Calculator16:9, 4:3, 1:1: aspect ratios without cropping surprisesColor Contrast CheckerIs your text readable? The contrast ratio, explained

