Markdown List Nesting

Last updated: 2026-10-14

List Nesting CommonMark core

A child list indented to the parent item's text start nests: typically 2 spaces under -, 3 under 1.. Nesting is where most list bugs live — one space off and the structure changes.

GroupEdge Cases & Rules
Spec levelCommonMark core
Spec versionCommonMark 0.31.2 + GFM

📝 Syntax

- parent
  - child (2 spaces)

▶ Live Example

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

💡 Key points

⚠️ Warning Keep a blank line above a top-level list or some parsers will not see a block.
💡 Tip Mnemonic: count characters after the parent marker — 2 for -, 3 for 1.

❓ FAQ

Q Can unordered nest ordered?
A Yes — indentation decides, marker type does not.
Q How deep can nesting go?
A No hard limit, but past three levels switch to headings.
Q Why is my nesting not working?
A Almost always indentation: too few spaces, mixed tabs, or a missing blank line.

📚 See also

Unordered ListsCommonMark core Ordered ListsCommonMark core Indented Code BlocksCommonMark 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%

🙏 帮我们做得更好

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

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