Updated February 2026. The original version of this post only covered the backslash method. I’ve expanded it to cover all four ways to add a newline in markdown, with a compatibility table so you know what works where.
You know that thing where you’re writing markdown and you hit Enter expecting a new line, but nothing happens? Or you hit it twice and get a massive paragraph gap when all you wanted was a subtle break?
Markdown treats line breaks and paragraph breaks as two different things. A single Enter does nothing visible in most renderers. A double Enter creates a whole new <p> tag. And somewhere between those two extremes is the formatting you actually wanted.
Here’s how to get it.
Table of contents
Open Table of contents
Line break vs paragraph break: what’s the difference
This trips people up constantly, so let’s get it out of the way.
A paragraph break in markdown is a blank line between two blocks of text. You hit Enter twice, and markdown creates two separate <p> elements:
First paragraph.
Second paragraph.
Renders as:
<p>First paragraph.</p>
<p>Second paragraph.</p>
A line break (or newline) is what you want when you need the next line to start directly below the current one, inside the same paragraph. Like an address block, a poem, or a list of steps where a full paragraph gap would look ridiculous.
123 Main Street\
Apt 4B\
Denver, CO 80202
Renders as:
<p>123 Main Street<br />
Apt 4B<br />
Denver, CO 80202</p>
One <p> tag, multiple lines. That’s the difference.
The four ways to add a markdown line break
1. Backslash at the end of the line
Add a \ right before you hit Enter.
Line one.\
Line two.
This is the one I use. It’s visible in your source, it won’t get stripped by your editor, and it works in CommonMark, GitHub Flavored Markdown (GFM), Obsidian, and most modern processors.
2. Two trailing spaces
Add two spaces at the end of a line before hitting Enter.
Line one.··
Line two.
(The ·· represents two spaces. You can’t see them, which is the whole problem.)
This is the original markdown line break method from John Gruber’s spec. It works everywhere. But most code editors trim trailing whitespace automatically, which means your line breaks quietly vanish when you save. VS Code, Sublime, and most modern editors do this by default. You can disable it, but then you’re fighting your tools to preserve invisible characters, which is the opposite of fun.
3. HTML <br> tag
Just drop a <br> or <br /> tag directly into your markdown.
Line one.<br>
Line two.
Works in every markdown processor that allows inline HTML (which is almost all of them). It’s ugly in the source, but when you need a break and nothing else is cooperating, this is the fallback that never fails.
4. Just hit Enter (sometimes)
In some processors, a single Enter creates a line break without any special syntax:
Line one.
Line two.
GitHub issues and comments do this. So does Slack. But most markdown renderers following the CommonMark spec will just join these into a single line. Don’t rely on this unless you know your specific tool supports it.
Quick reference
| Method | Syntax | Visible in source? | Works in CommonMark? | Works in GFM? |
|---|---|---|---|---|
| Backslash | \ at end of line | Yes | Yes | Yes |
| Two spaces | ·· at end of line | No | Yes | Yes |
| HTML tag | <br> | Yes | Yes | Yes |
| Single Enter | Just press Enter | Yes | No | Varies |
Which method should you use
Use the backslash for anything you’re writing in a modern editor. It’s explicit, it survives auto-formatting, and it reads clearly in the source. I write markdown in VS Code daily and this is the only method I trust not to disappear on save.
Use two spaces if you’re writing for a processor that doesn’t support backslash line breaks (some older or nonstandard parsers). Just know your editor might strip them.
Use <br> when you need a line break inside a markdown table cell, inside bold/italic formatting, or anywhere the backslash method doesn’t play nice. Tables are the big one here. Markdown table cells don’t support regular line breaks, so <br> is often your only option.
Use single Enter only in tools you’ve tested. GitHub issues? Go for it. Your blog’s markdown processor? Test it first.
Where people actually run into this
A few real scenarios where this matters more than you’d think:
Documentation and READMEs. You’re writing install instructions and want compact line breaks between steps without full paragraph spacing. The backslash keeps everything tight.
Blog posts with poetry or lyrics. (Yes, some of us quote poetry in our blog posts. No judgment.) A paragraph break between every line of a stanza looks absurd.
Addresses and contact info. Three lines of an address don’t need three paragraphs. One <p> with line breaks is what you want.
Markdown table cells. This is the one that catches everyone. You can’t use backslash or double space inside a table cell. You need <br>. No way around it:
| Name | Address |
|------|---------|
| Kent | 123 Main St<br>Denver, CO |
Notion, Obsidian, and note-taking apps. These all handle newlines slightly differently. Obsidian follows CommonMark (backslash works). Notion auto-breaks on single Enter. If you switch between tools, the backslash method is the safest bet because it’s the most explicit.
That’s it. Four methods, one table, and now you know which one to use where. The backslash is the answer 90% of the time. For the other 10%, there’s <br> and a small prayer to the markdown gods.