The word-wrap property tells the browser whether it may break long words when they overflow — a simple fix for narrow layouts and unbroken strings.
01
Overflow
Prevent text spill.
02
Syntax
Two keywords.
03
normal
Default value.
04
break-word
Wrap long words.
05
overflow-wrap
Modern alias.
06
URLs
Card layouts.
Fundamentals
Introduction
The word-wrap property in CSS is used to specify whether or not the browser should break words when they overflow the content area. This can be particularly useful for preventing long words from stretching the layout of a web page and ensuring that text content remains readable and aesthetically pleasing.
In modern CSS, word-wrap is a legacy alias for overflow-wrap. Both names work in browsers today, but new projects should prefer overflow-wrap for clarity.
Definition and Usage
Apply word-wrap on text containers with a fixed or max width — cards, sidebars, comment boxes, and mobile columns. It works alongside word-break and white-space to control how text flows when space is limited.
💡
Beginner Tip
When a long URL or unbroken string pushes outside its box, try word-wrap: break-word; (or overflow-wrap: break-word;). The browser breaks the word only when it would otherwise overflow.
Foundation
📝 Syntax
The syntax for the word-wrap property is straightforward. It can be applied to any element that contains text content.
syntax.css
element{word-wrap:normal | break-word;}
Basic Example
word-wrap.css
.wrapper{width:200px;word-wrap:break-word;}
Syntax Rules
Accepted values: normal and break-word.
The container usually needs a width or max-width for wrapping to matter.
break-word breaks inside a word only when necessary to prevent overflow.
Modern equivalent: overflow-wrap: break-word;
The property is inherited.
Related Properties
overflow-wrap — standard name for the same behavior
word-break — more aggressive break rules inside words
white-space — controls space collapsing and line wrapping
hyphens — adds hyphenation at break points when supported
Defaults
🎯 Default Value
The default value of the word-wrap property is normal, meaning that words will only break at normal line break points (such as spaces or hyphens).
Cheat Sheet
⚡ Quick Reference
Question
Answer
Default value
normal
Wrap long unbroken words
word-wrap: break-word;
Modern equivalent
overflow-wrap: break-word;
More aggressive breaks
word-break: break-all;
Inherited
Yes
Reference
💎 Property Values
The word-wrap property accepts two keyword values.
Value
Example
Description
normal
word-wrap: normal;
Words break only at normal line break points (default).
break-word
word-wrap: break-word;
Words may break at arbitrary points if necessary to prevent overflow.
normalbreak-word
Context
When to Use word-wrap
word-wrap helps whenever long unbroken strings meet narrow containers:
Responsive cards — Keep text inside fixed-width UI on mobile.
Long URLs and emails — Prevent horizontal scrolling in comments and chat.
Browsers treat word-wrap as an alias for overflow-wrap. Use whichever name your team prefers, but document the modern name for new code.
A11y
♿ Accessibility
Prevent horizontal scroll — Wrapping long strings helps users with low vision and motor difficulties who struggle with sideways scrolling.
Readability — break-word is gentler than word-break: break-all because it breaks only when needed.
Screen readers — Visual line breaks do not change spoken text, but clearer layout still aids comprehension.
Zoom — Test wrapping at 200% browser zoom on narrow viewports.
Companion
word-wrap + word-break
Start with overflow-wrap: break-word (or word-wrap: break-word) for general content. Add word-break: break-all only on elements like URLs or code where more aggressive breaks are acceptable.
break-word allows breaking inside the word when overflow would occur.
Rules
3
Browser wraps or overflows
Text continues on the next line or spills out if breaking is not allowed.
Layout
=
✅
Contained readable text
Content fits the layout without breaking the page.
Compatibility
Browser Compatibility
The word-wrap property is supported in all modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. It is also supported in older versions of Internet Explorer (starting from IE 5.5). You can use it confidently across a wide range of web browsers.
✓ Modern browsers · Widely supported
Legacy alias, broad support
All major browsers support normal and break-word on word-wrap and the equivalent overflow-wrap.
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 and long unbroken strings on narrow mobile widths and at 200% zoom.
word-wrap property99% supported
Bottom line:word-wrap is safe to use everywhere. Prefer overflow-wrap in new stylesheets.
Wrap Up
Conclusion
The word-wrap property is a simple yet effective tool for managing how text content behaves when it overflows its container.
By allowing or preventing words from breaking at arbitrary points, you can maintain the readability and layout integrity of your web pages. Experiment with this property to see how it can enhance the presentation of your text content.
Use these points when handling long unbroken text.
5
Core concepts
📚01
Overflow control
Wrap long words.
Purpose
🕐02
normal
Default value.
Default
🔀03
break-word
Prevent spill.
Pattern
🔄04
overflow-wrap
Modern name.
Standard
🌐05
word-break
Companion tool.
Related
❓ Frequently Asked Questions
word-wrap controls whether the browser may break long words when they would overflow their container. break-word allows breaking inside a word only when needed to prevent overflow.
The default is normal, which only breaks at normal line break points such as spaces and hyphens.
Yes. word-wrap is the legacy name. overflow-wrap is the modern standard property with the same behavior.
word-wrap (overflow-wrap) breaks long words only when necessary to prevent overflow. word-break can force breaks at any character depending on its value.
Prefer overflow-wrap: break-word in new projects. word-wrap still works in all browsers but is considered a legacy alias.