Skip to content

Line breaks in Markdown

To force a line break without starting a new paragraph, end the line with two spaces or a backslash (\) and then press Enter. You can also use <br> on platforms that allow HTML. To start a new paragraph, leave one completely blank line.

Result you want Write this Best use
Line break Two spaces at the end of the line Portable CommonMark documents
Line break \ at the end of the line When the break should be visible in the source
Line break <br> HTML-friendly Markdown and some table cells
New paragraph One blank line Normal prose and AI context

Type two ordinary spaces after the last character, then press Enter:

Line one··
Line two

The ·· marks above only show where the two invisible spaces belong. Do not type the dots.

This creates a hard line break while keeping both lines in the same paragraph. It works well for addresses, short verse, signatures, and other text where line position carries meaning.

The disadvantage is visibility. Formatters and editors that remove trailing whitespace can silently delete the break.

A backslash immediately before the line ending is the visible CommonMark alternative:

Line one\
Line two

It produces the same kind of hard break as two trailing spaces. Because the marker is visible, it is easier to review in source control and less likely to disappear during cleanup.

Use this when your target supports CommonMark hard line breaks. If you publish through an older or custom Markdown parser, preview the result there first.

When raw HTML is allowed, <br> creates an explicit break:

Line one<br>
Line two

This is easy to see and is useful in places where trailing spaces are awkward, including table cells on some platforms. It is less portable because security-conscious sites may escape or remove raw HTML.

Do not stack several <br> tags to create visual spacing. Use paragraphs, lists, or headings to express structure and let the site’s styles control the spacing.

A blank line creates a new paragraph, not merely a line break:

First paragraph.
Second paragraph.

For articles, notes, reports, and material given to an AI, this is usually the right choice. A paragraph says that one idea ended and another began; a hard break only controls how text is displayed.

Why pressing Enter once often does nothing

Section titled “Why pressing Enter once often does nothing”

A single line ending inside a paragraph is a soft line break. Markdown parsers normally keep the adjacent lines in one paragraph, and a web browser displays that line ending like a space.

This is one line in the source.
This is the next line in the source.

The rendered result is usually:

This is one line in the source. This is the next line in the source.

That behavior lets authors wrap long source lines without changing the rendered paragraph. The CommonMark specification also permits a renderer to treat soft breaks differently, so the exact result can depend on the platform.

GitHub, VS Code, and other Markdown renderers

Section titled “GitHub, VS Code, and other Markdown renderers”
  • GitHub .md files: two trailing spaces, a trailing backslash, and <br> all create a line break. A single Enter is normally collapsed within the paragraph. GitHub issues, pull requests, and discussions can treat single line endings differently from files.
  • VS Code preview: the built-in preview supports the common hard-break forms, but an extension or site-specific renderer may use different rules.
  • CommonMark: two or more spaces and a backslash are the defined hard-break forms. A blank line separates paragraphs.
  • Wikis, chats, and CMS editors: some enable “breaks on Enter,” while others block HTML or remove trailing spaces.

Always test the final document in the renderer where readers will see it. A correct preview in one editor does not guarantee identical output everywhere.

Use a new paragraph when the next line begins a new thought. Use a hard line break only when the lines belong together but must remain visually separate.

Good uses for a hard break include:

  • A postal address
  • A two-line title or byline
  • Poetry or lyrics you have permission to reproduce
  • A compact label followed by a value

Use headings, lists, or paragraphs instead when each line is a separate item or section. For example, this source is ambiguous:

Owner: Maya
Status: Approved
Due: Friday

A list makes the relationships clearer and does not depend on line-break behavior:

- Owner: Maya
- Status: Approved
- Due: Friday

Your editor or formatter is probably trimming trailing whitespace. Use a trailing backslash, or configure that tool to preserve intentional Markdown breaks.

The backslash appears in the rendered text

Section titled “The backslash appears in the rendered text”

The parser may not support backslash hard breaks, or the backslash may not be the final character on the line. Try two spaces or <br>, then check the target platform.

The platform is escaping or blocking HTML. Use the CommonMark forms instead.

A blank line created a new paragraph. Use two spaces, a backslash, or <br> if you need a compact break inside the same paragraph.

Basic Markdown tables do not have a fully portable multi-line-cell syntax. <br> works in table cells on many HTML-based renderers, but not all. If portability matters, split the content into multiple rows or rewrite it outside the table. See tables in Markdown for safer table structure.

Text copied from a PDF has a break after every line

Section titled “Text copied from a PDF has a break after every line”

Those are usually visual line wraps, not meaningful paragraph boundaries. Join the wrapped lines, preserve real paragraph breaks, and check for words split by page-end hyphens. The PDF-to-Markdown guide has a full cleanup checklist.

For AI input, prefer semantic structure over visual layout:

  • Use blank lines between ideas.
  • Use headings for sections and lists for separate items.
  • Use fenced code blocks when line endings and indentation must be preserved exactly.
  • Avoid hard-wrapping ordinary prose at a fixed column width.
  • Remove accidental line breaks introduced by PDF extraction or copy and paste.

Hard breaks are still appropriate for addresses, verse, or other content where the original lineation matters. The goal is not to remove every break; it is to make each break mean something.