How Do You Make a Horizontal Line in Markdown?
And why your --- became a heading
A horizontal line in Markdown (the divider straight across the page) is three or more dashes, asterisks, or underscores on their own line: ---, ***, or ___. That is the whole rule.
The catch is that --- has a second job. Put it directly under a line of text and Markdown turns that text into a heading instead of drawing a line. Same three characters, two very different results, which is why this trips people up.
This page is about the horizontal divider and that heading trap. If your problem is a new line that will not break inside a paragraph, that is a different thing, covered in why your Markdown line breaks are not working.
How to make a horizontal line
- Put three or more of the same character on a line by itself:
---,***, or___. - Leave a blank line above and below it.
- All three render the same horizontal rule. There is no visual difference in the output.
If you are just getting started with these symbols, how to write Markdown covers the basics.
Why your --- turned into a heading (the Setext trap)
Markdown has two heading styles. One uses # in front. The other, called a Setext heading, underlines the text with = (for a top-level heading) or - (for a second-level heading). So this:
Some text here.
--- is not a line of text followed by a divider. Markdown reads it as one thing: the text Some text here. as a heading, underlined by the dashes. The fix is simply to separate them with a blank line.
Symptoms and fixes
| What you see | Why | Fix |
|---|---|---|
| Your --- shows as a line across the page | It has a blank line above and below | Nothing to fix, that is correct |
| The text above --- became a big heading | --- is directly under text, so it is read as a Setext heading underline | Put a blank line between the text and the --- |
| You wanted a divider but nothing renders | Missing blank lines, or fewer than three characters | Use three or more on their own line, blank line before and after |
Side by side, the correct divider and the trap look like this:
Correct divider (blank line above and below):
Some text here.
---
More text here.
The trap (--- right under text becomes a heading):
Some text here.
--- Two easy habits avoid the whole problem: always leave a blank line above your ---, or use *** for dividers, since only --- doubles as a heading underline.
See it render, live, in NoteLoom
The fastest way to catch this is to watch it render. NoteLoom is an editor that reads and writes local .md files in the browser: type your --- in the source view and the live and reading views show the result at once, so you can see whether it became a divider or a heading and adjust the blank line on the spot.
NoteLoom follows CommonMark, so what you see matches how most Markdown tools behave. To be clear about the boundaries: it has no AI, it just renders and saves your local Markdown.
How you use it: open app.noteloom.cc in Chrome / Edge / Arc, mount a local folder, and write in the source view while the live view shows the rendered page. Saved straight to your disk, no cloud, no account.
FAQ
How do you make a horizontal line in Markdown?
Why did my --- turn into a heading instead of a line?
What is the difference between ---, ***, and ___?
Do I need blank lines around a horizontal rule?
Is a horizontal line the same as a line break?
Can I check this in NoteLoom?
Watch your --- render, in a second
Open NoteLoom in Chrome / Edge / Arc, mount a local folder, and type --- in the source view while the live view shows whether it drew a divider or a heading. Saved straight back to your disk, no software to install and no account to sign up for.