Markdown Horizontal Line: Syntax, Dividers and Rules

To create a horizontal line (thematic break) in Markdown, place three or more hyphens (---), asterisks (***), or underscores (___) on a line by themselves surrounded by blank lines.

Syntax Code Snippet
Section 1 content above the divider.

---

Section 2 content separated by the horizontal line.
Rendered HTML Output Preview

Section 1 content above the divider.


Section 2 content separated by the horizontal line.

Platform Compatibility & Differences

GitHub (GFM):

Supported. Always leave a blank line before `---` to avoid turning the previous line into an H2 header!

Discord Chat:

Hyphens (`---`) do NOT create a horizontal divider in Discord chat.

Reddit:

Supported with `---` separated by blank lines in standard Markdown.

Jupyter Notebooks:

Renders an `<hr>` element dividing notebook cells.

How to Use Markdown Horizontal Line

  1. Copy the ready-to-use Horizontal Line syntax snippet below.
  2. Inspect the rendered live preview in both light and dark themes.
  3. Review platform compatibility differences for GitHub, Discord, Reddit, and Jupyter notebooks.
  4. Check common pitfalls and copy formatted snippets directly.

Practical Examples

Horizontal Line Syntax Pattern

Horizontal rules visually divide distinct sections, chapters, or thoughts in a document.

Input:
Section 1 content above the divider.

---

Section 2 content separated by the horizontal line.
Output:
Rendered visual format

Common Mistakes & Troubleshooting

  • Putting `---` directly under text without a blank line, which turns the previous text into a Level 2 Heading (Setext header)!
  • Using fewer than three characters.

Frequently Asked Questions

Why did my text turn huge after adding `---`?

In Markdown, hyphens directly underneath text without an empty line create a Setext Heading 2. Add an empty blank line before `---` to fix this.