Patch Bandit

The story / The lab

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.

Snick the raccoon focused on the screen

Drag to reflow the boxes

Every box below uses the exact same text and font size. Only text-wrap changes.

Headline: text-wrap balance shines

text-wrap: wrap (default)

Free browser tools that never ask you for an account

text-wrap: balance

Free browser tools that never ask you for an account

text-wrap: pretty

Free browser tools that never ask you for an account

Paragraph: text-wrap pretty shines

text-wrap: wrap (default)

Simple everyday utilities run right inside your browser with zero uploads, no tracking scripts, and no surprise renewal reminders waiting in your inbox later.

text-wrap: pretty

Simple everyday utilities run right inside your browser with zero uploads, no tracking scripts, and no surprise renewal reminders waiting in your inbox later.

text-wrap: balance

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

Headlines and paragraphs (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;
}

Paired with max-width (CSS)
/* 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.