Skip to main content
HomeBlogHow to Add a Line Break in Markdown (and Start a New Paragraph)

How to Add a Line Break in Markdown (and Start a New Paragraph)

Add Markdown line breaks with two trailing spaces or a backslash. Compare paragraphs, HTML breaks, and GitHub README versus comment behavior.

Published:

Why the markdown line break trips everyone up

If you've ever hit Enter in a Markdown file expecting a new line — only to see your text run together on one line in the preview — you've hit the most common Markdown gotcha there is. Unlike a Word document, Markdown doesn't treat every newline as a line break. A single newline is usually collapsed into a space, so "pressing Enter once" does almost nothing visually.

That's why the markdown line break deserves its own guide. Once you understand the difference between a soft line break, a hard line break, and a new paragraph, everything clicks. Below is every way to create a new line in markdown, with copy-paste examples you can try in our online Markdown viewer as you read. New to the syntax overall? Skim the Markdown cheat sheet first.

How Markdown treats a single newline (the "soft wrap")

CommonMark treats a single newline within a paragraph as a soft line break. It may render that break as a newline or a space in the HTML source; normal browser whitespace handling displays the text as one flowing paragraph. CommonMark is a later specification that clarifies Markdown behavior, not the original 2004 Markdown description.

This is line one.
This is line two.

Renders as:

This is line one. This is line two.

Both source lines become a single flowing paragraph. This soft line break (or "soft wrap") is great for keeping your source readable on narrow screens without affecting the output — but if you genuinely wanted those on separate lines, you need a hard line break. This collapsing is the default across nearly every Markdown engine, including the rendering core of what Markdown actually is.

Hard line break with two trailing spaces

The classic way to force a markdown line break is to end the line with two or more spaces before pressing Enter. A tab is not a substitute for those two trailing spaces. The CommonMark hard line break rules describe both the space and backslash forms.

First line··
Second line

Here ·· represents the two invisible spaces — in a real file you'd just type two spaces and see nothing. The result:

First line
Second line

A single line break, no paragraph gap — perfect for addresses, short verses of poetry, or signature blocks.

The catch: the spaces are invisible, which makes them easy to lose when editing or copy-pasting. To verify they exist:

  • In VS Code, enable "Render Whitespace" (View → Appearance → Render Whitespace). Trailing spaces show as faint dots.
  • In a terminal, run cat -A yourfile.md — line ends print as $ (spaces before the $).
  • In our editor, the live preview updates instantly, so add the spaces and watch the break appear.

The backslash line break (\)

CommonMark (and most GFM-compatible renderers) also supports a backslash at the end of a line as a hard line break. This is visible, which solves the invisible-trailing-spaces problem entirely:

First line\
Second line

Renders identically to the two-space version:

First line
Second line

The backslash escapes the newline itself — and because you can see it, it's a popular choice for poetry or addresses. Just remember the \ must be the very last character on the line; anything after it (even a stray space) breaks the effect. The GitHub Flavored Markdown guide lists which engines support this.

The <br> HTML tag

Because Markdown lets inline HTML pass through, you can drop a literal <br> (or <br/>) wherever you need a break:

First line<br>
Second line

A renderer that permits the <br> element can use it for a break inside a list item or table cell:

| Field | Value |
|-------|-------|
| Address | 123 Main St<br>Springfield, USA |

The trade-off: some environments strip raw HTML. The MD File Viewer editor currently removes user-supplied HTML tags, including <br>, so use two trailing spaces or a backslash for paragraph line breaks here. Test HTML-based table-cell breaks at your publishing destination.

New paragraph (the blank-line method)

A line break keeps text in the same paragraph. To start a genuinely new paragraph, separate the blocks with a blank line (two newlines in a row):

First paragraph of text.

Second paragraph of text.

Renders as two distinct paragraphs with vertical space between them:

First paragraph of text.

Second paragraph of text.

One newline = same line. Two spaces + Enter, \, or <br> = same paragraph, new line. Blank line = new paragraph. That's the whole mental model.

Why GitHub comments and README files behave differently

Some applications turn every newline into a visible break. GitHub does this in issues, pull requests, and discussions, but not in repository .md files. The GitHub line break documentation explicitly distinguishes these contexts. GFM support alone does not imply that every newline becomes a hard break.

When active:

First line
Second line

Renders as two lines, no trailing spaces required:

First line
Second line

This is convenient for comments, but a line break copied from a GitHub discussion may disappear in a README. For files that move between tools, use an explicit hard break where it matters. The editor follows normal Markdown soft-break behavior; it does not automatically convert every Enter into a hard break.

Quick reference table

Goal Syntax Result
Same line (soft wrap) Single Enter Lines joined with a space
Hard line break Two trailing spaces + Enter New line, same paragraph
Hard line break (visible) \ + Enter New line, same paragraph
Hard line break (HTML) <br> New line, same paragraph
New paragraph Blank line between blocks New block with vertical gap
Auto-break every newline Application-specific option or comment behavior Every Enter becomes a break when enabled

Common mistakes to avoid

1. Invisible trailing spaces that vanish on save. Editors and formatters sometimes strip trailing whitespace. If breaks work one minute and fail the next, switch to the backslash (\) or <br> to make the intent visible and survive auto-formatting.

2. Confusing a line break with a paragraph. Unwanted vertical gaps mean you've used a blank line where you meant to use trailing spaces or \. Break = same paragraph; blank line = new paragraph.

3. Backslash not at the end of the line. A trailing space after \ silently disables the break. First line\ (note the space) renders on one line. Delete the space.

4. Mixing breaks inside blockquotes or lists. Inside a Markdown blockquote or list item, the rules shift with indentation and renderer. When in doubt, use <br> explicitly, or test in our editor.

5. Assuming every GitHub surface behaves the same. A single newline in a GitHub comment can appear as a break while the same source in a README remains one paragraph.

Frequently Asked Questions

How do I add a single line break in Markdown?

End the line with two trailing spaces (invisible) or a backslash (\), then press Enter. Both produce a hard line break — a new line without a paragraph gap. Many writers prefer the backslash for visibility.

What's the difference between a line break and a new paragraph?

A line break starts a new line within the same paragraph (no vertical space). A new paragraph starts a fresh block with vertical space. You get a break with two spaces + Enter, \, or <br>; you get a paragraph with a blank line.

Why are my Markdown newlines not showing up?

Because plain Markdown collapses single newlines into spaces. You need an explicit hard line break: two trailing spaces, a backslash, or <br>. Your renderer may also support breaks: true to auto-convert every newline. Enable whitespace rendering in your editor to confirm trailing spaces are present.

Does GitHub Flavored Markdown treat single newlines as line breaks?

Not as a general rule. GitHub issues, pull requests, and discussions automatically display single newlines as breaks. Repository .md files require two trailing spaces, a backslash, or a permitted <br> tag for an explicit break.

Wrapping up

The markdown line break comes down to one decision: a new line inside the same paragraph, or a brand-new paragraph? For a break, use two trailing spaces, a backslash, or <br>. For a paragraph, leave a blank line. Pick the method that's visible and survives formatting in your editor — then paste it into our online Markdown viewer to confirm it renders exactly the way you want before you publish.

If you need a visible divider between sections rather than a new text line, see the Markdown horizontal line guide.

Try it in your browser

Open the homepage editor to view, edit, and export Markdown instantly — no install required.

More articles

How to Add a Line Break in Markdown (and Start a New Paragraph) | MD File Viewer