Use the <br> tag to create a line break in HTML
A line break in HTML is created with the <br> tag, which tells the browser to move text to the next line without starting a new paragraph. The tag is self-closing, meaning it has no opening and closing pair — you write it as <br> or <br />, and the browser understands it either way.
The <br> tag is useful when you need to break a line in the middle of text but don't want the extra spacing that comes with a paragraph tag. Common uses include formatting addresses, poetry, song lyrics, or any text where the line break itself carries meaning.
Key Takeaways
- The <br> tag creates a single line break without adding extra space between lines the way paragraphs do.
- Write <br> or <br /> — both versions work in modern browsers.
- Use <br> for content where the line break matters, like addresses or poetry, not for spacing between sections.
- Avoid stacking multiple <br> tags to create space — use CSS margins or padding instead.
Where to place the <br> tag in your code
Put the <br> tag directly in your HTML where you want the line to break. It goes inside whatever container holds your text — a paragraph, a div, a heading, or anywhere else text appears.
Here is a simple example with an address:
<p>123 Main Street<br>Springfield, IL 62701</p>
The browser will display this as:
123 Main StreetSpringfield, IL 62701
Notice that the text stays inside the same paragraph — there is no extra gap between the lines the way there would be if you used two separate <p> tags.
The difference between <br> and paragraph tags
The <br> tag and the <p> tag both move text to a new line, but they handle spacing differently. A paragraph tag adds margin above and below the text, creating visible space. A line break does not.
If you write:
<p>First line</p> <p>Second line</p>
The browser puts noticeable space between the two lines. If you write:
<p>First line<br>Second line</p>
The lines sit closer together with no extra gap. Use <br> when the lines belong together as one unit, and use separate paragraphs when they are distinct blocks of content.
Common mistakes with line breaks
The most common mistake is using multiple <br> tags to create space between sections. Writing <br><br><br> might look right in the browser, but it is fragile — if you change the text or the screen size, the spacing breaks. CSS is the proper tool for spacing.
Another mistake is forgetting that <br> is self-closing. You do not need a closing tag like </br>. The tag <br> alone is complete.
A third issue is using <br> for layout. If you are trying to position elements on the page or create columns, CSS flexbox or grid will work better and be easier to maintain. Line breaks are for breaking lines of text, not for designing page structure.
When to use <br> and when to use something else
Use <br> for content where the line break is part of the meaning: mailing addresses, poetry, song lyrics, or any text formatted in a specific way. The break itself carries information.
Use separate <p> tags for distinct paragraphs or sections of text. Use <div> or other container tags when you need to group content for styling or layout. Use CSS margins and padding when you need to control space between elements.
If you find yourself writing many <br> tags in a row, stop and think about whether you should be using a different approach. Line breaks are a small, specific tool — not a solution for spacing or layout.
How <br> renders across different browsers and devices
The <br> tag works the same way in every modern browser — Chrome, Firefox, Safari, Edge, and others all handle it identically. It creates a single line break with no extra space, and that behavior is consistent.
On mobile devices, <br> works the same as on desktop. The line break happens at the tag, regardless of screen size. If you are concerned about how your text flows on narrow screens, use CSS media queries to adjust your layout, not extra <br> tags.
Frequently Asked Questions
Can I use <br> inside a heading tag?
Yes. You can put <br> inside any tag that contains text, including headings. Write <h2>First Line<br>Second Line</h2> and the heading will break across two lines with no extra space between them.
What is the difference between <br> and <br />?
There is no practical difference in modern browsers. <br> is the HTML5 standard, and <br /> is the older XHTML style. Both work fine. Use <br> unless you are working with older code that uses the slash version.
Should I use CSS instead of <br> tags?
It depends on why you need the break. If the break is part of the content itself — like an address or poem — use <br>. If you are trying to create space or control layout, use CSS. Mixing the two approaches makes your code harder to maintain.
Can I style a line break with CSS?
You cannot style the <br> tag itself directly in a meaningful way. You can style the text around it by styling the parent element. If you need more control over spacing or appearance, consider using a different HTML structure with CSS instead.