The word-break property controls how words split at line edges — essential when long URLs, code, or unbroken strings would otherwise overflow.
01
Line breaks
Inside long words.
02
Syntax
Keyword values.
03
normal
Default value.
04
break-all
Any character.
05
keep-all
CJK text.
06
URLs
Prevent overflow.
Fundamentals
Introduction
The word-break property in CSS is used to specify how words should break or split when reaching the end of a line. This property is particularly useful for controlling the behavior of text in situations where long words or URLs might disrupt the layout of your content.
By using the word-break property, you can ensure a more visually appealing and readable presentation of text on your website.
Definition and Usage
Apply word-break on containers with constrained width — cards, tables, chat bubbles, code blocks, and mobile layouts. It works alongside overflow-wrap and white-space to manage how text flows.
💡
Beginner Tip
For long URLs in narrow spaces, try word-break: break-all or overflow-wrap: anywhere. Use break-all carefully on regular paragraphs because it can split words mid-character and hurt readability.
Foundation
📝 Syntax
The syntax for the word-break property is straightforward. It can be applied to any block or inline-level element.
Monospace code often contains unbreakable strings. break-all keeps the block within its container.
A11y
♿ Accessibility
Readability first — Avoid break-all on body paragraphs where mid-word splits confuse readers.
Zoom and mobile — Proper wrapping prevents horizontal scrolling, which helps users with low vision and motor difficulties.
Screen readers — Visual breaks do not change spoken text, but confusing layout can still hinder comprehension for some users.
Prefer overflow-wrap when possible — It breaks less aggressively than break-all for general content.
Companion
word-break + overflow-wrap
Modern layouts often combine both properties: overflow-wrap: break-word for soft wrapping, and word-break: break-all only where aggressive breaks are acceptable.
Keywords define whether breaks are allowed inside words.
Rules
3
Browser wraps or overflows
Text splits across lines or overflows if breaking is not allowed.
Layout
=
✅
Contained readable text
Content fits the layout without breaking the page.
Compatibility
Browser Compatibility
The word-break property is supported in all modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. Test your layouts across browsers to ensure consistent wrapping behavior.
✓ Modern browsers · Widely supported
Text wrapping control
All major browsers support normal, break-all, keep-all, and break-word.
99%Browser support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions
Full support
OperaAll versions
Full support
Testing tip
Test with real URLs, JWT tokens, and CJK sample text on narrow mobile widths.
word-break property99% supported
Bottom line:word-break is safe to use for text wrapping control on the modern web.
Wrap Up
Conclusion
The word-break property is an essential tool for web developers looking to control the behavior of text wrapping on their web pages.
By customizing how words break at the end of a line, you can enhance the readability and aesthetic appeal of your content. Experiment with different values of the word-break property to see how it can improve the layout and presentation of your text.
Set a max-width on text containers for readability
❌ Don’t
Apply break-all to entire article body text
Confuse word-break with white-space
Forget that break-word has modern alternatives
Ignore horizontal overflow on small screens
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about word-break
Use these points when handling long unbroken text.
5
Core concepts
📚01
Break control
Inside words.
Purpose
🕐02
normal
Default value.
Default
🔀03
break-all
URLs & code.
Pattern
🔒04
keep-all
CJK text.
i18n
🌐05
overflow-wrap
Modern pair.
Companion
❓ Frequently Asked Questions
word-break controls how words and strings break when they reach the edge of a container, which helps prevent overflow from long URLs, code, or unbroken text.
The default value is normal, which uses standard line-breaking rules for the language.
break-all can break at any character to prevent overflow. break-word only breaks when necessary and prefers breaking at word boundaries when possible.
keep-all prevents word breaks in CJK (Chinese, Japanese, Korean) text. Non-CJK text behaves like normal.
Yes, word-break is inherited. Setting it on a parent affects child text unless overridden.