Skip to content
All referenceStructure

Markdown Horizontal Rule

Learn how to create horizontal rules (dividers) in markdown using hyphens, asterisks, or underscores. Syntax and platform support.

What is markdown horizontal rule?

A horizontal rule creates a visual divider across the page. In markdown, use three or more hyphens (---), asterisks (***), or underscores (___) on their own line. Horizontal rules separate sections and improve document readability.

Syntax

Hyphens

Three hyphens — the most common way to create a horizontal rule.

Result

Asterisks

Three asterisks also work.

Result

Underscores

Three underscores — less common but equally valid.

Result

Platform support

PlatformSupportedNotes
GitHubYes
GitLabYes
DiscordNoNo horizontal rule support
SlackNoNo horizontal rule support
RedditYes
Stack OverflowYes
NotionYesUse --- or /divider command
ObsidianYes

Common mistakes

Wrong
Text
---
Right
Text

---

Without a blank line above, --- after text creates an H2 heading (alternate syntax) instead of a horizontal rule.

Wrong
--
Right
---

You need at least three characters. Two hyphens won't render a horizontal rule.

Tips for horizontal rule

1Always add blank lines

Put a blank line before and after --- to avoid it being interpreted as a heading underline.

Section 1

---

Section 2
2Use sparingly

Horizontal rules are strong visual breaks. Use headings for most section divisions and reserve rules for major topic transitions.

3Stick with hyphens

All three syntaxes work identically, but --- is the most conventional and readable.

Frequently asked questions

Everything you need to know.

1

How do I add a horizontal line in markdown?

Type three or more hyphens (---), asterisks (***), or underscores (___) on their own line with blank lines above and below.

Related elements

Try it in the editor

Paste your markdown and see horizontal rule rendered instantly with professional themes.