Line Breaks and New Lines in Markdown
Markdown joins lines that sit next to each other into one paragraph. End a line with a backslash to break it there, or leave a blank line to start a new paragraph.
Quick answer
How do you add a new line in Markdown?
End the line with a backslash \ and continue on the next line. Two spaces at the end of the line do the same, and <br> works wherever HTML is allowed. A single line break on its own is shown as a space; a blank line starts a new paragraph.
Roses are red,\
violets are blue.
A blank line starts a new paragraph.Result
Roses are red,
violets are blue.
A blank line starts a new paragraph.
Line break syntax and examples
There are three ways to break a line inside a paragraph, and one to start a new paragraph.
A single line break is joined
Lines next to each other become one paragraph, with a space where the break was. This lets you wrap long lines in the source.
Roses are red,
violets are blue.Result
Roses are red, violets are blue.
Backslash at the end of a line
A backslash right before the line end forces a break. It is visible in the source, so editors do not strip it.
Roses are red,\
violets are blue.Result
Roses are red,
violets are blue.
Two spaces at the end of a line
Two or more spaces before the line end also force a break. Here they follow the comma; they are invisible, and many editors remove them on save.
Roses are red,
violets are blue.Result
Roses are red,
violets are blue.
The <br> tag
Where HTML is allowed, <br> breaks a line anywhere, including inside a table cell.
Line one<br>line two
| Address |
| --- |
| 1 Main Street<br>Springfield |Result
Line one
line two
| Address |
|---|
| 1 Main Street Springfield |
A new paragraph
A blank line starts a new paragraph, with more space than a line break.
First paragraph.
Second paragraph.Result
First paragraph.
Second paragraph.
Extra space between paragraphs
Several blank lines count as one. To add more space, put or <br> on a line of its own.
Three blank lines follow.
They left a single gap.
The line with ` ` above adds a visible gap.Result
Three blank lines follow.
They left a single gap.
The line with above adds a visible gap.
Line breaks in popular apps
Some apps show every line break as typed. Others follow the Markdown rule and join lines.
| App | Support | Notes |
|---|---|---|
| GitHub | Differs | Issues, pull requests and comments keep every line break; Markdown files need a backslash, two spaces or <br>. |
| Obsidian | Supported | Every line break shows unless "Strict line breaks" is turned on in the settings. |
| Discord / Slack | Supported | Every line break shows. Shift+Enter adds one without sending. |
| Notion | Supported | Shift+Enter adds a line break inside a block; Enter starts a new block. |
| VS Code preview | Differs | Joins single line breaks unless the markdown.preview.breaks setting is on. |
Questions and answers
Why does Markdown ignore my line breaks?
Which way of adding a line break is best?
<br> works only where HTML is allowed.How do I add a new line in a table cell?
<br> inside the cell. A real line break would end the table row.How do I add more space between paragraphs?
or <br> on a line of its own between the paragraphs.Why do line breaks work in GitHub comments but not in README files?
How do I add a line break in a list item?
Does typing \n add a new line?
\n add a new line?n as those two characters. Press Enter and use one of the methods above.How do I keep line breaks when converting to Word or PDF?
<br>, or turn on "Keep single line breaks" in Markdown to Word or Markdown to PDF, which keeps every line break as typed.