Skip to content
All referenceStructure

Markdown Line Break

Learn how to create line breaks in markdown using trailing spaces or backslashes. The difference between line breaks and paragraphs.

What is markdown line break?

In markdown, pressing Enter once doesn't create a visible line break — the text continues on the same line. To force a line break (without starting a new paragraph), end the line with two spaces or a backslash (\).

Syntax

Trailing spaces

Two spaces at the end of a line force a line break. (Spaces shown as visible here but are invisible in practice.)

Result
First line
Second line

Backslash

A backslash at the end of the line also forces a break. More visible than trailing spaces.

Result
First line
Second line

Paragraph (double newline)

A blank line creates a new paragraph with more vertical spacing than a line break.

Result

Paragraph one

Paragraph two

Platform support

PlatformSupportedNotes
GitHubYesBoth trailing spaces and backslash work
GitLabYes
DiscordYesRegular Enter creates a line break
SlackYesShift+Enter for line break
RedditYesDouble space or double newline
Stack OverflowYes
NotionYesShift+Enter for line break
ObsidianYes

Common mistakes

Wrong
Line one
Line two
Right
Line one  
Line two

A single newline in markdown source is ignored — the text joins into one line. Add two trailing spaces or use a backslash.

Wrong
Line one<br>Line two
Right
Line one  
Line two

While <br> HTML works on some platforms, it's not valid in all markdown renderers. Use trailing spaces or backslash instead.

Tips for line break

1Prefer backslash over spaces

Trailing spaces are invisible and often stripped by editors. A backslash (\) at end of line is more reliable and visible.

2Line break vs paragraph

A line break (two spaces + Enter) gives a small break. A paragraph (blank line) gives a larger gap. Use paragraphs for separate ideas.

3Configure your editor

Many code editors strip trailing whitespace. If using the two-space method, add an exception for .md files.

Frequently asked questions

Everything you need to know.

1

Why doesn't pressing Enter create a new line in markdown?

By design, markdown treats single newlines as spaces — text flows into one paragraph. For a hard line break, end the line with two spaces or a backslash.

Related elements

Try it in the editor

Paste your markdown and see line break rendered instantly with professional themes.