MDUtil

Horizontal Lines in Markdown

Three hyphens on a line of their own draw a horizontal line across the page: ---. This guide covers the three characters you can use, the blank line that has to come first, and front matter.

Quick answer

How do you add a horizontal line in Markdown?

Put three or more hyphens ---, asterisks *** or underscores ___ on a line of their own, with a blank line above. It becomes an <hr> element: a line across the page that separates two parts of the document.

Markdown
The first part.

---

The second part.

Result

The first part.


The second part.

Horizontal line syntax and examples

All forms give the same line. The only trap is the line of text right above.

Three characters, one result

Hyphens, asterisks and underscores all draw the same line.

Markdown
Above

---

Between

***

Between

___

Below

Result

Above


Between


Between


Below

Spaces and longer lines

Any number of the same character from three up works, with or without spaces between them.

Markdown
- - -

* * * * *

----------

Result




Leave a blank line first

Right under a line of text, --- turns that text into a heading. A blank line in between keeps it a horizontal line.

Markdown
This becomes a heading
---

This stays a paragraph

---

Result

This becomes a heading

This stays a paragraph


The <hr> tag

Where HTML is allowed, <hr> draws the same line.

Markdown
Above

<hr>

Below

Result

Above


Below

Inside quotes and lists

A horizontal line also works inside a quote or a list item.

Markdown
> Part one of the quote
>
> ---
>
> Part two of the quote

Result

Part one of the quote


Part two of the quote

Front matter at the top of a file

At the very start of a file, lines between two --- are front matter: settings such as the title. Jekyll, Hugo and Obsidian hide them, and GitHub shows them as a table.

Markdown
---
title: My first post
date: 2026-10-14
---

# My first post

Result

My first post

Horizontal lines in popular apps

Every Markdown renderer draws the line. Chat apps and editors vary.

AppSupportNotes
GitHub / GitLabSupportedAll three forms; --- at the top of a file is shown as front matter.
ObsidianSupportedAll three forms; --- at the top of a note starts its properties.
NotionSupportedTyping --- on an empty line makes a divider block.
Discord / SlackNot supportedNo horizontal lines; the characters are shown as typed.

Questions and answers

What is the difference between ---, *** and ___?

None in the output: all three produce the same <hr>. Hyphens are the most common choice.

Why did --- turn my text into a heading?

A line of hyphens right under text makes that text a level 2 heading. Put a blank line between the text and the ---.

How do I change the color or thickness of the line?

Markdown cannot style it. Where CSS is allowed, use <hr style="border-top: 2px solid #999">; GitHub and many other sites remove style.

What does --- at the top of a file do?

In Jekyll, Hugo, Obsidian and many other tools, lines between two --- at the very start are front matter: settings such as the title, hidden from the page. GitHub shows them as a table.

Does Discord support horizontal lines?

No. Discord shows --- as typed.

How do I add a divider in Notion?

Type --- on an empty line; Notion turns it into a divider block.

How do I add a page break instead of a line?

Markdown has no page breaks. Markdown to PDF and Markdown to Word start a new page at a line holding only \newpage, the command Pandoc and LaTeX users write.

Does a horizontal line help screen readers?

<hr> marks a change of topic, but it does not name the new part. Use headings to give the document its structure.