Markdown Line Breaks

Last updated: 2026-10-14

Line Breaks CommonMark core

Line breaks inside a paragraph are ignored by default. Three ways to force one: two trailing spaces, a trailing backslash, or a <br> tag. Easy to forget, useful everywhere.

GroupBasic: Block
Spec levelCommonMark core
Spec versionCommonMark 0.31.2 + GFM

📝 Syntax

Two trailing spaces
or a trailing backslash \

▶ Live Example

Edit Markdown on the left, see the result on the right

💡 Key points

⚠️ Warning Trailing spaces are invisible and some editors strip them on save — the backslash is safer.
ℹ️ Note In GFM a hard break renders as <br>; strict CommonMark renders a soft break as a space.

❓ FAQ

Q Why does pressing Enter not break the line?
A A single Enter is a soft break that merges; use two trailing spaces or a backslash.
Q Line break or new paragraph?
A Use breaks for compact content like poems or addresses; paragraphs for independent ideas.
Q Do all renderers support backslash breaks?
A CommonMark 0.29+ supports it; some older renderers do not — test first.

📚 See also

ParagraphsCommonMark core Hard & Soft BreaksCommonMark core
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏