Balance Headlines in CSS with text-wrap: balance
Balanced headlines without manual line breaks
By Naeem Noor on Updated on
You used to add br tags by hand or pull in Balance-Text.js. Now one property evens out lines so headlines don't end with a single word.
The old hack vs the modern fix
View demoOld way8 lines
/* HTML: manual <br> or wrapper for JS */
h1 {
text-align: center;
max-width: 40ch;
/* Balance-Text.js: script + init */
/* or insert <br> in CMS/HTML */
}4 lines
h1, h2 {
text-wrap: balance;
max-width: 40ch;
}text-balance
Example
<!-- text-balance built in since Tailwind v3.4 --><h1 class="text-balance max-w-[40ch]">Headline that wraps evenly</h1><!-- text-pretty for body text (avoids orphaned last words) --><p class="text-pretty">Body paragraph text</p>Text wrap balance browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2024.Safe to use without fallbacks.
Usage94%of people can use this6% use a browser without it.
Browsers
114+
121+
17.5+
114+Last checked 3 Dec 2026 · web-features 3.49.0
Live demo
same headline, same width: compare the last lines
Why the modern way wins
No scripts
Drop Balance-Text or any JS. The browser balances lines natively.
No manual br tags
Works with any content width. No CMS hacks or hand-placed line breaks.
Performance
Layout happens in the engine. No DOM reads or resize observers.
- Lines Saved
- 7 → 4
- No JS, no br
- Old Approach
- Manual br or JS lib
- Balance-Text, CMS hacks
- Modern Approach
- One property
- Native text-wrap: balance
How it works
Headlines often wrapped with one word on the last line. The old fix was either manual <br> tags (brittle when copy changes) or a script like Balance-Text that measured and reflowed after paint.
text-wrap: balance tells the browser to prefer more even line lengths. It works best on short blocks (a few lines). No script, no DOM access, just layout.