About Flexbox Playground
You get a live Flexbox editor that tries every major container and item setting and shows instant results. You change flex-direction, flex-wrap, justify-content, align-items, align-content and gap. You also set the number of items and per-item grow values. Items can have different heights so you can see cross-axis effects in real layouts. The tool produces copyable container and item CSS you can paste into a project. It runs fully in your browser with nothing to install and processes settings client-side. Developers, designers and students use it to test layouts, explain behavior and debug responsive issues. It is more practical than static references because you edit values and inspect the exact CSS output while watching items resize.
How to use it
- 1Set container options such as flex-direction, flex-wrap, justify-content, align-items, align-content and gap.
- 2Add or remove items and give each item a grow value or different height to see real effects.
- 3Preview the layout live in the browser window while you tweak controls.
- 4Copy the generated container and per-item CSS and paste it into your stylesheet.
Worked example
Input: flex-direction: row; flex-wrap: nowrap; justify-content: space-between; align-items: stretch; gap: 16px; items: 3; grow values: 1, 2, 1. Output CSS: .container { display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: space-between; align-items: stretch; gap: 16px; } .item-1 { flex: 1; } .item-2 { flex: 2; } .item-3 { flex: 1; }
How it works
Tries every flexbox setting live: flex-direction, flex-wrap, justify-content, align-items, align-content, gap, number of items and grow, with items of different heights and the CSS to copyWorks in the browser with nothing to installSource: W3C CSS Flexible Box Layout Module Level 1MDN Web Docs: FlexboxCan I Use: flexbox. Last checked 7 November 2026.
What it is good for
- See live visual feedback when you change any flex container or item value.
- Copy ready-to-use container and per-item CSS for quick prototyping.
- Runs fully in your browser with nothing to install or upload.
- Flexbox is one-dimensional; the playground does not replace a CSS Grid editor.
- Browser differences matter for older versions; test in your target browsers.
Questions people ask
What does the tool edit?
It edits flex container options and per-item values. That includes flex-direction, flex-wrap, justify-content, align-items, align-content, gap, item count and grow.
Can I add or remove items?
Yes. You can change the number of items, often from 1 up to around 12, to observe wrapping and distribution. Check the UI controls to add or remove items.
Does the tool upload my layout data?
No server upload is required to use the tool. It runs in your browser and processes settings client-side. Always review a tool's privacy page for details.
Will gap work in all browsers?
gap for flex has broad modern support, but some older browsers lacked support. Check Can I Use for exact version coverage before shipping to legacy environments.
How do I center an item both vertically and horizontally?
On the container set display:flex; justify-content:center; align-items:center. That centers items on the main and cross axes when using a single flex container.
Where can I read the formal rules?
Read the W3C Flexbox spec for the precise layout algorithm and MDN for practical examples and shorthand expansions like flex:1.
Help keep every tool free
FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.