Skip to content
Markdown to PDF

Markdown Line Breaks, New Lines and Horizontal Lines

How to add a line break in Markdown — two spaces, a backslash or <br> — plus new paragraphs, extra blank lines, table cells and horizontal lines with ---.

Updated · 4 min read

Pressing Enter once in Markdown doesn’t start a new line. Two lines typed one under the other are joined into a single paragraph, which surprises almost everyone the first time. Here is how to get the line break you meant, and how to draw a horizontal line across the page.

New line: three ways to add a line break

To move to the next line without starting a new paragraph, end the line in one of these ways:

Method What you type at the end of the line Works in
Two spaces two spaces, then Enter Every Markdown app
Backslash \, then Enter CommonMark apps (GitHub, VS Code, Obsidian, this editor)
HTML tag <br> Anywhere HTML is allowed
Roses are red\
Violets are blue<br>
Sugar is sweet

Two trailing spaces are the original syntax, but they are invisible and many editors strip them when you save. The backslash is easier to see and survives auto-formatting, so it is the safer habit if your app supports it.

New paragraph: leave a blank line

A blank line between two blocks of text starts a new paragraph, with the usual gap between them:

This is the first paragraph.

This is the second paragraph.

Leaving several blank lines makes no difference — Markdown collapses them into one. To force extra vertical space, put a non-breaking space on a line of its own:

First paragraph.

&nbsp;

Second paragraph, with an extra gap above it.

Line breaks inside tables and lists

A table cell must stay on one line of source, so two spaces and the backslash can’t be used there. Use <br>:

| Plan | Includes |
| --- | --- |
| Basic | Editor<br>PDF export |

Inside a list item, any of the three methods works. To add a second paragraph to the same item, leave a blank line and indent the new paragraph to line up with the item’s text.

Why your line breaks work in some apps and not others

Some places treat every single Enter as a line break: GitHub issues and comments, chat apps, and editors with a “strict line breaks” switch turned off. A .md file rendered as a document — a README, a docs page or a PDF — follows the standard rule and joins the lines. If text that looked right in a comment box runs together in your document, add the backslash or two spaces at the end of each line.

Horizontal line across the page

Three or more hyphens, asterisks or underscores on a line of their own draw a horizontal rule:

Above the line

---

Below the line

*** and ___ do the same. Two things to watch for:

  • Leave a blank line before ---. Directly under a line of text, the hyphens turn that text into a heading instead of drawing a line.
  • Don’t start the file with ---. At the very top of a document, a pair of --- lines marks front matter (settings such as title:), so it won’t be drawn as a rule.

A horizontal line is not a page break. If you want the next section to start on a new page of a PDF, see how to add a page break in Markdown.

Quick reference

You want Type
Next line, same paragraph \ or two spaces at the end of the line
New paragraph A blank line
Extra blank space &nbsp; on its own line
Line break in a table cell <br>
Horizontal line --- with a blank line above it

Every example on this page can be tried in the editor, and the Markdown cheat sheet covers the rest of the syntax.

Try it on your own document

Free, private and right in your browser — no signup.

Open the editor