Markdown Hard Line Break
How to add a line break in markdown without starting a new paragraph. Two spaces, backslash, or HTML br tag methods explained.
What is markdown hard line break?
A hard line break forces the text to move to the next line without creating a new paragraph. In standard markdown, a single newline in the source does not create a visible line break — you need either two trailing spaces, a backslash, or an HTML <br> tag at the end of the line.
Syntax
Two trailing spaces
Add exactly two spaces at the end of a line, then press Enter. The spaces are invisible but force a line break.
Second line
Backslash (GFM)
A backslash at the end of a line creates a hard line break. Supported by GitHub Flavored Markdown.
Second line
HTML br tag
The HTML <br> element works on platforms that allow HTML in markdown.
Second line
Platform support
| Platform | Supported | Notes |
|---|---|---|
| GitHub | Yes | Two spaces and backslash both work |
| GitLab | Yes | — |
| Discord | Yes | Shift+Enter creates a line break in the UI |
| Slack | Yes | — |
| Notion | Yes | — |
| Obsidian | Yes | — |
Common mistakes
Line 1 Line 2 (single newline)
Line 1 Line 2 (two trailing spaces)
A single newline in markdown source is treated as a space, not a line break. You must use trailing spaces, backslash, or <br>.
Tips for hard line break
Trailing spaces are invisible in most editors. If you can't see them, use a backslash or <br> instead — they're explicit.
Content where every line matters (verse, addresses, lyrics) should use consistent line break syntax throughout rather than relying on paragraph breaks.
Frequently asked questions
Everything you need to know.
Why doesn't pressing Enter create a new line in markdown?
Markdown collapses single newlines into spaces. This allows text to flow naturally when source files are edited. For a visible line break, use two trailing spaces or a backslash at the end of the line.
Related elements
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 (\).
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 hard line break rendered instantly with professional themes.