Skip to content
Line Breaks

Markdown handles line breaks in two distinct ways depending on whether you want text to flow together or start on a new line within the same paragraph.

Soft Line Breaks

A single newline in your source — with nothing extra at the end of the line — is a soft line break. The renderer joins the lines with a space, producing continuous flowing text. This means you can wrap your source lines at any width without affecting the output.

Syntax
MARKDOWN
The quick brown fox
jumps over the lazy dog.
Output

The quick brown fox jumps over the lazy dog.

Both source lines render as a single continuous sentence.

Hard Line Breaks

A hard line break forces the text onto a new line within the same paragraph. There are two ways to write one:

  • End the line with two or more trailing spaces, then press Enter.
  • End the line with a backslash (\) immediately before the Enter key.
Syntax
MARKDOWN
Roses are red,  
Violets are blue.

Roses are red,\
Violets are blue.
Output

Roses are red,
Violets are blue.

Best Practice
  • For ordinary prose, use a blank line to separate ideas into paragraphs — it is clearer than hard line breaks.
  • Prefer the backslash form (\) over trailing spaces for hard breaks. Trailing spaces are invisible in source, stripped by many editors on save, and create noise in version control diffs.
  • Use hard line breaks when the position of each line carries meaning: poetry, postal addresses, dialogue attribution, and similar short forms.
  • Never rely on soft wrapping to imply a break — always use a blank line or a hard break when a new line in the output is your intent.

Relationship to Other Pages

This page is an overview of two more detailed pages:

  • Paragraphs (Block Elements chapter) — covers how blank lines separate paragraphs and the rules for soft wrapping in full.
  • Hard Line Break (Inline Elements chapter) — covers the trailing-spaces and backslash syntax in full, including the invisible-trailing-spaces caveat and flavour support.

Markdown Flavour Support

Soft line breaks are universal across all flavours. Hard line breaks using trailing spaces are defined in the original Markdown spec. The backslash form is defined in CommonMark and supported by all modern flavours.

Flavour Support Detail
Flavour Support Notes
Original Markdown Partial Soft wraps universal; trailing-space hard break defined. Backslash form not in the original spec.
CommonMark Yes Both forms precisely specified and unambiguous.
GitHub Flavored Markdown Yes Inherits CommonMark; both forms fully supported.
Pandoc Markdown Yes Both forms supported; --wrap options available for controlling source output line wrapping.

Practical Examples

  • Writing a short poem on a personal blog: Hard line breaks let each line of a verse sit on its own line in the output without the visual gap that a blank paragraph would introduce.
Syntax
MARKDOWN
The harbour sleeps beneath a silver sky,\
The tide goes out, the fishing boats drift by.\
A heron stands alone on barnacled stone —\
This evening hour belongs to me alone.
Output

The harbour sleeps beneath a silver sky,\ The tide goes out, the fishing boats drift by.\ A heron stands alone on barnacled stone —\ This evening hour belongs to me alone.

  • Writing a postal address in a contact page: Hard line breaks keep each line of an address distinct without the blank-line gaps that separate paragraphs would introduce.
Syntax
MARKDOWN
**The Woolly Workshop**\
14 Spinners Lane\
Hebden Bridge\
HX7 8AB
Output

The Woolly Workshop\ 14 Spinners Lane\ Hebden Bridge\ HX7 8AB

© 2026 Docizr. All rights reserved.