← Back to blog/Guides

Markdown Line Breaks: Newlines, Paragraphs, and HTML

Choose between a soft newline, a hard line break, and a new paragraph, with visible whitespace examples and renderer-specific fixes.

F
Faizan Khan
• 5 min read

For a Markdown line break within a paragraph, end the line with two spaces or a backslash, then press Enter. To start a new paragraph, leave an empty line instead. Pressing Enter once without either marker creates a soft line break, which often displays as ordinary spacing rather than a visible new line.

The backslash form makes the break easy to see in source:

Markdown
1Delivery window:\
2Monday through Friday
HTML
1<p>Delivery window:<br />
2Monday through Friday</p>

Pick the structure before the syntax

NeedWriteExpected structure
Wrap a long source line for editingA single newlineOne paragraph with a soft break
Keep two lines in the same paragraphTwo trailing spaces or a backslash before the newlineOne paragraph containing br
Begin a separate thoughtA blank lineTwo p elements
Show text exactly as typedA fenced code blockA pre and code block

These are different document structures, not interchangeable spacing tricks. A list of instructions should usually be a Markdown list, not a paragraph with a break after every sentence.

The CommonMark hard-break rules specify both the two-space and backslash forms. A renderer can choose how it displays soft breaks, so preview the actual publication surface.

Two trailing spaces: valid but easy to lose

This example has two real spaces after the colon:

Markdown
1Delivery window:
2Monday through Friday

It produces the same hard-break structure as the backslash example. In a whitespace inspector, the first line would look like Delivery window:··, with dots representing spaces. Do not type those dots into the document.

This spelling is convenient until an editor trims trailing whitespace on save. A cleanup step can silently change the meaning while leaving the source looking almost identical. When authors report that breaks disappear after formatting or saving, check that setting before blaming the Markdown renderer.

Choose a backslash when a visible source marker is more important than the two-space convention. Neither method should be used to force a fixed line length for ordinary prose: the browser needs to wrap text for narrow screens and larger text settings.

A blank line starts a paragraph

Markdown
1The first attempt timed out.
2
3Retry after checking the connection.
HTML
1<p>The first attempt timed out.</p>
2<p>Retry after checking the connection.</p>

The vertical distance between those paragraphs comes from CSS. Adding five empty source lines does not reliably create five times the space. If an article needs more visual separation, choose an appropriate heading or a thematic break rather than stacking empty lines.

For an address, a short verse, or a label-value pair where the line grouping matters, hard breaks can be appropriate. For two independent troubleshooting instructions, separate paragraphs communicate the structure better.

When to use an HTML break

Some renderers permit raw HTML:

HTML
1Primary region: North<br />Secondary region: West

This can be useful inside a GFM table cell where a literal newline would terminate the row. It depends on the platform allowing the tag. It is not a universal escape hatch for every Markdown field.

MDX uses JSX rules, so the self-closing <br /> form is the safe spelling there. By contrast, ordinary HTML also permits <br>. Keep the distinction explicit when moving content between a README and an MDX documentation site.

Do not use repeated breaks to build columns, align values, or simulate a table. Those layouts can fall apart when text wraps, and they do not express relationships as clearly as a real list or table.

Preserve breaks inside a numbered step

Align the continuation line with the item's text:

Markdown
11. Enter the delivery address:\
2 Building 4, receiving desk
32. Confirm the recipient.

The first item contains one paragraph with a hard break. If the extra line should be a second paragraph in the same step, add a blank line and retain the indentation:

Markdown
11. Enter the delivery address.
2
3 Use the receiving desk rather than the billing office.
42. Confirm the recipient.

The blank line may make the list appear more spacious because its items now contain paragraph blocks. Removing all blank lines just to tighten the layout can erase useful structure; check whether the theme needs a spacing change instead.

Why the same source behaves differently on GitHub

GitHub distinguishes writing surfaces. Its line-break documentation explains that line-break behavior in issues and discussions differs from .md files. A single Enter that appears to work in a comment is not proof that a README will render the same way.

Test this small fixture in the destination:

Markdown
1Soft first line
2Soft second line
3
4Hard first line\
5Hard second line
6
7Separate paragraph

Inspect the paragraph boundaries and the visible break, not just whether the page looks acceptable at one window width. Code blocks are another special case: they preserve newlines without interpreting the hard-break markers. A backslash inside a code block is an actual backslash in the sample.

FAQ

Why does Enter not create a new line in Markdown?

A single unmarked newline is normally a soft break within one paragraph. Use a backslash or two trailing spaces before the newline when you need a hard break.

Is a blank line the same as a line break?

No. A blank line separates paragraphs. A hard line break keeps the text in one paragraph and inserts a break within it.

Why do my two-space line breaks disappear?

Your editor or formatter may remove trailing spaces. Inspect the saved source and use the visible backslash form if the destination supports CommonMark hard breaks.

Continue This Guide