Need AI Training/Help?CloudYeti.io/meet
MarkdownMe
Practical Markdown Guide

How to Write Nested Lists in Markdown

Indent a nested Markdown list beneath its parent item with spaces, commonly two or four spaces depending on the parser and marker width. Use a new list marker at the indented level, such as `-` or `1.`. Keep continuation lines aligned with the child content, and place a blank line before a nested block only when the renderer requires or supports it. Markdown list indentation rules vary, so preview the exact output.

Basic nested-list structure

A nested list belongs inside a parent list item. Start the parent with a marker, then indent the child marker under the parent content. A common pattern is `- Parent`, followed by four spaces and `- Child`. The exact minimum indentation depends on the width of the parent marker and the parser's rules. Four spaces are widely readable, but some processors accept two spaces for a hyphen list. Keep sibling items at the same indentation level. A child that begins too far left can become a new top-level item, while a child that begins too far right can become a code block or fail to join the list. Use a consistent marker style within each level.

Mix ordered and unordered lists

You can place an unordered list inside an ordered item or an ordered list inside an unordered item. For example, an ordered task can contain `- Detail one` and `- Detail two`. When an ordered list is nested, many Markdown renderers use the source marker only to identify the list and generate sequential numbering in HTML. Some systems preserve explicit numbering or apply extensions, so check the target platform. A blank line before the nested list can improve readability, but it may require extra indentation to remain inside the parent item. Continuation paragraphs must align with the text after the parent marker. Code blocks inside list items require careful indentation and often behave differently between parsers.

Fix indentation and readability problems

The most common error is inconsistent indentation. Count spaces from the start of the line and compare each child with its siblings. Do not use tabs unless the project defines how tabs expand, because editors and parsers can calculate tab width differently. Keep nesting shallow. Three or four levels can become difficult to scan, especially on mobile screens and in source files. If each item contains a complete sentence, use matching punctuation and capitalization. If the list represents steps, keep the order meaningful and do not rely only on automatic numbering. Preview lists after formatting, conversion, or linting because tools can reindent markers and change whether blank lines remain inside the parent item.

How do you do it step by step?

  1. 1Write the parent list item with a consistent marker.
  2. 2Indent the child marker beneath the parent content using spaces, usually four.
  3. 3Keep sibling children aligned and use a consistent marker at that level.
  4. 4Align continuation paragraphs and code carefully with the relevant list content.
  5. 5Render the document and correct any child items that appear at the wrong level.

Working example

This example combines an ordered list with an unordered list nested under the second step.

Input
`1. Install the application\n2. Configure the account\n    - Set the account name\n    - Add an approved email\n3. Test the connection`
Result
The page displays three numbered steps. The second step contains two indented bullet items that remain part of that step.

Four spaces before each child marker make the relationship clear in many CommonMark-compatible processors. Test two-space indentation if your platform uses that convention.

Frequently asked questions

How many spaces indent a nested Markdown list?
Four spaces are a clear, portable convention for many documents, but the required amount depends on the parent marker and parser. Follow the target renderer's rules.
Can an ordered list contain bullet points?
Yes. Indent the bullet list under the ordered item so it remains part of that item. Preview the result because blank lines can change required indentation.
Why does my nested item become a code block?
The indentation may be too deep or may not match the parser's list continuation rules. Compare the child position with the parent content and remove unnecessary spaces.
Should I use tabs for nested lists?
Avoid tabs unless the project specifies their expansion. Spaces produce more predictable results across editors, linters, converters, and Markdown processors.

Official references