Markdown Line Breaks: Two Spaces or Backslash
For a line break within the same paragraph, put two spaces at the end of the line, then press Enter. For a new paragraph, leave one blank line. A backslash before Enter also creates a hard break in CommonMark and the Pandoc GFM configuration tested here, but not in our Python-Markdown configuration.
Copy the syntax you need
Line break: two trailing spaces
There are exactly two spaces after First line in this example:
First line
Second line
Both lines belong to one paragraph, with a forced break between them. For visibility, the first line is First line·· with each · standing for a space. Type spaces, not the dots.
This was the only explicit hard-break form that worked in all four configurations in our local rendering test.
Line break: backslash, when supported
First line\
Second line
The backslash is easier to see than trailing whitespace. Use it when you know the destination supports it. Our CommonMark and Pandoc GFM runs converted it to a break; Python-Markdown displayed the backslash as text.
New paragraph: a blank line
First paragraph.
Second paragraph.
This creates two paragraphs, rather than two lines inside one paragraph. Use it to separate ideas, not to format an address or a short sign-off.
Ordinary Enter: a soft break
This sentence continues
on the next source line.
An ordinary source newline does not reliably force a displayed break. Many renderers let the paragraph flow as one line until the window becomes too narrow. That is useful for keeping prose readable in a text editor without fixing its displayed line lengths.
HTML break: only where HTML is accepted
First line<br>
Second line
GitHub documents <br> as an option in Markdown files. Other applications may disable or sanitize raw HTML, so it is not a universal fallback. See GitHub's line-break guidance.
Which form works in which renderer?
The table below summarizes emitted HTML from the original test, recorded on October 18, 2026. “Break” means an actual <br> element, not text wrapping in a browser.
| Input | markdown-it CommonMark | markdown-it with breaks: true |
Python-Markdown | Pandoc GFM |
|---|---|---|---|---|
| Ordinary newline | No forced break | Break | No forced break | No forced break |
| Two trailing spaces + newline | Break | Break | Break | Break |
| Backslash + newline | Break | Break | Literal backslash | Break |
| Blank line | Two paragraphs | Two paragraphs | Two paragraphs | Two paragraphs |
Source: recorded renderer results.
The breaks option changes how markdown-it renders ordinary newlines. It does not change the source or replace paragraph boundaries. Turning it on is useful when every source line should remain separate, but it can make source-wrapped prose look chopped into short lines. The markdown-it configuration documentation explains the option.
GitHub also distinguishes conversation text from repository files. Its documentation describes ordinary newlines as sufficient in issues, pull requests, and discussions, while .md files need explicit break syntax. The local Pandoc GFM test above is not a test of GitHub.com.
Why is my Markdown line break not working?
The two spaces disappeared. Turn on visible whitespace in your editor and inspect the saved file. If an editor or formatter trims trailing spaces, your hard break becomes an ordinary newline. Preserve those spaces, or use a visible form that your destination accepts.
The backslash is visible. The configured parser may not support that syntax. This happened in our Python-Markdown test. Use two trailing spaces instead. Its installed line-break rule and the markdown-it soft-break rule are recorded in the source diagnosis.
Every line breaks, even without special syntax. Check for a soft-break option or newline extension. Python-Markdown's documented nl2br extension is one example, but it was not executed in this comparison.
There is too much vertical space. A blank line creates separate paragraphs. For an address, verse, or sign-off that belongs in one paragraph, replace the blank line with a supported hard break.
A backslash at the end of a paragraph does nothing useful. A hard break separates lines within a block. It is not a way to add an extra empty line after the block. That boundary is part of the CommonMark hard-break definition.
When you inspect generated HTML, look for <br> and <p> rather than newline characters alone. Our ordinary-newline outputs contained a literal newline in CommonMark but a space in Pandoc GFM. Neither output forced a displayed break.
Preview, then check the destination
Paste a small sample into Markovo's Markdown Reader to compare the Markdown source with its rendered view. Then check the same sample in the app where the document will actually be read. This article does not benchmark the Reader or claim that every renderer shares its settings.
If a conversion changes your source wrapping, the Pandoc Markdown cheat sheet explains reader, writer, and --wrap=none options. That flag controls output source wrapping, not the width of the displayed page.
Test details and raw evidence
The original run was recorded at 2026-10-18T15:59:59.527520+00:00, using Python 3.11.14 and these configurations:
- markdown-it-py 4.0.0:
MarkdownIt('commonmark').render(source). - markdown-it-py 4.0.0:
MarkdownIt('commonmark', {'breaks': True}).render(source). - Python-Markdown 3.10.2:
markdown.markdown(source, extensions=['tables', 'fenced_code']). - Pandoc 3.11:
pandoc -f gfm -t html.
The reproducible runner tests ordinary newlines, two spaces, backslashes, blank lines, and a combined diagnostic sample. It counts HTML tags rather than visual correctness. The combined outputs are available for CommonMark, preserved soft breaks, Python-Markdown, and Pandoc GFM.
No GitHub.com or VS Code interface, HTML sanitizer, editor trimming behavior, CSS spacing, or Markovo conversion was tested. These are results for the named versions and configurations, not universal renderer guarantees.


