Markdown Line Break: 4 Methods That Work

Why pressing Enter doesn’t create a new line — and what to do instead

The Problem: Markdown Ignores Single Line Breaks

If you press Enter once between two lines of text, Markdown joins them into a single paragraph. This surprises almost everyone the first time.

First line. Second line.

First line.
Second line.

The rendered output shows First line. Second line. on a single line. This is by design — Markdown lets you wrap long paragraphs in your source without affecting the output. To force a new line, you need one of the four methods below.

Method 1 — Two Trailing Spaces

Add two spaces at the end of a line. Markdown renders this as a <br> in the output (a “soft return”).

First line.
Second line.

First line.··
Second line.

The ·· above represents two space characters. In your actual file they are invisible.

Downsides:

  • Invisible in the source — impossible to tell if they are there by looking
  • Many editors and linters strip trailing whitespace on save
  • Git diffs don’t show trailing spaces clearly

Because of these issues, many style guides discourage trailing spaces in favor of the backslash method.

Method 2 — Backslash

Place a backslash (\) at the end of the line. This is the CommonMark way to create a hard line break.

First line.
Second line.

First line.\
Second line.

Advantages over trailing spaces:

  • Visible in the source — you can see exactly where line breaks are
  • Won’t be stripped by editors or linters
  • Shows clearly in diffs and code reviews

Works in CommonMark, GitHub Flavored Markdown (GFM), and most modern renderers. Some older parsers may not support it.

Method 3 — HTML <br> Tag

Insert a <br> tag directly in your Markdown. This produces the same result as the methods above but works in virtually every renderer.

First line.
Second line.

First line.<br>
Second line.

<br> is the most portable option. It works on GitHub, GitLab, Slack, Discord, Reddit, and every Markdown viewer. The trade-off is that it mixes HTML into your Markdown source.

Method 4 — Blank Line (New Paragraph)

Leave an empty line between two blocks of text. This creates a new paragraph rather than a line break — the vertical spacing is larger.

First paragraph.

Second paragraph.

First paragraph.

Second paragraph.

A blank line wraps each block in its own <p> tag. Use this when you want clear separation between ideas, not when you need lines to sit close together (like an address or a poem).

Line Break vs. Paragraph

The difference is subtle but important. A line break (<br>) keeps text inside the same paragraph. A blank line starts a new paragraph with more vertical space.

TypeMarkdownHTML outputSpacing
Line breakLine 1\↵Line 2<p>Line 1<br>Line 2</p>Tight
ParagraphLine 1↵↵Line 2<p>Line 1</p><p>Line 2</p>Wide

Use a line break for addresses, poetry, lyrics, or any text where lines belong together. Use a paragraph break for distinct ideas or sections.

Platform Comparison

Not every method works on every platform. Here is what each renderer supports:

PlatformTwo spacesBackslash \<br>Blank line
GitHub
GitLab
VS Code
Obsidian
MDViewer
Slack
Discord
Reddit

Slack and Discord use their own Markdown variants and do not support soft line breaks at all — press Shift+Enter for a new line in those apps. Reddit supports trailing spaces and <br> but not backslash breaks.

Common Mistakes

“My line breaks don’t work” — this is almost always one of these issues:

  • Missing trailing spaces: You pressed Enter but didn’t add two spaces before it. Single Enter = no break
  • Editor strips trailing whitespace: Many editors (VS Code, Sublime Text, JetBrains IDEs) remove trailing spaces on save. Check your editor settings or switch to the backslash method
  • Using backslash on an older parser: The \ method requires CommonMark support. If your renderer is based on the original Markdown spec, it won’t work — use two trailing spaces or <br> instead
  • Expecting multiple blank lines to add more space: Markdown collapses consecutive blank lines into a single paragraph break. Use <br><br> if you need extra vertical space
  • Confusing carriage return with line break: On Windows, line endings are \r\n (carriage return + line feed). Markdown treats these the same as \n — they still get collapsed. The fix is the same: use one of the four methods above

FAQ

Why doesn’t Enter create a new line in Markdown?

Markdown treats a single line break as a space, not a new line. This is by design — it lets you wrap long paragraphs in your editor without affecting the rendered output. To force a visible line break, add two trailing spaces, a backslash (\), or an HTML <br> tag at the end of the line.

What is the best way to add a line break in Markdown?

For most situations, the backslash method (\) is the best choice. It is visible in the source, works in CommonMark and GitHub Flavored Markdown, and won’t be stripped by editors. If you need maximum portability across platforms like Slack or Reddit, use an HTML <br> tag instead.

How do I add multiple blank lines in Markdown?

Standard Markdown collapses consecutive blank lines into a single paragraph break. To force extra vertical space, use multiple <br> tags on separate lines, or add a line containing only &nbsp; (a non-breaking space) between paragraphs. Note that some renderers may still collapse the extra spacing.

Preview Your Markdown with MDViewer

MDViewer is a native macOS viewer that renders Markdown instantly — including line breaks, tables, Mermaid diagrams, and all standard formatting. Open any .md file from Finder and see exactly how your line breaks render.

Download MDViewer

Requires macOS 13.0 or later. Intel and Apple Silicon.