Your resource for web content, online publishing
and the distribution of digital products.
S M T W T F S
1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
 
 
 
 
 

The Dead Simple Markdown Guide to Line Breaks

DATE POSTED:August 20, 2024
Line Breaks

To create a line break or new line (
), end a line with two or more spaces, and then type return.

\

| Markdown | HTML | Rendered Output | |----|----|----| | This is the first line.   \n And this is the second line. |

This is the first line.
\n And this is the second line.

| This is the first line. \n And this is the second line. |

Line Break Best Practices

You can use two or more spaces (commonly referred to as “trailing whitespace”) for line breaks in nearly every Markdown application, but it’s controversial. It’s hard to see trailing whitespace in an editor, and many people accidentally or intentionally put two spaces after every sentence. For this reason, you may want to use something other than trailing whitespace for line breaks. If your Markdown application supports HTML, you can use the 
 HTML tag.

\ For compatibility, use trailing white space or the 
 HTML tag at the end of the line.

\ There are two other options I don’t recommend using. CommonMark and a few other lightweight markup languages let you type a backslash (\) at the end of the line, but not all Markdown applications support this, so it isn’t a great option from a compatibility perspective. And at least a couple lightweight markup languages don’t require anything at the end of the line — just type return and they’ll create a line break.

\

| ✅  Do this | ❌  Don't do this | |----|----| | First line with two spaces after.   \n And the next line. \n \n First line with the HTML tag after.
\n And the next line. | First line with a backslash after.\ \n And the next line. \n \n First line with nothing after. \n And the next line. |

\

:::info This guide is a Matt Cone project available on Markdown Guide under the CC BY-SA 4.0 license.

:::

\