The overflow-wrap property tells the browser how to break long words or unbreakable text so it stays inside its container and does not cause horizontal overflow.
01
Word Wrapping
Handle long text.
02
normal Default
Default line breaks.
03
break-word
Prevent overflow.
04
Responsive Text
Narrow containers.
05
URLs & Links
Wrap long paths.
06
Readability
Cleaner layouts.
Fundamentals
Introduction
The overflow-wrap property in CSS is used to specify how the browser should handle long words or unbreakable text that overflows the boundaries of its container.
This property helps improve the readability and layout of text content, especially in responsive design scenarios. It ensures that text does not break the layout or cause horizontal scrolling issues.
Definition and Usage
Use overflow-wrap: break-word on paragraphs, cards, sidebars, and links when content might include long strings without spaces, such as URLs, usernames, or generated identifiers.
The default normal value is fine for typical prose, but narrow layouts often need break-word to stay readable on small screens.
💡
Beginner Tip
Start with a fixed-width box and a very long unbroken word. Compare normal and break-word to see the difference immediately.
Foundation
📝 Syntax
The overflow-wrap property can be applied to any block-level or inline-level element. It has the following syntax:
syntax.css
element{overflow-wrap:normal | break-word;}
Here, value can be one of the predefined keywords described below.
The container usually needs a width or max-width for wrapping behavior to matter.
break-word breaks long words only when they would otherwise overflow.
Also known historically as word-wrap in older CSS.
Defaults
🎯 Default Value
The default value of the overflow-wrap property is normal. This means that the browser will use its default line-breaking rules, which may not always prevent long words from overflowing their container.
Switch to break-word when unbroken strings would spill outside narrow boxes or cause horizontal scrolling.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
normal
Applies to
All elements
Inherited
Yes
Animatable
No
Common use
Wrapping long words, URLs, and unbreakable strings in narrow containers
Reference
💎 Property Values
Value
Example
Description
normal
overflow-wrap: normal;
Allows words to overflow their container if they do not fit. This is the default behavior.
break-word
overflow-wrap: break-word;
Breaks long words and wraps them onto the next line to prevent overflow. This value ensures that even if a word is too long to fit, it will break to avoid horizontal scrolling.
normal — default line breaksbreak-word — wrap long words
Preview
👀 Live Preview
Same long unbroken word in narrow boxes with normal vs break-word:
normal verylongwordwithoutanybreakpoints
break-word verylongwordwithoutanybreakpoints
Hands-On
Examples Gallery
Wrap long words, compare defaults, handle URLs, and keep sidebar text inside narrow layouts.
💬 Word Wrapping Basics
Use overflow-wrap: break-word to prevent long strings from overflowing narrow containers.
Example 1 — break-word on a Text Container
In this example, we’ll apply the overflow-wrap property to a paragraph element to handle long words gracefully.
break-word.html
<style>.text-container{width:200px;border:1px solid #ccc;padding:10px;overflow-wrap:break-word;}</style><divclass="text-container">
This is an example of a verylongwordthatwillbreakandwrapcorrectlyinsideitscontainerwithoutcausinganyoverflowissues.
</div>
Even without spaces, the text wraps within the sidebar’s max width on small screens.
Companion
Works with word-break and overflow-x
overflow-wrap handles word breaking to prevent overflow. Pair it with word-break for stronger break rules, or use overflow-x when you need horizontal scrolling instead of wrapping.
Prevent horizontal scrolling — Wrapping long strings helps users on small screens avoid sideways panning.
Keep links readable — Broken URLs remain clickable when wrapping is applied thoughtfully.
Avoid excessive mid-word breaks — Use break-word only where overflow would otherwise harm layout.
Test with zoom — Text reflow at larger font sizes should still stay within containers.
🧠 How overflow-wrap Works
1
Text fills a container
A word or string may be longer than the available line width.
Content
2
overflow-wrap value is applied
normal keeps default rules; break-word allows breaks to prevent overflow.
Value
3
Lines wrap inside the box
Long words move to the next line instead of stretching the layout horizontally.
Wrap
=
💬
Readable responsive text
Content stays inside its container without unwanted horizontal overflow.
Compatibility
Browser Compatibility
The overflow-wrap property is widely supported across modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. It is a reliable solution for managing text overflow issues in most web environments.
✓ Baseline · Modern browsers
Excellent support everywhere
normal and break-word work reliably in all current major browsers.
98%Modern browser support
Google Chrome1+ · Desktop & Mobile
Full support
Mozilla Firefox3.5+ · Desktop & Mobile
Full support
Apple Safari3.1+ · macOS & iOS
Full support
Microsoft Edge12+ · All versions
Full support
Opera10.5+ · All versions
Full support
overflow-wrap property98% supported
Bottom line: Safe to use for text wrapping in all modern projects.
Wrap Up
Conclusion
The overflow-wrap property is a valuable tool for controlling how text content behaves when it exceeds its container.
By using this property, you can improve the readability and user experience of your website by ensuring that text wraps correctly and avoids causing layout problems. Experiment with different values to see how they affect your text content and find the best fit for your design needs.
Use break-word on narrow cards, sidebars, and links
Set a width or max-width on text containers
Apply wrapping to URLs and user-generated content
Test on mobile screen sizes
Combine with sensible line-height for readability
❌ Don’t
Confuse overflow-wrap with overflow-x
Force break-word on every element by default
Rely on horizontal scrolling when wrapping is the better UX
Forget that normal may still overflow narrow boxes
Assume wrapping fixes all layout issues without container sizing
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about overflow-wrap
Use these points when long words threaten your layout.
5
Core concepts
💬01
Word Wrapping
Prevent overflow.
Purpose
⚙02
Default normal
Standard breaks.
Default
📝03
break-word
Wrap long strings.
Values
🔗04
URLs & Sidebars
Common use case.
Use case
↔05
Not overflow-x
Different property.
Companion
❓ Frequently Asked Questions
overflow-wrap controls how the browser breaks long words or unbreakable strings so they fit inside their container instead of overflowing horizontally.
The default value is normal, which lets the browser use its default line-breaking rules and may allow long words to overflow.
overflow-wrap breaks words only when needed to prevent overflow, while word-break can force breaks at any character depending on its value.
Use break-word on narrow containers, cards, sidebars, and links when long URLs or unbroken strings might cause horizontal overflow.
No. overflow-x controls horizontal scrolling and clipping, while overflow-wrap controls whether long words wrap onto the next line.