Skip to content
All referenceStructure

Markdown Hard Line Break

How to add a line break in markdown without starting a new paragraph. Two spaces, backslash, or HTML br tag methods explained.

What is markdown hard line break?

A hard line break forces the text to move to the next line without creating a new paragraph. In standard markdown, a single newline in the source does not create a visible line break — you need either two trailing spaces, a backslash, or an HTML <br> tag at the end of the line.

Syntax

Two trailing spaces

Add exactly two spaces at the end of a line, then press Enter. The spaces are invisible but force a line break.

Result
First line
Second line

Backslash (GFM)

A backslash at the end of a line creates a hard line break. Supported by GitHub Flavored Markdown.

Result
First line
Second line

HTML br tag

The HTML <br> element works on platforms that allow HTML in markdown.

Result
First line
Second line

Platform support

PlatformSupportedNotes
GitHubYesTwo spaces and backslash both work
GitLabYes
DiscordYesShift+Enter creates a line break in the UI
SlackYes
NotionYes
ObsidianYes

Common mistakes

Wrong
Line 1
Line 2 (single newline)
Right
Line 1  
Line 2 (two trailing spaces)

A single newline in markdown source is treated as a space, not a line break. You must use trailing spaces, backslash, or <br>.

Tips for hard line break

1Two spaces is invisible — use an editor that shows them

Trailing spaces are invisible in most editors. If you can't see them, use a backslash or <br> instead — they're explicit.

2For poems and addresses, use line breaks throughout

Content where every line matters (verse, addresses, lyrics) should use consistent line break syntax throughout rather than relying on paragraph breaks.

Frequently asked questions

Everything you need to know.

1

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

Markdown collapses single newlines into spaces. This allows text to flow naturally when source files are edited. For a visible line break, use two trailing spaces or a backslash at the end of the line.

Related elements

Try it in the editor

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