Skip to main content

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.

Nested unordered list
- Fruits
  - Apple
  - Banana
- Vegetables
  - Carrot
  - Broccoli
Preview
  • Fruits
    • Apple
    • Banana
  • Vegetables
    • Carrot
    • Broccoli
Use spaces, not tabs. Tabs are interpreted differently across editors and can push a line past the 4-space code-block threshold by accident.

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.

Nested ordered list
1. Phase one
   1. Task A
   2. Task B
2. Phase two
   1. Task C
Preview
  1. Phase one
    1. Task A
    2. Task B
  2. Phase two
    1. Task C
Unordered items inside an ordered list
1. Project plan
   - Research
   - Design
   - Build
2. Launch plan
   - Marketing
   - Support
Preview
  1. Project plan
    • Research
    • Design
    • Build
  2. 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.

Indented code block
A normal paragraph.

    function hello() {
      return "indented code block"
    }

Another normal paragraph.
Preview

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.

Nested blockquotes
> Outer quote
> > Inner quote
> > > Deepest quote
Preview

Outer 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.

Unordered list with a continuation paragraph
- First paragraph of this item.

  Second paragraph stays part of the same item.
  Indent it so Markdown knows it belongs here.

- Second item
Preview
  • First paragraph of this item.

    Second paragraph stays part of the same item.
    Indent it so Markdown knows it belongs here.

  • Second item

Ordered list with a continuation paragraph
1. Item one.

   Continuation paragraph under item one.
   Four spaces keep it part of the numbered item.

2. Item two.
Preview
  1. Item one.

    Continuation paragraph under item one.
    Four spaces keep it part of the numbered item.

  2. 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.

HTML entity indents
Standard Markdown has no paragraph-indent syntax.

  This line starts with two non-breaking spaces.

 This line starts with an em-space indent.
Preview

Standard Markdown has no paragraph-indent syntax.

  This line starts with two non-breaking spaces.

 This line starts with an em-space indent.

Accessibility note: Screen readers often read each non-breaking space or em space as “space.” Do not use HTML entity indentation for structure; use it only when the visual design truly requires it.

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
 - Child

Fixed

- Parent
  - Child
Siblings at the same nesting level must use the same indent. One space is not enough; the child marker needs to line up with the start of the parent's text.

Broken

1. Parent
  - Child

Fixed

1. Parent
   - Child
For ordered lists, the content starts later than with a dash list. Use at least three spaces (four is safer) to indent a nested item under a number.

Broken

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.
Four or more leading spaces after a blank line create an indented code block. Markdown ignores smaller leading spaces inside paragraphs.

Broken

- Item one.

- Continuation of item one.

Fixed

- Item one.

  Continuation of item one.
A new list marker at the same column starts a brand-new item. Indent continuation paragraphs so they stay inside the previous item.

Quick Reference

SyntaxResultNotes
- item - childNested bullet2 spaces under a dash item
1. item - childNested under ordered3 minimum, 4 safer
code lineIndented code block4 or more spaces
> quote > > nestedNested blockquoteExtra > per level
  /  Visual indentHTML entity fallback

Platform Support

Most document renderers follow CommonMark indentation rules. Chat apps handle spacing differently.

PlatformSupported?Notes
GitHubYesFollows CommonMark for nested lists and code-block indentation. Tabs can unexpectedly create code blocks.
GitLabYesSame CommonMark-compatible behavior as GitHub.
VS Code previewYesRenders nested lists, indented code blocks, and blockquotes per CommonMark.
ObsidianYesLive Preview handles most indentation; ordered-list nesting is safest with 4 spaces.
NotionPartialPasting Markdown usually converts indentation into native nested blocks. Live Markdown typing is limited.
Reddit (new)YesNested lists and blockquotes render; 4-space indents create code blocks.
Reddit (old)PartialBasic indentation works; complex nesting is less reliable than new Reddit.
DiscordPartialNested dash lists work with 2-space indentation. Ordered-list nesting is inconsistent.
SlackPartialmrkdwn only supports single-level asterisk bullets. No indentation or nesting syntax.
CommonMarkYesDefines list indentation, 4-space code blocks, and blockquote nesting.
Docusaurus / VitePress / AstroYesRemark-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: