As discussed earlier in the topic the prefix “di-“ means two.
When a molecule is made up from only two atoms it is described as diatomic. Diatomic molecules can be either compounds or elements.
Remember:
an element is a substance made up of only one type of atom, for example oxygen and,
a compound is a substance made from two or more different elements which are joined together chemically, for example carbon monoxide.
Both oxygen and carbon monoxide are diatomic as they have two atoms in the formula for their molecules.
There are seven elements in which the atoms always pair up (they do not exist singly by themselves).
These are called diatomic elements. When we write the symbols for these elements we must write "2" at the end for example H2.
The seven diatomic elements are: Hydrogen, Nitrogen, Oxygen, Fluorine, Chlorine, Bromine and Iodine. You will need to remember these. Acronyms such as BINCHOF or HINClBrOF can sometimes help you to remember.
You only need to think about elements being diatomic when they are not in compounds. We work out the formula the normal way when we think about compounds. For example:
The formula for chlorine as an element is Cl2 but the formula for sodium chloride is NaCl not NaCl2.