when to use UL or OL in html?

UL means "unordered list". OL means "ordered list".

UL gets you bullet points. OL gets you numbers.

Definitely not interchangable.


In math terms (hey, why not?), an <ol> represents a sequence, whereas <ul> represents a set. Rearranging the items in an ordered list changes the list's meaning. Rearranging them in an unordered list does not.

This is a good rule-of-thumb for which type of list to use. If changing the order of the items makes the list incorrect, you want to use <ol>. If the order doesn't matter, use <ul>.