Markdown Horizontal Rule
Three ways to draw a dividing line in Markdown — ---, ***, and ___ — with live examples and the one mistake that turns your line into a heading.
Jump to: Basic syntax · Variations · Common mistakes · Platform support · FAQ
Basic Syntax
Put three or more identical characters on their own line with a blank line before and after. All three produce the exact same <hr> HTML output.
Markdown
Above the line
---
Below the linePreview
Above the line
Below the line
Markdown
Above the line
***
Below the linePreview
Above the line
Below the line
Markdown
Above the line
___
Below the linePreview
Above the line
Below the line
Variations That Also Work
You can use more than three characters, and spaces between them are allowed. As long as all characters are the same type, it is a valid horizontal rule.
Markdown
Above
- - -
BelowPreview
Above
Below
Markdown
Above
----------
BelowPreview
Above
Below
Markdown
Above
* * * * *
BelowPreview
Above
Below
Common Mistakes
The most common issue: forgetting the blank line before ---, which turns the preceding paragraph into a heading instead of creating a divider.
Markdown
Paragraph text
---
This looks like a horizontal rule but it's actually an H2 heading!Preview
Paragraph text
This looks like a horizontal rule but it's actually an H2 heading!
Markdown
Paragraph text
---
This is a proper horizontal rule.Preview
Paragraph text
This is a proper horizontal rule.
Markdown
--
Not a horizontal rule — needs at least 3 characters.Preview
--
Not a horizontal rule — needs at least 3 characters.
Quick Reference
| Syntax | Valid? | Notes |
|---|---|---|
| --- | Yes | Most common — three hyphens |
| *** | Yes | Three asterisks |
| ___ | Yes | Three underscores |
| - - - | Yes | Spaces between characters allowed |
| ------ | Yes | More than 3 characters is fine |
| -- | No | Minimum is 3 characters |
| -*- | No | Cannot mix character types |
| Paragraph\n--- | No | No blank line = Setext heading, not HR |
Platform Support
Horizontal rules work in almost all Markdown environments. The main exception is Discord.
| Platform | Supports ---? | Notes |
|---|---|---|
| GitHub | Yes | All three variants work |
| VS Code preview | Yes | All three variants work |
| Notion | Yes | Use --- in an empty line |
| Obsidian | Yes | All three variants work |
| Slack | Partial | Renders as text — use the divider block instead |
| Discord | No | --- renders as literal dashes, not a line |
| Yes | Horizontal rule supported in new Reddit |
Frequently Asked Questions
How do I add a horizontal line in Markdown?
Use three or more hyphens (---), asterisks (***), or underscores (___) on their own line. Always leave a blank line before the rule (otherwise --- is interpreted as a Setext-style heading underline).
What is the difference between ---, ***, and ___?
All three produce the same HTML output (<hr>) and render identically in most Markdown renderers. The choice is purely stylistic. Hyphens (---) are the most commonly used and least likely to be confused with bold/italic syntax.
Why is my --- creating a heading instead of a line?
If --- immediately follows a paragraph with no blank line between them, Markdown interprets it as a Setext-style H2 heading underline. Always add a blank line before your --- to ensure it renders as a horizontal rule.
What is the minimum number of characters for a horizontal rule?
Three. You can use exactly three (---) or more (------). Spaces between the characters are also allowed, so - - - and * * * are both valid. The characters must all be the same type on one line.
Can I mix hyphens, asterisks, and underscores on one line?
No. All characters on a horizontal rule line must be the same type. A line like -*- or --_ is not a valid horizontal rule and will be rendered as literal text.
Does a horizontal rule work on GitHub, Discord, and Notion?
Yes — all major Markdown platforms support horizontal rules using ---. GitHub Flavored Markdown, Notion, and most editors all support it. Discord does not support horizontal rules; they render as literal dashes.
What HTML does a Markdown horizontal rule produce?
Markdown renders a horizontal rule as <hr> in HTML. You can also write <hr> directly in your Markdown and it will work in most renderers. The visual appearance depends on the site's CSS.