HTML <wbr> Tag

Beginner
6 min read
Updated: Nov 2026
4 examples
Live preview

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 (&shy;).

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.

HTML Syntax

syntax.html
long <wbr>word

In HTML5, write <wbr>. In XHTML, self-close as <wbr />. Never write <wbr></wbr>. Place it between parts of the word or URL.

Attributes

<wbr> has no element-specific attributes — only globals. Compare related ways to control wrapping:

OptionDescriptionTry it
<wbr>Optional break opportunity; no hyphen when it wrapsTry it
<br>Always inserts a hard line breakTry it
&shy;Optional break that shows a hyphen when the line wrapsTry it
overflow-wrapCSS way to allow wrapping long unbroken stringsSee CSS tutorial

Global Attributes

The <wbr> tag also supports the Global Attributes in HTML.

Live Preview

Compare no break hints, <wbr>, and a soft hyphen. Drag the dashed box wider or narrower to force wrapping.

break style

Resize the box horizontally. <wbr> wraps without a hyphen; &shy; can show one.

Narrow column

Fernstraßenbauprivatfinanzierungsgesetz

<wbr> between word parts

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Long Compound Word

Suggest wrap points inside a word that has no spaces.

HTML
<p>
  Fernstraßen<wbr>bau<wbr>privat<wbr>finanzierungs<wbr>gesetz
</p>
Try It Yourself

How It Works

  1. Find natural parts of the long word (here syllable-like chunks).
  2. Insert <wbr> between those parts.
  3. If the line is wide enough, the word still appears unbroken.
  4. 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.

HTML
<p>
  https://www<wbr>.example<wbr>.com<wbr>/docs<wbr>/guide
</p>
Try It Yourself

How It Works

  1. Write the full URL as normal text (or inside a link).
  2. Place <wbr> before . or / where a wrap is OK.
  3. On a narrow line, the URL can continue on the next line.
  4. 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.

HTML
<p>Optional: super<wbr>califragilistic</p>
<p>Always:<br>Line two</p>
Try It Yourself

How It Works

  1. <wbr> only wraps when space runs out.
  2. <br> always starts a new line.
  3. Poems and addresses usually need br.
  4. Long tokens in a paragraph usually need wbr (or CSS wrapping).

Example 4 — wbr vs Soft Hyphen

Choose wbr for a clean wrap, or &shy; when a hyphen should appear.

HTML
<p>With wbr: extra<wbr>ordinary</p>
<p>With shy: extra&shy;ordinary</p>
Try It Yourself

How It Works

  1. <wbr> wraps with no hyphen character.
  2. &shy; may show a hyphen at the end of the first line when it wraps.
  3. Both are invisible when the word still fits on one line.
  4. 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 (&shy;), 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.

css

CSS may still help

For many long strings, overflow-wrap or word-break can complement or replace manual wbr marks.

void

No end tag

Write <wbr> only. Closing tags or text content inside are invalid for this element.

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.

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 &shy; 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.

Default CSS Settings

wbr has no meaningful visual box. Typical UA treatment is effectively empty:

default.css
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

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.
No. It only suggests an optional break. If the line still fits, nothing visible happens. Use br when you always want a hard break.
No. A wrap at wbr does not add a hyphen. To show a hyphen only when a word wraps, use a soft hyphen (&shy;) instead.
Yes. It has a start tag and no end tag or content. In HTML write <wbr>. In XHTML write <wbr />.
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.
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

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.

10 people found this page helpful