Markdown new line and line breaks

A single Enter is ignored: Markdown joins the lines into one paragraph. End a line with two spaces or a backslash for a line break; leave a blank line for a new paragraph.

Roses are red,
violets are blue.

Roses are red,  
violets are blue.

Roses are red,\
violets are blue.

Roses are red,<br>violets are blue.

Why Enter does nothing

Markdown treats a single newline inside a paragraph as a “soft break” and renders it as a space. That lets you wrap source text at any width without changing the output. Turn on Show whitespace above to see the invisible characters that decide what happens.

Three ways to force a line break

  1. Two trailing spaces at the end of the line. The original syntax, but invisible and often stripped by editors that trim whitespace.
  2. A backslash at the end of the line. CommonMark and GFM support it and you can see it, so it survives editors.
  3. HTML <br>. Works almost everywhere, including inside table cells, where the other two can’t be used.

New paragraph

Leave one empty line between blocks of text. Several empty lines count as one.

Extra vertical space

Markdown collapses blank lines. For visible extra space use <br> on its own line, or &nbsp; in an otherwise empty paragraph.

Line breaks in tables

A table row must be on one source line, so use <br> inside a cell. The table generator does this for you when a cell contains a newline.

Where Enter does make a new line

GitHub comments, issues and chat apps turn on “breaks” mode, so each Enter is a line break there. READMEs and .md files on GitHub use standard behaviour. The editor on this site has a “Line breaks on Enter” toggle so you can preview both.

Quick answers

How do I add a new line in Markdown?
End the line with two spaces or a backslash, or use <br>. For a new paragraph, leave a blank line.
Why are my two trailing spaces not working?
Your editor probably trims trailing whitespace on save. Use a backslash or <br> instead.
How do I add a line break inside a table cell?
Use <br>. Rows must stay on one line.