Convert HTML Ordered Lists to Markdown Numbered Lists

Convert HTML <ol> and <li> elements to Markdown numbered lists. Includes start attribute handling, reversed lists, nested ordered lists, and number formatting.

Lists & Tables

Detailed Explanation

HTML Ordered Lists to Markdown

HTML ordered lists (<ol> with <li> children) convert to Markdown numbered lists using 1., 2., 3. notation.

Basic Ordered List

<ol>
  <li>Clone the repository</li>
  <li>Install dependencies</li>
  <li>Run the dev server</li>
</ol>

Converts to:

1. Clone the repository
2. Install dependencies
3. Run the dev server

Start Attribute

HTML supports starting an ordered list at a number other than 1 using the start attribute:

<ol start="5">
  <li>Fifth step</li>
  <li>Sixth step</li>
</ol>

In CommonMark, the first number determines the start value:

5. Fifth step
6. Sixth step

Many converters respect the start attribute and begin numbering accordingly.

Nested Ordered and Unordered Lists

<ol>
  <li>First step
    <ul>
      <li>Detail A</li>
      <li>Detail B</li>
    </ul>
  </li>
  <li>Second step
    <ol>
      <li>Sub-step 1</li>
      <li>Sub-step 2</li>
    </ol>
  </li>
</ol>

Converts to:

1. First step
   - Detail A
   - Detail B
2. Second step
   1. Sub-step 1
   2. Sub-step 2

Indentation aligns with the content start of the parent list item (typically 3-4 spaces for numbered lists).

Lazy Numbering

Some converters output all items as 1. (lazy numbering) because Markdown auto-numbers sequentially:

1. Clone the repository
1. Install dependencies
1. Run the dev server

This is valid Markdown and renders correctly, but explicit numbering is generally preferred for readability.

Reversed Lists

HTML supports <ol reversed>, but Markdown has no equivalent. Reversed lists are typically converted with standard ascending numbers, and a note may be added.

Use Case

Ordered list conversion is essential for step-by-step tutorials, installation guides, API documentation, and procedural content. Correct handling of the start attribute and nesting ensures that instructions remain sequentially accurate after migration.

Try It — HTML to Markdown

Open full tool