Popcorn · 2026-11-22
CSS text-wrap: balance vs pretty, live
CSS text-wrap tells the browser how to break lines so headlines stop leaving one lonely word on the last line and paragraphs read more evenly. Drag the width slider below and watch the same text reflow three ways at once.
No more sticking manual line breaks into every title.
Headline: text-wrap balance shines
Free browser tools that never ask you for an account
Free browser tools that never ask you for an account
Free browser tools that never ask you for an account
Paragraph: text-wrap pretty shines
Simple everyday utilities run right inside your browser with zero uploads, no tracking scripts, and no surprise renewal reminders waiting in your inbox later.
Simple everyday utilities run right inside your browser with zero uploads, no tracking scripts, and no surprise renewal reminders waiting in your inbox later.
Simple everyday utilities run right inside your browser with zero uploads, no tracking scripts, and no surprise renewal reminders waiting in your inbox later.
When to pick text-wrap balance vs text-wrap pretty
Use text-wrap: balance for short text. Page titles, card headings, pull quotes, and button captions look much cleaner when the browser keeps line lengths roughly equal instead of filling the top line to the edge and dropping one stray word below.
Use text-wrap: pretty for body paragraphs. Instead of squeezing every line to match, pretty favors smooth reading rhythm and prevents a lone orphan word from sitting by itself on the final line.
Browser support: text-wrap: balance works in current Chrome, Edge, Safari, and Firefox. text-wrap: pretty works in Chrome, Edge, and Safari, while Firefox falls back cleanly to normal wrapping. Both are safe progressive upgrades because older browsers simply ignore the property. Tested in Chromium only.
Copy the CSS
/* Even out multi-line headings so no lone word hangs on the last line */
h1, h2, h3, blockquote {
text-wrap: balance;
}
/* Smooth out body copy and avoid awkward single-word last lines */
p, li, figcaption {
text-wrap: pretty;
}/* Progressive setup: unsupported browsers ignore text-wrap and keep normal wrapping */
.hero-title {
max-width: 24ch;
text-wrap: balance;
}
.card-summary {
max-width: 58ch;
text-wrap: pretty;
}The fine print, in plain words
Why this is free
We're raccoons who think simple things shouldn't cost a monthly fee. We take techniques apart, explain them in plain words, and give them away. The code on this page is MIT licensed: copy it, change it, and share it.
This is one of twelve experiments so far. Our first browser tool (Bandit Codes) is live now, and the rest sit as ideas in the stash.
Next snack
Squircle CSS with corner-shape
Smooth squircles, scoops, bevels, and notches from one CSS property, with a live browser check.