How to Add Line Breaks in Markdown

To force a line break in Markdown, end the line with two spaces and press Enter, or use the HTML <br> tag. A single Enter is usually not enough — most renderers join consecutive lines into one flowing paragraph.

Platform Support

GitHubsupportedGitLabsupportedObsidiansupportedDiscordnot supportedSlacknot supportedNotionsupported

Markdown has three ways to produce a hard line break, and all render the same <br> element. The classic form is two trailing spaces at the end of a line — invisible in the source, which is both its charm and its curse. The explicit form is a literal <br> tag, which works anywhere raw HTML is allowed. The third, added by CommonMark, is a backslash at the very end of the line — visible, unambiguous, and the least known of the three. Keep all of them distinct from a paragraph break: a blank line between blocks creates separate <p> elements with vertical spacing, while a line break keeps consecutive lines inside one paragraph — the right tool for addresses, poetry, and song lyrics.

The two-trailing-spaces form has a famous failure mode: editors delete it. VS Code's "trim trailing whitespace" setting, EditorConfig's trim_trailing_whitespace rule, linters, and pre-commit hooks all strip whitespace from line ends on save or commit — and your line breaks silently vanish with it. Because the marker is invisible, the breakage is hard to diagnose: the source looks identical before and after. This is why many style guides ban trailing-space breaks in committed files and standardize on <br> or the trailing backslash, both of which survive automated formatting.

What a single newline does depends heavily on context, even within one platform. In rendered .md files — READMEs, docs sites, anything processed as a document — a lone newline is a soft break: the lines join into one paragraph with a space between them. But GitHub treats comments, issue bodies, and pull request descriptions like chat, rendering every single newline as a hard break. The same text pasted into a README and an issue renders differently, which confuses people in both directions. Obsidian sits in the middle with a "strict line breaks" setting that toggles between the two behaviors. When line layout matters, test in the destination context rather than assuming.

A final note on what line breaks cannot do: create empty vertical space. Stacking three blank lines between paragraphs collapses into a single paragraph break — Markdown normalizes consecutive blank lines. If you genuinely need extra spacing, repeated <br> tags work where HTML is allowed, but the need is often a signal to restructure: a horizontal rule for a thematic break, a heading for a new section, or a list instead of break-separated lines. The one place where <br> is irreplaceable is inside table cells, where neither trailing spaces nor blank lines can work because a cell must stay on one source line.

Examples

Line Break
Markdown
First line
Second line
Output

First line
Second line

Create a line break by ending a line with two spaces.

Backslash at the end of a line
Markdown
The first line\
The second line
Output

The first line
The second line

CommonMark treats a trailing backslash as a hard break — and unlike trailing spaces, you can see it.

Explicit <br> tag
Markdown
The first line<br>The second line
Output

The first line
The second line

Works anywhere raw HTML is allowed, and survives editors that trim trailing whitespace.

Line break vs paragraph break
Markdown
Same paragraph, new line.<br>Still the same paragraph.

A blank line starts a new paragraph with extra spacing.
Output

Same paragraph, new line.
Still the same paragraph.

A blank line starts a new paragraph with extra spacing.

Common Mistakes

Wrong
Pressing Enter once and expecting a new line
Right
End the line with two spaces, a backslash, or <br>

In rendered Markdown documents a single newline is a soft break — the lines join into one paragraph with a space between them.

Wrong
Two trailing spaces in a repo that trims whitespace on save
Right
Use <br> or a trailing backslash in committed files

Editors, linters, and pre-commit hooks silently strip trailing whitespace, deleting invisible two-space breaks. The visible alternatives survive formatting.

Wrong
Stacking blank lines to add vertical space
Right
Use repeated <br> tags where HTML is allowed

Consecutive blank lines collapse into a single paragraph break — extra empty lines in the source change nothing in the output.

Platform Notes

GitHub

Context-dependent: comments, issues, and PR descriptions render single newlines as hard breaks, but rendered .md files treat them as soft breaks that join lines. Two spaces, a trailing backslash, and <br> all work in files.

Obsidian

By default a single newline renders as a line break. Enabling "Strict line breaks" in settings switches to CommonMark behavior, where single newlines join into one paragraph.

Discord

Every newline you type (Shift+Enter) is preserved as a break in the message — trailing-space syntax is irrelevant in chat.

Slack

Same as Discord: Shift+Enter inserts literal new lines, and Markdown break syntax does not apply to messages.

Frequently Asked Questions

How do I go to a new line in Markdown?

End the line with two spaces, a single backslash, or a <br> tag, then continue on the next line. A blank line creates a new paragraph instead of a line break.

What is the difference between a line break and a paragraph break?

A line break (<br>) starts a new line inside the same paragraph with no extra spacing. A paragraph break — one blank line — creates a separate <p> block with vertical space above it.

Why do my line breaks disappear when I save the file?

Your editor is trimming trailing whitespace, which deletes the invisible two-space markers. Switch to <br> tags or trailing backslashes, which survive automated formatting.

Why do single newlines work in GitHub comments but not in my README?

GitHub renders comments and issues chat-style, turning every newline into a hard break. Rendered .md files follow CommonMark, where single newlines are soft breaks that join lines.

How do I add a line break inside a table cell?

Use <br> — it is the only option, because a table cell must stay on one source line, ruling out trailing spaces and blank lines.

Related Syntax

Related Tools