MD ViewerMD Viewer

100% private — everything runs in your browser

Markdown Line Break

Two invisible spaces or one backslash — that's the whole markdown line break trick. Try both live, see the trailing characters highlighted, and copy working syntax.

MD Viewer Team

Examples
Markdown source

L1: ·· (2)

Preview

First line
Second line

A markdown line break ends the visual line without ending the paragraph. It is the tool for addresses, song lyrics, signature blocks, and any text where the next line must start immediately below — but still belong to the same block. Standard Markdown gives you exactly two ways to force it: end the line with two spaces, or end it with a backslash. The playground above demonstrates both markdown line break forms with the preview updating as you type.

The two-space version is the classic markdown line break and the one GitHub documentation still teaches. Its weakness is invisibility — trailing spaces are stripped by many editors and code review tools, silently deleting your break. The backslash version, standardized in CommonMark, survives that treatment. The example chips above let you compare both; the hint bar below the source pane even counts the trailing spaces in your text so you can see the otherwise hidden characters that carry the markdown line break.

Keep this page distinct from paragraphs in your head: a blank line between text creates a new paragraph with a gap, while a markdown line break keeps the text inside one paragraph and simply wraps it. If you are seeing single Enters do nothing, that page — markdown new line — explains the soft break rule. Here we force breaks on purpose.

Markdown line break syntax at a glance

You typeWhat renders
Line one \nLine twoOne paragraph, two visual lines (two-space break)
Line one\ Line twoOne paragraph, two visual lines (backslash break)
Line one Line twoOne paragraph, one flowing line (soft break, no break)
Line one Line twoTwo separate paragraphs (blank line)
Line one \nLine twoStill one break — three or more spaces work like two

How to add a markdown line break

  1. 1

    Type the first line

    Write the text that should appear on the first visual line. Do not press Enter yet — the markdown line break marker attaches to the end of this line.

  2. 2

    End the line with two spaces or a backslash

    Press the spacebar twice after the last character, or type a single backslash. Both create a markdown line break; the playground hint bar shows the trailing space count so you can confirm what you typed.

  3. 3

    Press Enter and continue

    The next line renders directly below the first, inside the same paragraph. Repeat the marker on each line that must break; the markdown line break only applies to lines that end with it.

  4. 4

    Copy the working syntax

    Use Copy Markdown to grab the exact source with its invisible characters intact — the copied text keeps the real two trailing spaces, not the visual dots.

Two spaces or backslash: which markdown line break to use

The two-space markdown line break has the widest support — every renderer going back to the original Markdown.pl treats it as a hard break. Choose it for README files and documentation that must render on the widest set of platforms. Its cost is fragility: the break depends on characters no one can see, and editors configured to trim trailing whitespace will delete it without warning.

The backslash markdown line break is explicit and survives whitespace trimming, which makes it the safer choice when files pass through formatters, linters, or copy-paste. It is part of CommonMark and understood by GitHub, GitLab, and modern toolchains, but very old Markdown processors may print the backslash literally. The practical rule: use backslashes in projects you control, two spaces in files that must render absolutely everywhere, and verify either one in the preview above before committing.

Whichever you choose, the markdown line break keeps both lines inside one paragraph — they share spacing, indentation, and emphasis context. That is what distinguishes it from the blank-line paragraph on the markdown new line page, and why the right choice depends on structure, not just looks.

Markdown line break mistakes to avoid

One trailing space

Two trailing spaces

A single space at the end of a line is ignored. The markdown line break needs at least two — and the hint bar in the playground counts them for you.

Trailing spaces stripped by your editor

Backslash before the newline

If your editor trims trailing whitespace on save, every two-space markdown line break dies silently. Switch to the backslash form.

Using a break for every new sentence

Blank lines between paragraphs

Hard-wrapping every line makes reflow painful and diff noisy. The markdown line break is for lines that must stay lines — let prose flow in paragraphs.

Trailing spaces, preserved exactly

The examples on this page store the two trailing spaces byte-for-byte, and Copy Markdown reproduces them exactly. When you paste elsewhere, the markdown line break survives — but if a tool in between trims whitespace, re-add the spaces or switch to backslash.

Frequently asked questions

Sources and spec citations

“A line ending preceded by two or more spaces is a hard line break.”
CommonMark Specification 0.31.2
“A backslash at the end of the line is also a hard line break.”
CommonMark Specification 0.31.2

Related Markdown tools