In this tutorial, we’ll be discussing how to force a line break in Markdown and walk you through different examples.

The Two Spaces Method

One of the simplest ways to create a line break in Markdown is by adding two spaces at the end of the line.

Here is a text example:

First line of text.  
Second line of text.

Which results in:

First line of text.  
Second line of text.

The Backslash Method

Another approach to force a line break in markdown is by using one or more backslashes (\).

Here is an example of markdown text using the backslash approach:

First line of text.\
Second line of text.\
\
Third line of text.

This will create a visible line break between each sentence:

First line of text.
Second line of text.

Third line of text.

We use double backslashes to create an empty line, which results in a new paragraph.

The Html Break Tag Method

Although Markdown was created to move away from HTML, we can still use HTML in our Markdown. For example, the <br> tag can be used to enforce a line break.

Here is an example of using the <br> tag:

First line of text.<br>
Second line of text.

In Markdown, this will appear as:

First line of text.
Second line of text.

As we have seen, using the two space, backslash, or <br> tag methods, we can easily enforce line breaks in Markdown. Depending on the markdown processor you use, results might differ. It’s important to review your rendered markdown.

Make sure to check out more on using markdown effectively from our library of useful tutorials on creating, editing, and rendering markdown. Here’s a previous article on “how to render markdown in Angular” you might find useful.

That covers everything you need to know about forcing a line break in markdown. Don’t hesitate to experiment with these commands in your markdown editor to see how they affect the output.

Markdown doesn’t only give us an easy way to format text, it also helps us control the layout, spacing, and general appearance of the text. Mastering these skills will improve the readability of your text and make the content look more structured and professional.

This tutorial is part of a continuous effort to make markdown more approachable and useful. You may also be interested in our library of markdown tutorials. Happy Markdowning!