Skip to content

Markdown Nested Lists and Indentation Rules

TL;DR

What it is

A nested list is a list inside another list item. Markdown uses indentation to decide whether new lines belong to the current list item, a child list, a continuation paragraph, or a code block.

Why it matters

Nested lists are one of the most common places beginners get surprised by Markdown parsing. Learning the indentation logic once saves a lot of trial and error later.

Syntax

1. Parent item
   - Child item
   - Child item

- Parent bullet
  1. Child number
  2. Child number

Minimal example

Source

1. First item
   - First nested item
   - Second nested item

What it does

This renders one ordered-list item containing a nested unordered list.

More examples

Example 1: Nested bullets under a numbered item

1. First list item
   - First nested list item
     - Second nested list item
2. Second list item

What it does

The nested bullets belong to the first numbered item because they are indented under its content.

Example 2: Continuation paragraph plus nested list

- Parent item

  This paragraph still belongs to the same list item.

  - Nested item
  - Another nested item

What it does

The paragraph and the nested list are both part of the same parent list item.

Example 3: Mixed list types

- Outline
  1. First numbered child
  2. Second numbered child

What it does

A parent bullet can contain a numbered child list when that child list is indented correctly.

Common pitfalls

Portability and platform notes

FAQ

How many spaces do I indent a nested list?

There is no one-size-fits-all answer that works as a teaching rule for every case. The safest beginner habit is to indent until the child marker sits under the content of the parent item and then preview the result.

Why did my nested list turn into a code block?

Because your indentation crossed into code-block territory for that context. Reduce the indentation and recheck the preview.

Can I mix numbered and bulleted lists?

Yes. A bullet list can contain a numbered list, and a numbered list can contain a bullet list, as long as the child list is indented as a child of the parent item.

Practice

Related topics

References