Home HTML Tags <wbr> HTML <wbr> Tag Definition
Definition and Usage The <wbr> element marks a word break opportunity — a place where the browser may wrap a line inside text that would not normally break (long compound words, long URLs, and similar).
It is a void element : start tag only, no content, no end tag. It does not force a break and does not insert a hyphen. For a hard line break use <br> . For an optional hyphen at the wrap point use a soft hyphen (­).
Baseline · Widely available. Not deprecated. Stable across browsers since about July 2015 (and earlier in practice).
Like U+200B. <wbr> behaves like a zero-width space for wrapping: invisible when unused, no hyphen when used, and no effect on bidi reordering of digits around it.
Syntax
HTML Syntax In HTML5, write <wbr>. In XHTML, self-close as <wbr />. Never write <wbr></wbr>. Place it between parts of the word or URL.
Reference
Attributes <wbr> has no element-specific attributes — only globals. Compare related ways to control wrapping:
Option Description Try it <wbr>Optional break opportunity; no hyphen when it wraps Try it<br>Always inserts a hard line break Try it­Optional break that shows a hyphen when the line wraps Try itoverflow-wrapCSS way to allow wrapping long unbroken strings See CSS tutorial
Try it
Live Preview Compare no break hints, <wbr>, and a soft hyphen. Drag the dashed box wider or narrower to force wrapping.
Code
HTML Examples Short, copy-ready snippets. Use Try It Yourself for a live editor.
1. Long word 2. Long URL 3. wbr vs br 4. wbr vs shy Example 1 — Long Compound Word Suggest wrap points inside a word that has no spaces.
<p>
Fernstraßen<wbr>bau<wbr>privat<wbr>finanzierungs<wbr>gesetz
</p> Without wbr
Fernstraßenbauprivatfinanzierungsgesetz
With wbr
Fernstraßenbauprivatfinanzierungsgesetz
How It Works Find natural parts of the long word (here syllable-like chunks).Insert <wbr> between those parts.If the line is wide enough , the word still appears unbroken.If the column is narrow , the browser may wrap at a wbr — with no hyphen.Example 2 — Long URL Allow wraps before punctuation so a trailing mark is less confusing.
<p>
https://www<wbr>.example<wbr>.com<wbr>/docs<wbr>/guide
</p> https://www.example.com/docs/guide
How It Works Write the full URL as normal text (or inside a link).Place <wbr> before . or / where a wrap is OK.On a narrow line , the URL can continue on the next line.Readers are less likely to mistake a lone punctuation mark for the end of the address.Example 3 — wbr vs br Use wbr for optional wraps; use br when the break must always happen.
<p>Optional: super<wbr>califragilistic</p>
<p>Always:<br>Line two</p> wbr (optional)
Optional: supercalifragilistic
br (always)
Always: Line two
How It Works <wbr> only wraps when space runs out.<br> always starts a new line.Poems and addresses usually need br.Long tokens in a paragraph usually need wbr (or CSS wrapping).Example 4 — wbr vs Soft Hyphen Choose wbr for a clean wrap, or ­ when a hyphen should appear.
<p>With wbr: extra<wbr>ordinary</p>
<p>With shy: extra­ordinary</p> soft hyphen
extraordinary
How It Works <wbr> wraps with no hyphen character.­ may show a hyphen at the end of the first line when it wraps.Both are invisible when the word still fits on one line.Pick by typography: URLs often prefer wbr; dictionary-style words may prefer soft hyphens. Edge Cases & Pitfalls Most wbr mistakes are treating it like br, expecting a hyphen, or putting it in the wrong place.
optional It does not always wrap If the container is wide enough, <wbr> does nothing visible. That is correct — it is only an opportunity.
hyphen No hyphen is inserted Need a hyphen on wrap? Use a soft hyphen (­), not <wbr>.
vs br Do not use wbr for poems Hard line structure belongs on <br> (or separate blocks). Keep wbr for optional mid-word wraps.
void No end tag Write <wbr> only. Closing tags or text content inside are invalid for this element.
Compatibility
Browser Support The <wbr> element is core HTML in every modern browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<wbr> Widely available since about July 2015 (and earlier in practice). Chrome, Firefox, Safari, Edge, and Opera support optional word-break opportunities.
97% Global support (approx.)
Google Chrome All modern
Full support
Mozilla Firefox All modern
Full support
Apple Safari All modern
Full support
Microsoft Edge All modern
Full support
Opera All modern
Full support
Samsung Internet All modern
Full support
Internet Explorer All
Supported <wbr> Widely supported
Bottom line: Safe for production. Pair with a narrow layout when testing, and choose soft hyphens when you need a visible hyphen on wrap.
Remember
Key Takeaways Role: <wbr> suggests an optional wrap point — it does not force a break.
Void: write <wbr> with no end tag and no content.
No hyphen: use ­ when a hyphen should appear on wrap.
Siblings: hard breaks → <br>; CSS wrapping → overflow-wrap / word-break.
One line: put <wbr> where a long word or URL may wrap — never for a required line break.
UA style
Default CSS Settings wbr has no meaningful visual box. Typical UA treatment is effectively empty:
wbr {
/* no visible styles — acts as a break opportunity */
} Styling the element itself rarely helps. Control wrapping with container width and, when needed, overflow-wrap , word-break , or hyphens .
Frequently Asked Questions What is the HTML wbr tag used for? The wbr element marks a word break opportunity — a place where the browser may wrap a line inside a long word or URL that would not normally break.
Does wbr force a line break? No. It only suggests an optional break. If the line still fits, nothing visible happens. Use br when you always want a hard break.
Does wbr insert a hyphen? No. A wrap at wbr does not add a hyphen. To show a hyphen only when a word wraps, use a soft hyphen (­) instead.
Is wbr a void element? Yes. It has a start tag and no end tag or content. In HTML write <wbr>. In XHTML write <wbr />.
Where should I put wbr in a URL? A common pattern is to allow breaks before punctuation (for example before . or /) so a trailing mark is less likely to look like the end of the URL.
Is the wbr tag deprecated? No. It is Baseline and widely available across modern browsers.
Next: xmp Learn about the obsolete xmp element and modern alternatives.
xmp tutorial → About the author Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
10 people found this page helpful
Helpful Share Copy link Suggestion