HTML <wbr> Tag

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 3 Examples
Text Formatting

What You’ll Learn

The <wbr> tag suggests optional break points in text. This guide covers syntax, use cases for URLs and long strings, comparisons with similar tags, and responsive wrapping best practices.

01

Word Break Opportunity

Optional wrap points in long text.

02

Void Element

Empty tag with no closing element.

03

Long URLs

Prevent awkward overflow on mobile.

04

wbr vs br

Optional vs forced line breaks.

05

CSS Complements

Pair with overflow-wrap.

06

Responsive Design

Cleaner text on narrow viewports.

What Is the <wbr> Tag?

The <wbr> element stands for word break opportunity. It tells the browser where it may wrap text onto the next line if the container is too narrow—without forcing a break when there is enough space.

💡
Optional Break — Not a Forced Line Break

Unlike <br>, <wbr> only takes effect when wrapping is needed. On wide screens the text flows normally; on narrow screens the browser breaks at your suggested points.

Use wbr for long URLs, file paths, email addresses, and compound words where breaking at the wrong character hurts readability.

📝 Syntax

Place <wbr> inside the word or string where a break opportunity should be suggested:

syntax.html
YourLongWord<wbr>Here

Syntax Rules

  • <wbr> is a void element—no closing tag and no content.
  • Insert it at natural break points: before dots, slashes, hyphens, or syllable boundaries.
  • You may use multiple wbr elements in one string for several optional break points.
  • Valid as <wbr> or <wbr /> in HTML5.

⚡ Quick Reference

Use CaseCode SnippetNotes
Basic break pointword<wbr>breakInside a word or string
URL domainexample<wbr>.comBreak before TLD
Long path/docs<wbr>/guideBreak at slashes
Compound wordauthentication<wbr>beforeBreak long tokens
AttributesNone (void element)Global attrs allowed

⚖️ <wbr> vs <br> vs <nobr>

ElementEffectWhen to Use
<wbr>Suggests optional break pointLong URLs, paths, responsive wrap
<br>Forces a line break alwaysPoetry, addresses, hard breaks
<nobr>Prevents all breaks (obsolete)Legacy only — use CSS nowrap
CSS overflow-wrapBreaks anywhere if neededGeneral long-word overflow

With wbr

https://www.example.com/page

Without wbr

https://www.example.com/page

🎨 CSS and wbr Together

Combine semantic wbr hints with CSS for robust overflow handling:

overflow-wrap.css
.url-text {
  overflow-wrap: break-word;
  word-break: break-word;
}

Use wbr when you want control over where breaks happen. Use CSS when any break point is acceptable.

🧰 Attributes

The <wbr> tag has no tag-specific attributes. It is a void element whose purpose is entirely structural:

Element type Void

Empty element with no content and no closing tag.

<wbr>
Global attrs Optional

Rarely used; class and id are valid but unnecessary.

<wbr>

The entire purpose of wbr is its placement in text—no attributes are required or commonly used.

Examples Gallery

Long URLs, compound strings, and filenames with optional break points in narrow containers.

👀 Live Preview

Compare wrapping with and without wbr in a narrow box:

With wbr

Visit https://www.example.com/docs

Without wbr

Visit https://www.example.com/docs

📚 Common Use Cases

Use <wbr> when default wrapping would break text at awkward positions on mobile or in sidebars.

Long URLs

Prevent lengthy URLs from overflowing by suggesting a break before the domain suffix.

long-urls.html
<p>
  Visit our website at https://www.example<wbr>.com for more information.
</p>
Try It Yourself

Complex Strings

Break within a long compound word or token where wrapping improves comprehension.

complex-strings.html
<p>
  Ensure proper authentication<wbr>before accessing sensitive data.
</p>
Try It Yourself

Long Filenames

Insert multiple break opportunities in long file paths or hyphenated names.

long-filename.html
<code>my-very-long-project<wbr>-documentation<wbr>-file.html</code>
Try It Yourself

♿ Accessibility

  • Improves readability — Controlled breaks help users on small screens read long strings.
  • Do not overuse — Too many break points create choppy, hard-to-read text.
  • Prefer natural points — Break at slashes, dots, and hyphens rather than mid-word when possible.
  • Screen readerswbr is generally ignored; it does not add spoken pauses like br.

🧠 How <wbr> Works

1

Author inserts wbr

Mark preferred break points in URLs, paths, or long tokens.

Markup
2

Browser measures space

If the line fits, wbr has no visible effect.

Layout
3

Wrap at opportunity

When space is tight, the browser may break the line at a wbr position.

Responsive
=

Clean wrapping on any screen

Text stays readable without horizontal overflow or awkward mid-character breaks.

Browser Support

The <wbr> tag is supported in all modern browsers. Internet Explorer 7+ includes support.

HTML5 · Fully supported

Universal word-break support

All major browsers honor wbr as an optional line break opportunity in responsive layouts.

99% Browser support
Google Chrome Fully supported
Full support
Mozilla Firefox Fully supported
Full support
Apple Safari Fully supported
Full support
Microsoft Edge Fully supported
Full support
Internet Explorer IE 7+ supported
Full support
Opera Fully supported
Full support
<wbr> tag 99% supported

Bottom line: Use <wbr> confidently for responsive text wrapping in all browsers your users run today.

Conclusion

Understanding and using the <wbr> tag improves readability and layout on responsive pages. Whether you are handling lengthy URLs or intricate strings, wbr provides a subtle, standards-based tool for controlling where text may wrap.

💡 Best Practices

✅ Do

  • Place wbr at natural break points (dots, slashes, hyphens)
  • Use for long URLs and file paths on mobile layouts
  • Combine with CSS overflow-wrap for overflow safety
  • Test wrapping in narrow containers and sidebars
  • Use multiple wbr tags for very long strings

❌ Don’t

  • Use wbr instead of br when you need a forced break
  • Insert break points mid-syllable without reason
  • Overuse wbr in normal prose paragraphs
  • Rely on wbr alone when CSS word-break is sufficient
  • Expect visible effect on wide desktop viewports

Key Takeaways

Knowledge Unlocked

Five truths every developer should know about <wbr>

Bookmark these before you wrap your next long URL.

5
Core concepts
02

Void Element

No attributes, no content, no closing tag.

Syntax
03

vs br

wbr is optional; br is forced.

Comparison
🔗 04

Long URLs

Break before .com and path slashes.

Use Case
📱 05

Responsive

Only visible when the container is narrow.

Layout

❓ Frequently Asked Questions

The <wbr> element suggests an optional line break opportunity. The browser may wrap at that point when space is limited.
br always forces a new line. wbr only allows a break when the line would otherwise overflow.
No tag-specific attributes. wbr is a void element; global attributes are allowed but rarely needed.
Place wbr before dots, slashes, or hyphens so URLs wrap cleanly on mobile without horizontal scrolling.
nobr (obsolete) prevents all breaks. wbr allows breaks at specific suggested points.
Yes in all modern browsers. Internet Explorer 7+ supports the wbr element.

Improve responsive text wrapping

Practice the <wbr> tag with URLs and long strings in the Try It editor.

Try long URL example →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful