Markdown Line Breaks

You pressed Enter, and the two lines came out as one. This is the most common surprise in markdown, and it is deliberate: a single newline is treated as a space, so a paragraph can be wrapped at any width without changing what it means.

Four things do produce a break, and they are not interchangeable. Each one below is shown as source beside its rendered result, so you can see exactly which is which.

Why your line break did nothing

Pressing Enter once does not create a line break. Markdown treats a single newline as a space and joins the lines into one paragraph — this is the most common surprise in the whole format.

You write
Roses are red
Violets are blue
This all runs together
You get

Roses are red Violets are blue This all runs together

Three lines in, one line out. Markdown inherited this from how plain-text email was wrapped: you could break a long line anywhere without changing the meaning.

A blank line: new paragraph

Leave an empty line between blocks and you get separate paragraphs, with space between them. This is the option to reach for by default — it is unambiguous and impossible to get wrong by accident.

You write
Roses are red

Violets are blue

Now they are separate
You get

Roses are red

Violets are blue

Now they are separate

Use this unless you specifically need the lines tight against each other. Nothing invisible is involved, so it survives copying, reformatting and other people editing your text.

Two trailing spaces: hard break

End a line with two or more spaces and the next line starts immediately below, inside the same paragraph. This is the canonical hard break, and the one every markdown tutorial mentions.

You write
Roses are red  
Violets are blue  
Tight lines, one paragraph
You get

Roses are red
Violets are blue
Tight lines, one paragraph

The catch: the spaces are invisible. You cannot see them here, editors strip them on save, linters flag them as trailing whitespace, and Git diffs hide them. If a break mysteriously stops working after an edit, this is almost always why.

A backslash: the visible alternative

A backslash at the end of a line does exactly what two spaces do, but you can see it. It survives trailing-whitespace stripping, which makes it the safer choice in anything stored in a repository.

You write
Roses are red\
Violets are blue\
Same result, visible syntax
You get

Roses are red
Violets are blue
Same result, visible syntax

Supported by GitHub Flavored Markdown and CommonMark. Some older or stricter parsers only accept the two-space form, so prefer it where the text has to travel somewhere you do not control.

A <br> tag, when you need certainty

Markdown allows inline HTML, so a <br> produces a break wherever you put one. It is the most explicit option and the least ambiguous to a reader of the source.

You write
Roses are red<br>
Violets are blue<br>
No invisible characters anywhere
You get

Roses are red
Violets are blue
No invisible characters anywhere

Useful inside table cells, where blank lines are not allowed and trailing spaces do not help. Reach for it there; elsewhere the plain markdown forms read better.

Breaks inside lists

The same rules apply within a list item, with one addition: a continuation line has to be indented to line up with the text above it, or the list ends.

You write
- First item
  continues on a second line
- Second item

1. Step one\
   still step one
2. Step two
You get
  • First item continues on a second line
  • Second item
  1. Step one
    still step one
  2. Step two

Indent the continuation by two spaces for a bullet, three for a numbered item — enough to clear the marker. Get it wrong and the line becomes a new paragraph outside the list.

Which one to use

A blank line for separate thoughts. A backslash for tight lines you want to survive an editor. Two spaces if the destination is old or strict. A <br> inside table cells.

You write
Address block, tight lines:

Ada Lovelace\
12 Analytical Way\
London

Separate thoughts, blank lines:

The first point stands on its own.

So does the second.
You get

Address block, tight lines:

Ada Lovelace
12 Analytical Way
London

Separate thoughts, blank lines:

The first point stands on its own.

So does the second.

One trailing space does nothing at all — it must be two or more. That near-miss is worth knowing, because it looks identical to the version that works.

Check your own markdown

Paste it into the editor and switch to Preview — if a break is not landing where you expect, you will see it immediately rather than after you have shared the link.