An HTML ordered list is used to group items where the order matters. Items are displayed with numbers by default, making them ideal for steps, rankings, and sequences.
Use the <ol> tag to create an ordered list. Each item goes inside an <li> tag:
<ol>
<li>Preheat the oven</li>
<li>Mix the ingredients</li>
<li>Pour into baking pan</li>
<li>Bake for 30 minutes</li>
</ol>
Result:
Use the type attribute on <ol> to change the numbering style:
| Value | Description | Example |
|---|---|---|
1 | Numbers (default) | 1. 2. 3. |
A | Uppercase letters | A. B. C. |
a | Lowercase letters | a. b. c. |
I | Uppercase Roman numerals | I. II. III. |
i | Lowercase Roman numerals | i. ii. iii. |
<ol type="A">
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
Result:
Use start to begin numbering from a specific number other than 1:
<ol start="5">
<li>Fifth item</li>
<li>Sixth item</li>
<li>Seventh item</li>
</ol>
Result:
The reversed attribute counts down instead of up:
<ol reversed>
<li>Gold medal</li>
<li>Silver medal</li>
<li>Bronze medal</li>
</ol>
Result:
You can nest ordered or unordered lists inside each other:
<ol>
<li>Frontend Development
<ol type="a">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ol>
</li>
<li>Backend Development
<ol type="a">
<li>PHP</li>
<li>Python</li>
</ol>
</li>
</ol>
type attribute on <ol> is for semantic type only. For complex visual styling, use the CSS list-style-type property instead.
<ol> for instructions, recipes, step-by-step tutorials, and ranking lists where sequence is meaningful. Never use <ol> just to get numbers on screen — if order doesn't matter, use <ul>.