How to Add a Horizontal Rule in Markdown
Create a horizontal divider line by putting three or more dashes (---), asterisks (***), or underscores (___) alone on a line, with blank lines before and after. All three render the same <hr> element.
Platform Support
Horizontal rules signal a thematic break — a change of scene or topic that is bigger than a paragraph break but does not deserve a heading. They are common between major README sections, before footers, and in long-form writing at scene transitions. Because all three characters produce identical output, the choice is style; dashes are the most common, but asterisks have one practical advantage covered below.
The single most important gotcha: a line of dashes placed directly under a line of text is not a horizontal rule — it is setext heading syntax, and it turns the text above it into an H2. If your divider keeps converting the previous paragraph into a heading, the missing blank line above the --- is the cause. Asterisks (***) have no heading meaning, so they can never trigger this; some writers use *** exclusively for that reason.
A few more details from the spec: more than three characters work (--------- is still one rule), spaces between the characters are allowed (- - - is valid), but any other character on the line disqualifies it. The line cannot be indented four or more spaces, or it becomes a code block. Also keep horizontal rules out of YAML front matter zones — a stray --- at the very top of a file is interpreted as a front matter delimiter by static site generators like Jekyll and Hugo, which can swallow the top of your document.
Examples
---
***
___Create a horizontal line using three or more dashes, asterisks, or underscores.
---***___End of the first section.
---
Start of the next section.End of the first section.
Start of the next section.
Blank lines on both sides keep the dashes from being read as a setext heading underline.
* * *Three or more markers with spaces between them still form a rule.
Common Mistakes
Section title
---Section title
---
Next contentDashes directly under text create a setext H2 heading, not a divider. Always put a blank line before ---.
-----Two characters are not enough — a thematic break needs at least three dashes, asterisks, or underscores.
--- text after the dashes--- (alone on its line)Any other content on the line disqualifies it as a rule; the line renders as plain text.
Platform Notes
GitHub
All three characters work. Note that --- as the first line of a file may be treated as front matter by tools that process the repo (Jekyll for GitHub Pages).
Discord
No horizontal rule support — the characters render literally. Use an empty line or a line of unicode box characters as a visual divider.
Obsidian
Full support; --- at the very top of a note starts YAML front matter (properties) instead of a rule.
Notion
Typing --- at the start of an empty block converts it into a native divider block.
Frequently Asked Questions
How do I make a horizontal line in Markdown?
Put three or more dashes (---), asterisks (***), or underscores (___) alone on a line with blank lines above and below. All three produce an <hr> element.
Why did my --- turn the text above it into a heading?
Without a blank line in between, dashes under text are setext heading syntax — they make the previous line an H2. Add a blank line before the dashes, or use *** instead.
Is there a difference between ---, ***, and ___?
No difference in output — all render the same <hr>. Dashes are most common; asterisks avoid the setext-heading ambiguity entirely.
Can I style or change the thickness of a horizontal rule?
Not in Markdown — the appearance is controlled by the site's CSS for the <hr> element. Where raw HTML is allowed you can inline-style an <hr>, but most platforms strip those styles.
Related Syntax
Headings
Learn how to create headings in Markdown with # symbols (ATX) or underlines (setext).
Blockquotes
Learn how to create blockquotes in Markdown with the > character, including multi-paragraph quotes, nested quotes, callouts/admonitions, and lazy continuation rules.
Bold
Learn how to make text bold in Markdown using double asterisks or underscores.
Related Tools
Markdown Cheat Sheet
Complete Markdown syntax reference with interactive examples
Online Markdown Editor
Write Markdown with a formatting toolbar, local autosave, callouts, math, diagrams, file open, and live preview
Markdown Formatter
Beautify Markdown drafts with table alignment, spacing cleanup, and list marker normalization