Skip to the page
html reference · lists

HTML <ol> / <li> tags

closing tag
required (both)
void element
no
lives inside
<body>
typically holds
one or more <li> items

Where it goes

Same shape as <ul>: <ol> wraps the <li> items, in the order they should appear.

Example

<ol>
  <li>Preheat the oven.</li>
  <li>Mix the batter.</li>
</ol>

Open this example in the editor →

Common mistakes

  • Using <ol> when order does not matter. That is <ul>.
  • Typing the numbers yourself, like "1. Preheat." The browser adds its own, so you get "1. 1. Preheat."
  • Splitting one list into several <ol>s with text between. The numbering restarts at 1 each time. Keep it one list, or use the start attribute.

Related

Updated 24 October 2026. Practice it in the html route, or read more on MDN.