The two ways to break a line in HTML
To create a line break in HTML, use the <br> tag. This is a self-closing tag, meaning it does not need an opening and closing pair — you write it once and the browser moves the next content to a new line. The tag looks like this: <br> or <br /> (both work the same way).
The second method is to use block-level elements like <p> (paragraph), <div> (division), or <h1> through <h6> (headings). These automatically create space above and below the content, which pushes text onto new lines. The difference is that <br> creates a simple line break, while block elements add extra spacing and are meant for larger chunks of content.
Key Takeaways
- The <br> tag creates a single line break without adding extra space, and you can use it multiple times in a row.
- Block-level elements like <p> and <div> automatically create line breaks with spacing above and below, and are better for organizing content into sections.
- The <br> tag does not require a closing tag, though <br /> with a forward slash is also valid HTML.
- Using too many <br> tags to create spacing is considered poor practice — use CSS margin and padding instead for better control.
Using the <br> tag for simple line breaks
Place the <br> tag wherever you want the text to move to the next line. Here is an example:
<p>This is the first line.<br>This is the second line.</p>
When a browser displays this code, "This is the first line." appears on one line, and "This is the second line." appears directly below it with no extra space between them. The <br> tag only breaks the line — it does not add margins or padding.
You can use multiple <br> tags in a row to create larger gaps, though this is not recommended for professional work. If you need spacing, CSS is the better tool. The <br> tag works best for content that should stay together visually, like addresses or poetry where line breaks are part of the meaning.
Using block elements to organize content
Block-level elements like <p>, <div>, and headings create line breaks automatically because the browser treats them as separate sections. Each block starts on a new line and ends on a new line, with default spacing above and below.
Here is an example with paragraphs:
<p>This is the first paragraph.</p> <p>This is the second paragraph.</p>
The browser displays these with visible space between them — usually about 16 pixels by default, though this varies by browser. This spacing is built into the browser's default stylesheet and is called a margin. Block elements are the standard way to structure text content because they make the HTML easier to read and give you more control over how things look.
When to use <br> versus block elements
Use <br> when you need a line break within a single block of content, such as in an address or a list of items that should stay grouped together. For example, a mailing address looks better with <br> tags than with separate paragraphs:
<p>John Smith<br>123 Main Street<br>Springfield, IL 62701</p>
Use block elements like <p> or <div> when you are separating different sections of content. Paragraphs should contain complete thoughts, and divs should contain related groups of elements. This approach makes your HTML clearer and gives CSS more to work with when you want to style different sections differently.
A common mistake is using multiple <br> tags to create space between sections. This works visually but makes the HTML harder to maintain and harder to style later. If you need space between elements, use CSS margin or padding instead.
Common mistakes with line breaks
The most frequent error is forgetting that <br> does not add space — it only moves to the next line. If you write <br><br><br> to create a gap, you get three line breaks with no actual spacing, which looks inconsistent across different browsers and devices. Use CSS instead: set a margin on a paragraph or add padding to a div.
Another mistake is using <br> inside a heading or other block element when you actually want two separate headings. If you write <h1>Main Title<br>Subtitle</h1>, the subtitle is technically part of the same heading, which confuses screen readers and search engines. Use two separate headings instead: <h1>Main Title</h1><h2>Subtitle</h2>.
Do not use <br> to indent or align text. This was common in older HTML but does not work reliably. Use CSS text-align, margin, or padding to position content the way you want it.
Using CSS for better control over spacing
Once you understand line breaks, the next step is learning to control spacing with CSS. Instead of using multiple <br> tags, you can set margins and padding on elements to create the exact spacing you need.
For example, if you want extra space between two paragraphs, add a margin to the second paragraph:
<p>First paragraph.</p> <p style="margin-top: 30px;">Second paragraph with extra space above.</p>
This approach is cleaner, more flexible, and easier to change later. As you build more complex layouts, CSS becomes essential for controlling how content flows and spaces on the page.
Frequently Asked Questions
Do I need to write <br> or <br />?
Both work in modern HTML. The <br> form is simpler and is the standard in HTML5. The <br /> form with a forward slash comes from XHTML and older standards. Use whichever your team prefers — browsers treat them identically.
Can I use <br> inside a <p> tag?
Yes, <br> works inside paragraphs and is the correct way to break a line within a paragraph. Just remember that <br> only breaks the line — it does not add space. If you need space, use CSS margin on a separate paragraph instead.
What happens if I use <br> multiple times in a row?
The browser will create multiple line breaks, but they will appear as single-spaced lines with no visible gap between them. This looks inconsistent and is considered poor practice. Use CSS margin or padding to create intentional spacing instead.
Should I use <br> to separate navigation items or menu links?
No. Use a list element like <ul> or <ol> with <li> items, or use CSS flexbox or grid to arrange navigation. Lists are semantic (they tell the browser what the content means) and are much easier to style and maintain than <br> tags.
How do I create a line break in a form input field?
You cannot use <br> inside an input field — it does not work that way. If you need multiple lines of text input, use a <textarea> element instead. Users can press Enter inside a textarea to create line breaks, and the text will wrap automatically.