Markdown Line Break
Learn how to create line breaks in markdown using trailing spaces or backslashes. The difference between line breaks and paragraphs.
What is markdown line break?
In markdown, pressing Enter once doesn't create a visible line break — the text continues on the same line. To force a line break (without starting a new paragraph), end the line with two spaces or a backslash (\).
Syntax
Trailing spaces
Two spaces at the end of a line force a line break. (Spaces shown as visible here but are invisible in practice.)
Second line
Backslash
A backslash at the end of the line also forces a break. More visible than trailing spaces.
Second line
Paragraph (double newline)
A blank line creates a new paragraph with more vertical spacing than a line break.
Paragraph one
Paragraph two
Platform support
| Platform | Supported | Notes |
|---|---|---|
| GitHub | Yes | Both trailing spaces and backslash work |
| GitLab | Yes | — |
| Discord | Yes | Regular Enter creates a line break |
| Slack | Yes | Shift+Enter for line break |
| Yes | Double space or double newline | |
| Stack Overflow | Yes | — |
| Notion | Yes | Shift+Enter for line break |
| Obsidian | Yes | — |
Common mistakes
Line one Line two
Line one Line two
A single newline in markdown source is ignored — the text joins into one line. Add two trailing spaces or use a backslash.
Line one<br>Line two
Line one Line two
While <br> HTML works on some platforms, it's not valid in all markdown renderers. Use trailing spaces or backslash instead.
Tips for line break
Trailing spaces are invisible and often stripped by editors. A backslash (\) at end of line is more reliable and visible.
A line break (two spaces + Enter) gives a small break. A paragraph (blank line) gives a larger gap. Use paragraphs for separate ideas.
Many code editors strip trailing whitespace. If using the two-space method, add an exception for .md files.
Frequently asked questions
Everything you need to know.
Why doesn't pressing Enter create a new line in markdown?
By design, markdown treats single newlines as spaces — text flows into one paragraph. For a hard line break, end the line with two spaces or a backslash.
Related elements
Horizontal Rule
A horizontal rule creates a visual divider across the page. In markdown, use three or more hyphens (---), asterisks (***), or underscores (___) on their own line. Horizontal rules separate sections and improve document readability.
Indent
Markdown uses indentation (spaces or tabs) to nest content inside lists and blockquotes. Standard markdown doesn't support arbitrary text indentation — indent is functional, not decorative. Use 2-4 spaces to nest list items and blockquote continuations.
Heading
Markdown headings are created with hash symbols (#). One hash for H1 (largest), two for H2, up to six for H6 (smallest). Headings structure your document and create a hierarchy that readers and search engines can follow.
Try it in the editor
Paste your markdown and see line break rendered instantly with professional themes.