HTML <br> Tag

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The <br> element produces a line break in text (a carriage return). Use it when the split between lines matters — poems, lyrics, or postal addresses.

It is a void element: start tag only, no content, no end tag. Do not use <br> to create space between paragraphs — wrap text in <p> and control gaps with CSS margin. For optional breaks inside long words, see <wbr>.

Baseline · Widely available.

Not deprecated as an element. Stable across modern browsers since about July 2015.

Deprecated: clear.

Do not use the old clear attribute on <br>. Control layout with CSS instead of presentational break attributes.

HTML Syntax

syntax.html
<br> or <br /> (XHTML)

In HTML5, write <br>. In XHTML, self-close as <br />. Never write <br></br>.

Attributes

<br> has no useful modern element-specific attributes. Prefer globals only; avoid deprecated clear.

AttributeDescriptionTry it
(none required)A bare <br> inserts one hard line breakTry it
clearDeprecated — once controlled the next line after floats; do not useAvoid
Use <p> insteadSeparate paragraphs with p + CSS margin, not stacked brTry it
<wbr>Optional break opportunity inside a long word or URLTry it

Global Attributes

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

Live Preview

Switch examples to see where <br> belongs — and where <p> is better.

Live text with or without <br>. Prefer <p> for separate paragraphs.

Preview

O’er all the hilltops
Is quiet now,
In all the treetops
Hearest thou

Poem lines — br is appropriate.

HTML Examples

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

Example 1 — Poem Line Breaks

Place <br> where each verse line should end.

HTML
<p>
  O’er all the hilltops<br>
  Is quiet now,<br>
  In all the treetops<br>
  Hearest thou<br>
  Hardly a breath;
</p>
Try It Yourself

How It Works

  1. Keep one paragraph for the poem stanza if it is one unit.
  2. Insert <br> after each line that must break.
  3. Continue the next line immediately after the break.
  4. Do not close br — it is a void element.

Example 2 — Postal Address Lines

Break each address line without creating separate paragraphs.

HTML
<address>
  Example Org<br>
  331 E. Evelyn Avenue<br>
  Mountain View, CA<br>
  94041<br>
  USA
</address>
Try It Yourself

How It Works

  1. Wrap contact text in <address> when it is contact info.
  2. Add <br> after each postal line.
  3. Keep one contact block instead of many empty paragraphs.
  4. Line meaning stays intact for printing and reading.

Example 3 — Prefer p for Paragraphs

Do not stack br to fake paragraph gaps. Use real paragraphs.

HTML
<!-- Avoid -->
<p>First idea.<br><br>Second idea.</p>

<!-- Prefer -->
<p>First idea.</p>
<p>Second idea.</p>
Try It Yourself

How It Works

  1. See the anti-pattern: double <br> only adds empty lines.
  2. Use two <p> elements for two ideas.
  3. Space with CSS margin on paragraphs when needed.
  4. Better for accessibility — screen readers get real paragraph structure.

Edge Cases & Pitfalls

Most br problems come from using it as a spacing tool instead of a meaningful line break.

a11y

Do not fake paragraphs with br

Screen readers may announce breaks awkwardly. Real <p> elements are clearer.

CSS

Avoid margin on br

MDN: use line-height for line spacing, not margins on break tags.

syntax

No closing tag

<br></br> is invalid. Use <br> (or <br /> in XHTML).

deprecated

Skip clear

The clear attribute is obsolete. Clear floats with CSS.

vs wbr

Hard break vs optional break

br always breaks. wbr only suggests a break if needed.

Browser Support

The <br> element is core HTML in every browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<br>

Widely available since about July 2015. Line breaks work everywhere; deprecated clear should be ignored in new work.

99% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer All
Supported
<br> Widely supported

Bottom line: Safe everywhere for meaningful line breaks. Use p + CSS for paragraph spacing.

Key Takeaways

  • Role: <br> inserts a hard line break where line splits matter.
  • Void: write <br> — no end tag, no content.
  • Not for spacing: use <p> + CSS margin between paragraphs.
  • Deprecated: never use clear on br.

One line: use <br> for meaningful line ends — not as a paragraph spacer.

Default CSS Settings

<br> has no box of its own. Typical UA behavior is simply a forced line break:

default.css
br {
  /* Void line-break; no width/height of its own */
  display: inline; /* effectively forces a new line in text */
}

/* Prefer this for spacing between lines of text: */
p {
  line-height: 1.5;
}

Do not rely on styling br for layout. Style the surrounding text instead.

Frequently Asked Questions

The br element inserts a line break in text where the line split matters — for example lines of a poem or a postal address.
Yes. It has a start tag and no end tag. In HTML write <br>. In XHTML write <br />.
No. Wrap paragraphs in p elements and control spacing with CSS margin. Using br for that is bad practice and harder for screen reader users.
clear is deprecated. It once controlled where the next line began after floated content. Do not use it in new pages.
br has almost no visual box of its own. Do not use margin on br to fake line spacing — use line-height on the text block instead.
Use wbr for an optional word-break opportunity inside a long word or URL. Use br when you always want a hard line break.

Next: button

Create clickable actions with the HTML button element.

button 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.

9 people found this page helpful