word-break

word-break changes text line-breaking rules. It affects multiline text, not just a single-line fragment. Normal uses language-specific breaking; aggressive breaking can split ordinary words even when moving the whole word to the next line would work.

Compare break-all with emergency wrapping

The sentence contains ordinary words followed by a long token. Break-all can split ordinary words at the line edge; overflow-wrap:anywhere generally keeps a word intact when it can fit on the next line.

Compare word-breakLink

HTML and CSS

HTML

<p class="sample aggressive">
  Practice layout registrationidentifierwithoutspaces
</p>
<p class="sample emergency">
  Practice layout registrationidentifierwithoutspaces
</p>

CSS

.sample {
  max-width: 14ch;
  padding: 0.5rem;
  margin-block: 0.5rem;
  background: #eff6ff;
}
.aggressive {
  word-break: break-all;
}
.emergency {
  overflow-wrap: anywhere;
}

Edit HTML or CSS to update the preview as you type. Copy code snippet copies the selected tab. Preview spacing and font defaults are not included.

Compare CJK text with and without keep-all

Keep-all suppresses ordinary breaks within Chinese/Japanese/Korean text; it does not prohibit all spaces or punctuation breaks. Here overflow:auto keeps an intentionally unbroken line reachable.

Compare CJK text with and without keep-allLink

HTML and CSS

HTML

<p class="sample" lang="zh">学习网页布局并检查文本换行。</p>
<p
  class="sample kept"
  lang="zh"
  tabindex="0"
  role="region"
  aria-label="Chinese text with keep-all"
>
  学习网页布局并检查文本换行。
</p>

CSS

.sample {
  max-width: 8rem;
  overflow: auto;
  padding: 0.5rem;
  margin-block: 0.5rem;
  background: #eff6ff;
}
.kept {
  word-break: keep-all;
}

Edit HTML or CSS to update the preview as you type. Copy code snippet copies the selected tab. Preview spacing and font defaults are not included.

Values and defaults

The initial value is normal and the property is inherited. Break-all permits additional breaks in non-CJK text. Keep-all suppresses ordinary CJK character breaks while leaving non-CJK normal behavior intact. The deprecated break-word value behaves like normal plus overflow-wrap:anywhere, regardless of the separately declared overflow-wrap value; it is not the same as overflow-wrap:break-word.

Auto-phrase performs language-aware phrase analysis where supported and needs a value-specific support check. Manual is specified but is not an interoperable implemented value.

Choose a language-aware rule

Do not apply break-all to all prose to mask a sizing bug. Use overflow-wrap for long-token emergencies and hyphens for dictionary/manual hyphenation. Language metadata helps the browser choose text-processing rules.

Learn white-space and html language. Test real content in each supported language.

Sources and browser support

MDN: word-break describes the syntax and links to the specification and compatibility data. Check individual values in that table when supporting older browsers.