Skip to content
Back to Journal
GuideMay 5, 2026·5 min read

How to Add a Line Break in Markdown

Force a new line without a paragraph break in markdown. Two spaces, backslash, and HTML br tag methods.

The quick answer: Add two spaces at the end of a line before pressing Enter, use a trailing backslash (\), or insert an HTML
tag. These are the three methods for forcing a hard line break without starting a new paragraph. See the Markdown line break reference for a complete syntax and compatibility guide.

Why Pressing Enter Alone Doesn't Work

In markdown, a single newline in your source file collapses into a space in the rendered output. This is a deliberate design decision — it lets you hard-wrap long lines in your text editor for readability without affecting the final document: This is one long sentence split across multiple source lines — renders as one line.

Rendered output: "This is one long sentence split across multiple source lines — renders as one line."

To force an actual visible line break — staying within the same paragraph but starting a new line — you need an explicit method.

Method 1: Two Trailing Spaces

Add exactly two spaces at the end of a line before pressing Enter: First line Second line

The two spaces render as a
element in the HTML output. The line break is visible in the rendered output; the spaces are invisible. The problem: trailing spaces are invisible in most text editors. Many editors also automatically strip trailing whitespace, silently removing your line breaks. If you copy markdown between tools, trailing spaces are often lost. When to use it: legacy markdown, when other methods aren't supported.

Method 2: Trailing Backslash (GFM)

In GitHub Flavored Markdown, a backslash at the end of a line creates a hard line break: First line\ Second line

The backslash is visible in source code (unlike trailing spaces), making this easier to spot and maintain. Platform support:

  • GitHub ✅
  • GitLab ✅
  • Obsidian ✅
  • Discord ✅
  • Plain CommonMark (without GFM) ❌ — renders as a literal backslash

Method 3: HTML br Tag (Most Portable)

The HTML
element creates a line break and works wherever HTML is permitted in markdown: First line
Second line

Or inline without a newline in source: First line
Second line
When to use it: cross-platform markdown, static site generators, anywhere you need guaranteed behavior across different renderers. Platform support:

  • GitHub ✅
  • GitLab ✅
  • Obsidian ✅
  • Most static site generators ✅
  • Discord ❌ (Discord ignores HTML tags)
  • Slack ❌

Line Break vs Paragraph Break

This is the most important concept to understand: Hard line break (using one of the three methods above):

  • Moves to the next line
  • No extra vertical space between lines
  • Same paragraph context
  • Renders as
    in HTML
Paragraph break (blank line in source):
  • Creates a new paragraph
  • Adds vertical spacing above the new paragraph
  • Renders as a new

    element in HTML

Line 1 Line 2 ` ← blank line creates a paragraph break New paragraph

Platform-by-Platform Breakdown

GitHub and GitLab

Both support all three methods. The backslash method and two-space method work as GFM features. The
tag works as inline HTML.

Obsidian

All three methods work. Obsidian's live preview shows hard line breaks visually, making it easy to see what you're getting.

Notion

Notion uses Shift+Enter to insert a line break within a block. When importing markdown, the
tag and trailing spaces are both recognized.

Discord

Discord supports line breaks via Shift+Enter in the message input. In markdown, the trailing space method works. Backslash does not create a line break in Discord. HTML
is ignored.

Slack

Slack also uses Shift+Enter for line breaks in messages. Standard markdown line break methods (trailing spaces, backslash) behavior in Slack is inconsistent. Use Shift+Enter directly in Slack.

When to Use Hard Line Breaks

Hard line breaks are appropriate for:

  • Poetry and verse — where line endings are meaningful
  • Postal addresses — city, state, zip on separate lines
  • Song lyrics — line breaks within a verse
  • Tables with multi-line cells
    inside a table cell
  • Formatted display text — when you need specific visual layout
For prose, paragraphs are almost always the right choice. Excessive use of hard line breaks makes text feel cramped and harder to read.

Common Mistakes

Using One Space Instead of Two

First line (one space) — won't create a line break First line (two spaces) — creates a line break

Expecting Enter to Create a Line Break

New markdown writers are often confused that pressing Enter in the source file doesn't create a visible line break. The blank-line-for-paragraph-break rule requires a mental shift from word processors.

Over-Using Line Breaks in Prose

Using
after every sentence creates a document that looks like a manual typewriter — no paragraph spacing, no visual breathing room. Reserve line breaks for situations where the line ending carries meaning (poetry, addresses). Use paragraph breaks for prose.

Real-World Use Cases

Mailing Addresses in Documentation

Headquarters: 1600 Amphitheatre Pkwy
Mountain View, CA 94043
United States

Multi-Line Table Cells

Standard markdown table cells don't support block elements, but you can use
for line breaks within a cell: | Name | Contact | | --- | --- | | Alice | alice@example.com
+1 555 0100 |

AI-Generated Poetry or Formatted Text

When AI generates verse or formatted text with meaningful line breaks, paste into MarkdownTools and ensure the line breaks are preserved using one of the three methods above.


Full reference: Markdown Hard Line Breaks.

Ready to put this into practice? Paste your markdown into the free MarkdownTools PDF exporter or HTML converter — no signup required.

Frequently Asked Questions

How do you force a line break in markdown?

Three methods work: (1) add two trailing spaces at the end of a line, (2) add a backslash at the end of a line (GFM), or (3) use the HTML <br> tag. The HTML <br> method is the most portable.

Why does pressing Enter not create a line break in markdown?

Markdown intentionally collapses single newlines into spaces. This lets you wrap long lines in your source editor without affecting the rendered output. A blank line creates a paragraph break; single newlines do not.

What is the difference between a line break and a paragraph break in markdown?

A line break (hard break) moves to the next line within the same paragraph with no extra vertical space. A paragraph break (blank line in source) creates a new paragraph with a gap above it.

Does the backslash line break work in all markdown parsers?

The trailing backslash for line breaks is a GitHub Flavored Markdown (GFM) feature. It works in GitHub, Obsidian, and most modern parsers. It does not work in plain CommonMark without GFM extensions enabled.

MT

MarkdownTools Team

May 5, 2026

Try it free

Make your AI output beautiful

Paste markdown from ChatGPT or Claude. Pick a theme. Export as PDF or HTML in seconds.

Open App — It's Free