Markdown Indent Syntax
How to indent lists, code blocks, and blockquotes in Markdown. Covers the spacing rules that prevent indents from turning into code blocks and the platform quirks that change how they render.
Unordered List Indentation
Indent child items by at least two spaces so the child marker lines up with the start of the parent item's text. Siblings at the same level must use the same indent.
- Fruits
- Apple
- Banana
- Vegetables
- Carrot
- Broccoli- Fruits
- Apple
- Banana
- Vegetables
- Carrot
- Broccoli
Ordered List Indentation
Ordered-list markers take more horizontal space, so nested items need more indentation. CommonMark accepts three spaces as the minimum; four spaces works in almost every parser.
1. Phase one
1. Task A
2. Task B
2. Phase two
1. Task C- Phase one
- Task A
- Task B
- Phase two
- Task C
1. Project plan
- Research
- Design
- Build
2. Launch plan
- Marketing
- Support- Project plan
- Research
- Design
- Build
- Launch plan
- Marketing
- Support
Code Block Indentation
Indent every line of a code block by four spaces. This is CommonMark's original code-block syntax and still works everywhere. Fence the block with triple backticks if you want a language hint or want to avoid counting spaces.
A normal paragraph.
function hello() {
return "indented code block"
}
Another normal paragraph.A normal paragraph.
function hello() {
return "indented code block"
}
Another normal paragraph.
Blockquote Indentation
Blockquotes use the > character as an indent. Add another > to nest one level deeper. You can stack as many as you need.
> Outer quote
> > Inner quote
> > > Deepest quoteOuter quote
Inner quote
Deepest quote
Multi-paragraph List Items
To add a second paragraph under a list item, leave a blank line after the first paragraph, then indent the continuation to match the start of the first line's text.
- First paragraph of this item.
Second paragraph stays part of the same item.
Indent it so Markdown knows it belongs here.
- Second itemFirst paragraph of this item.
Second paragraph stays part of the same item.
Indent it so Markdown knows it belongs here.Second item
1. Item one.
Continuation paragraph under item one.
Four spaces keep it part of the numbered item.
2. Item two.Item one.
Continuation paragraph under item one.
Four spaces keep it part of the numbered item.Item two.
Visual First-line Indents
Standard Markdown has no syntax for first-line paragraph indentation. Leading spaces are ignored, and four or more spaces create a code block. If you truly need a visual indent, use HTML entities.
Standard Markdown has no paragraph-indent syntax.
This line starts with two non-breaking spaces.
 This line starts with an em-space indent.Standard Markdown has no paragraph-indent syntax.
This line starts with two non-breaking spaces.
This line starts with an em-space indent.
Common Mistakes
Indentation errors usually come down to inconsistent spacing, confusing code-block indentation with paragraph indentation, or stopping a list item too early.
Broken
- Parent
- ChildFixed
- Parent
- ChildBroken
1. Parent
- ChildFixed
1. Parent
- ChildBroken
Some text.
I wanted an indent, not code.Fixed
Some text.
No paragraph indentation in Markdown. Use a blockquote, list, or HTML entity if you need visual offset.Broken
- Item one.
- Continuation of item one.Fixed
- Item one.
Continuation of item one.Quick Reference
| Syntax | Result | Notes |
|---|---|---|
| - item - child | Nested bullet | 2 spaces under a dash item |
| 1. item - child | Nested under ordered | 3 minimum, 4 safer |
| code line | Indented code block | 4 or more spaces |
| > quote > > nested | Nested blockquote | Extra > per level |
| /   | Visual indent | HTML entity fallback |
Platform Support
Most document renderers follow CommonMark indentation rules. Chat apps handle spacing differently.
| Platform | Supported? | Notes |
|---|---|---|
| GitHub | Yes | Follows CommonMark for nested lists and code-block indentation. Tabs can unexpectedly create code blocks. |
| GitLab | Yes | Same CommonMark-compatible behavior as GitHub. |
| VS Code preview | Yes | Renders nested lists, indented code blocks, and blockquotes per CommonMark. |
| Obsidian | Yes | Live Preview handles most indentation; ordered-list nesting is safest with 4 spaces. |
| Notion | Partial | Pasting Markdown usually converts indentation into native nested blocks. Live Markdown typing is limited. |
| Reddit (new) | Yes | Nested lists and blockquotes render; 4-space indents create code blocks. |
| Reddit (old) | Partial | Basic indentation works; complex nesting is less reliable than new Reddit. |
| Discord | Partial | Nested dash lists work with 2-space indentation. Ordered-list nesting is inconsistent. |
| Slack | Partial | mrkdwn only supports single-level asterisk bullets. No indentation or nesting syntax. |
| CommonMark | Yes | Defines list indentation, 4-space code blocks, and blockquote nesting. |
| Docusaurus / VitePress / Astro | Yes | Remark-based parsers handle indentation the same way as CommonMark. |
Frequently Asked Questions
How do I indent in Markdown?
Markdown indentation is structural, not visual. Indent nested list items so their markers line up under the parent's text. Indent lines by four spaces to create a code block. Add extra > characters to nest blockquotes. For visual first-line paragraph indents that the spec does not support, use HTML entities like a non-breaking space.
How do you indent a nested list in Markdown?
For unordered lists, indent the child marker by two spaces under a dash item. For ordered lists, indent by three spaces minimum; four spaces is safer because the number marker is wider. Keep all sibling items at the same indent so the parser builds the right tree.
Why does my Markdown indent turn into a code block?
If a line is indented by four or more spaces and is not inside a list item, Markdown treats it as an indented code block. Tabs count as well. Either use fewer spaces for structural indentation or wrap code in triple backticks so the intent is explicit.
How do I indent a paragraph inside a list item?
Add a blank line after the first paragraph, then indent the continuation paragraph to the same column as the start of the first line's text. For a dash list, two spaces is usually enough; for a numbered list, four spaces is the safest choice.
Does Markdown support first-line paragraph indentation?
No. Markdown ignores leading spaces inside paragraphs unless there are enough to form a code block. To add a visual first-line indent, use HTML entities such as a non-breaking space or an em space. Avoid relying on them for semantic structure, and test with screen readers if accessibility matters.
How do I create a nested blockquote in Markdown?
Start each quoted line with >. For a nested quote, add a second >: > > nested quote. You can nest deeper by adding more > characters. Some writers keep a space between them for readability; parsers accept both styles.
Do tabs work for indentation in Markdown?
Tabs are converted to spaces by the parser, but the exact width depends on the renderer. Because tab behavior is inconsistent across editors and platforms, use spaces for indentation in any Markdown you share.
Do Slack and Discord support nested lists and indentation?
Discord supports nested dash lists with two-space indentation. Slack's mrkdwn does not support nested lists or indentation at all; it only renders single-level bullets using asterisks. In both chat apps, Shift+Enter inserts a new line inside the composer, but that is not Markdown indentation.
Related Markdown Guides
Indentation touches lists, code blocks, blockquotes, and line breaks. Explore the surrounding syntax: