Articles
Published · December 4, 2026

Markdown Numbered Lists: Why Your Numbers Restart or Skip

Markdown reads only the first number of a numbered list. Learn why lists restart at 1, split in two, or won't start, and how to fix each case.

Also in: Español中文हिन्दी

Markdown looks only at the first number in a numbered list. Every later number is ignored, so a list that "restarts" or "skips" in the preview was either split into two lists or never began as a list at all. Both come down to a handful of rules. Learn them and the numbers stop surprising you.

Only the first number counts

The numbers you type after the first one are decoration. John Gruber's original Markdown documentation says it plainly: "the actual numbers you use to mark the list have no effect on the HTML output Markdown produces". These three lists render identically:

1. Bird
2. McHale
3. Parish

1. Bird
1. McHale
1. Parish

3. Bird
1. McHale
8. Parish

The CommonMark spec states the rule in one sentence: the start number is set by the first item, and the numbers of later items are disregarded. GitHub's GFM spec keeps the same rule.

Gruber still suggests starting a lazily numbered list with 1, because original Markdown might one day support other start numbers. CommonMark already does.

Start a list at another number

Type the number you want on the first item:

5. Fifth step
6. Sixth step

CommonMark renders that as an ordered list with start="5". Leading zeros are fine (003. starts at 3), and a start number can be at most nine digits. If your preview shows 1, 2, 3 anyway, the renderer ignores start numbers. That's a renderer limit, not a mistake in your file.

Why a list restarts or splits

When numbers appear to restart, the list was cut in two, and the second half begins at whatever number its first item carries. Three causes cover almost every case.

The delimiter changed. A list is a run of items with the same marker type, and for ordered lists that means the same delimiter, either . or ). The spec's own example is a list that begins 1. and 2. and then switches to 3): the result is two lists, and the second starts at 3. Mixing the two styles is the classic way to split a list by accident.

Something between the items wasn't indented enough. A paragraph, code block or quote only belongs to an item if it is indented far enough. If it isn't, it ends the list, and the next 2. begins a new list that starts at 2. Here the code block is flush left, so it breaks the list:

1. Install the tool.

brew install example


2. Run it.

Indent the fence so it sits under the item text and the list stays whole. The indentation rules are in the next section.

Four spaces before the marker. A line indented four or more spaces is a code block, not a list item. If a number shows up as literal text in monospace, four spaces mean code. A similar split happens in a bullet list when you change bullet markers partway through.

Indent nested content to the item text

The spec says the position of the text after the marker decides how much indentation the following blocks need. With 1. plus a space, the text starts at column 3, so continuation blocks need three spaces. Many writers use 1. followed by two spaces and indent four, which also works.

Wider markers need more. Take 10): a nested bullet needs four spaces to nest, and three spaces split it into an ordered list followed by a separate bullet list.

10) Deploy
    - Check the logs

Original Markdown asked for four spaces or one tab for extra paragraphs in an item. Four spaces is a safe habit in either dialect, and it is easy to see in a monospaced editor. If tabs and spaces are mixed in your file, see how CommonMark reads a tab.

A working example with a paragraph and a code block under one item:

1. Install the tool.

   Use the package manager:

   ```
   brew install example
   ```

2. Run it.

Now the second item continues the same list, so the count carries on.

A wrapped line can turn into a list, or refuse to

Paragraph text can start with a number too. A line that begins with 1986. What a great season. looks like a list item to a parser. Gruber's fix is to escape the period with a backslash:

1986\. What a great season.

The opposite happens in the middle of a paragraph. CommonMark lets a list interrupt a paragraph only when it starts with 1, so that a hard-wrapped line such as `14. The number of doors is 6.` stays paragraph text. A line starting with 1. in the same position does become a list. If you wrap prose by hand, keep this in mind, and read soft versus hard wrapping for what a newline does.

Quick checks when numbers look wrong

  • Use one delimiter, . or ), for the whole list.
  • Indent anything between items to where the item text starts.
  • Don't indent a marker by four spaces or more.
  • Start the list with the number you want shown; later numbers don't matter.
  • Escape a period after a number when it is just text: 1986\..
  • Put a blank line before a list that starts above 1, or it may stay paragraph text.

How Carets fits in

Numbering problems are indentation problems, and they are easiest to catch in plain text you can see clearly. Carets is a fast, native notes and code editor for iPhone, iPad, and Mac. It handles Markdown and plain text with syntax highlighting, so list markers and fenced code are easy to tell apart from the surrounding prose. Your notes stay plain files, organized into files, projects, and tags, so a list you fix once looks the same in any other Markdown tool.

Get Carets on the App Store for iPhone, iPad, and Mac.

Frequently Asked Questions

Does Markdown care what numbers I type in an ordered list?

Only the first one. The start number comes from the first item and the numbers of later items are disregarded, so 1. 1. 1. and 1. 2. 3. render the same list.

How do I start a Markdown list at 5?

Type 5. on the first item. CommonMark renders it as an ordered list with start="5". Some minimal renderers ignore the start number, so check yours.

Why does my numbered list start over after a code block?

Usually the code block or paragraph in between was not indented far enough to belong to the item, so it ended the list. Indent it to the column where the item text starts.

How do I write a year like 1986. at the start of a line without making a list?

Backslash-escape the period: 1986\. What a great season.