One of the nicest small CSS features of recent years has reached an important milestone. According to the web-features data behind Baseline, text-wrap: balance became Baseline Widely available on 13 November 2026, and the modern.css Baseline tracker lists it among this month’s changes. Widely available means it has worked in the latest Chrome, Edge, Firefox and Safari for at least 30 months, so most teams can use it without a second thought.

This tutorial explains what text-wrap: balance does, where to use it, its limits, and how it relates to pretty, stable and the newer longhand properties.

The problem it solves

Browsers wrap text greedily: they fit as many words as possible on each line, then move on. For body text that’s fine. For headings, it often produces an awkward result, such as a long first line and a lonely last word:

How to Build a Faster Website With Modern
CSS

text-wrap: balance asks the browser to balance the number of characters on each line instead:

How to Build a Faster Website
With Modern CSS

Same text, same width, but much easier to read.

Browser support

From the web-features data:

Browser text-wrap: balance since
Chrome / Edge 114
Firefox 121
Safari (macOS and iOS) 17.5

It became Baseline Newly available on 13 May 2024 and Widely available on 13 November 2026. Browsers that don’t support it simply wrap normally, so it’s a safe progressive enhancement even for older ones.

Basic usage

The simplest and most useful rule you can add to a site:

h1,
h2,
h3,
h4,
blockquote,
figcaption {
  text-wrap: balance;
}

That’s it. No JavaScript, no layout shift, no extra markup.

A complete example

<article class="card">
  <h2>Ten Practical CSS Tips Every Front-End Developer Should Know</h2>
  <p>Short, useful techniques you can drop into any project today.</p>
</article>
.card {
  max-width: 28rem;
  padding: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 12px;
}

.card h2 {
  font-size: clamp(1.25rem, 2vw + 1rem, 1.75rem);
  line-height: 1.2;
  text-wrap: balance;
}

Resize the browser and watch the heading. Each line stays roughly the same length instead of leaving one word stranded.

The line limit

Balancing is expensive: the browser has to try different break points and compare line lengths. So browsers only balance short blocks. MDN notes that the value is “only supported for blocks of text spanning a limited number of lines (six or less for Chromium and ten or less for Firefox).”

In practice:

  • Use it for headings, card titles, pull quotes, captions, buttons and short labels.
  • Don’t rely on it for paragraphs. A long paragraph will simply fall back to normal wrapping.

Because the limit keeps the work small, MDN says the performance impact is negligible for the elements it is meant for.

Balance changes the lines, not the box

One thing surprises people. A balanced heading may look narrower, because its lines are shorter, but the element’s box keeps its full width. If you put a background, border or underline on a balanced heading, it still stretches across the container, and the space to the right of the text can look odd. Check those designs at several widths, and if the decoration needs to hug the words, apply it to an inline element (such as a <span> inside the heading) rather than to the block.

balance vs pretty vs stable

text-wrap has several style values. Here’s how they differ, based on MDN:

Value What it does Best for Baseline status
wrap Default, fast wrapping Everything Widely available
balance Balances characters per line Short text (headings) Widely available
pretty Slower algorithm that favours better layout, e.g. avoiding orphans Body text Not Baseline yet
stable Lines before the one being edited don’t re-wrap contenteditable areas Newly available
nowrap No wrapping at all Single-line labels Widely available

What about text-wrap: pretty?

pretty is designed for paragraphs: it tries to avoid a very short last line (an “orphan”). According to web-features it’s supported in Chrome/Edge 117+ and Safari 26+, but not yet in Firefox, so it isn’t Baseline. It’s still a safe progressive enhancement, because unsupported browsers just wrap normally:

p {
  text-wrap: pretty;
}

MDN warns that pretty has a performance cost, so use it for body copy where layout matters more than speed, not for huge blocks of text that change constantly.

stable for editors

If users type into an element, stable stops earlier lines jumping around as they edit:

[contenteditable] {
  text-wrap: stable;
}

Shorthand vs longhand: use text-wrap

text-wrap is a shorthand for two longhand properties: text-wrap-mode (wrap or nowrap) and text-wrap-style (auto, balance, pretty, stable).

There’s a support detail to know here. The Widely available status applies to text-wrap: balance, the shorthand form. The longhand text-wrap-style: balance arrived later (Chrome/Edge 130, Firefox 124, Safari 17.5) and is only Newly available. So for the widest support, write:

/* Widest support */
h2 { text-wrap: balance; }

/* Newer longhand, fine for modern browsers only */
h2 { text-wrap-style: balance; }

If you need to set wrapping and style separately, for example to turn wrapping off on small screens, the longhands are handy:

.tag {
  text-wrap-mode: nowrap;
}

@media (min-width: 40rem) {
  .tag {
    text-wrap-mode: wrap;
    text-wrap-style: balance;
  }
}

Feature detection

Usually you don’t need it, because unsupported browsers ignore the value. If you do want different styles depending on support, use @supports:

.hero-title {
  max-width: 20ch; /* fallback: limit width to avoid very long lines */
}

@supports (text-wrap: balance) {
  .hero-title {
    max-width: none;
    text-wrap: balance;
  }
}

Replacing JavaScript balancers

Before this feature, sites used JavaScript libraries that measured text and inserted line breaks, or added <br> and &nbsp; by hand. Those approaches cause layout shifts, break when fonts load late, and fall apart with translations. If your codebase has any of them, text-wrap: balance is a good reason to delete code:

  1. Search your project for manual <br> tags in headings and for text-balancing scripts.
  2. Remove them and add text-wrap: balance to the heading styles.
  3. Check long translated headings (German and Finnish words are a good test) at several widths.

Accessibility and i18n notes

  • Balancing only changes soft line breaks. It doesn’t change the text, so screen readers read it exactly the same.
  • It respects the language’s normal line-breaking rules, so it works with CJK text too. MDN links to further reading on balancing Japanese and Korean typography.
  • Don’t use it to fix truly long headings. If a heading needs more than about six lines on mobile, the copy is probably too long.

Takeaway

text-wrap: balance is now Baseline Widely available, so add it to your headings, captions and quotes today: one line of CSS, no JavaScript, and noticeably better-looking titles. Use the text-wrap shorthand for the widest support, keep it to short text because browsers limit how many lines they balance, and reach for text-wrap: pretty as a progressive enhancement for paragraphs.