Modern CSS text-wrap (2023 onwards)
text-wrap is a CSS property, first shipped in Chrome 114 in May 2023, that lets you choose how the browser breaks lines. The two interesting values are balance (for headings, make every line roughly equal length) and pretty (for paragraphs, avoid orphan words on the last line). Both eliminate the kind of typesetting awkwardness that previously required JavaScript or careful manual line breaks.
Browser support arrived in waves: Chrome shipped balance in version 114 (May 2023) and pretty in 117 (September 2023). Firefox shipped balance in 121 (December 2023). Safari shipped balance in 17.5 (May 2024) and pretty only in Safari 26 (September 2025); Firefox does not support pretty yet (MDN browser compatibility data, checked October 2026). The fallback is the default line-breaking algorithm, so the page still renders fine; it just loses the polish.
Hyphens for justified text
The CSS hyphens property controls whether the browser inserts hyphenation breaks inside long words. hyphens: auto turns on dictionary-based hyphenation using the language specified by the lang attribute. hyphens: manual respects only the soft-hyphen characters you have added by hand. hyphens: none disables hyphenation entirely. For long-form content in narrow columns, hyphens: auto is what makes justified text not look terrible.
Hyphenation depends on the lang attribute being set correctly. lang=en gets English hyphenation rules; lang=de gets German rules. Without lang, the browser may fall back to incorrect rules or skip hyphenation. The Tester surfaces this by letting you set the language live and see the effect.
Common Use Cases
Editorial publications use text-wrap balance on every headline to eliminate the embarrassing one-word last line. E-commerce product pages use text-wrap pretty on description paragraphs to keep the last line from being a stranded single word. Documentation sites use hyphens auto inside narrow code-example callouts to break long identifiers cleanly.
Internationalized content benefits the most. German and Finnish have very long compound words that overflow narrow columns without hyphenation. Setting the lang attribute correctly and enabling hyphens auto often fixes that, where the browser has a dictionary for the language (Chrome has German but not Finnish; see below).
Worked example: what balance and pretty actually change
On October 12, 2026 we set a headline and a paragraph in Chromium 141 at several column widths and measured the width of every line (in px) with text-wrap set to wrap, balance and pretty.
| Text and column | wrap (line widths) | balance | pretty |
|---|---|---|---|
| Headline, 28 px, 320 px column | 300 / 236 / 137 | 251 / 204 / 217 | same as wrap |
| Paragraph, 16 px, 360 px | 357 / 321 / 346 / 194 | 289 / 292 / 316 / 320 | same as wrap |
| Paragraph, 16 px, 320 px | … / 40 ("script.") | — | … / 67 ("any script.") |
| Paragraph, 16 px, 264 px | … / 40 ("script.") | — | 6 lines, last 67 ("any script.") |
- balance evens out every line. The headline went from 300 / 236 / 137 px to 251 / 204 / 217 px: same line count, no short last line. On a 4-line paragraph it also shortened the first three lines, which makes body text look ragged, so keep balance for headings and captions (Chromium only balances up to 6 lines anyway).
- pretty only steps in when the last line is a single short word. Where wrap already ended on a decent line it changed nothing; where it left "script." alone on the last line, it pulled "any" down so the last line held two words. Expect it to change roughly one paragraph in many.
- Hyphenation depends on the browser having a dictionary for the language. MDN's compatibility data shows Chrome and Edge ship English, German, Spanish, French and many others, but no Finnish, Polish, Turkish or Catalan dictionary (Firefox and Safari have Finnish and Polish), so
hyphens: autoon Finnish text does nothing in Chrome. Safari supports unprefixedhyphensonly from version 17; add-webkit-hyphens: autofor older iPhones. - Test hyphenation in the browsers your readers use. Our headless Chromium build on Linux applied no hyphenation at all for English, German or Finnish text in a 160 px column, because that build has no dictionaries installed. Hyphenation is a browser feature, not something the CSS guarantees.
Sources
Checked on .