Now to calculate the oxidation number of an element in a particular compound you should remember the following rules
1. The oxidation number of all the atoms in their respective elementary states is taken to be zero.
2. The oxidation number of oxygen is -2 in all compounds but in peroxides like hydrogen peroxide, sodium peroxide it is -1.
3. In halides, the oxidation number of halogens is -1.
4. In sulfides, the oxidation number of sulfur is -2.
5. The oxidation number of an ion is the same as its charge.
6. The sum of the oxidation numbers of all atoms in the formula of the compound is always zero.
7. The oxidation number of alkali metals is +1 where alkaline earth elements have oxidation state +2.
8. Elements of groups 4, 5, 6 and 7 show a variety of oxidation number. when you consider transition elements, variation in the oxidation number is large.
9. The oxidation number of metal in carbonyl complex is always zero.
10. Noble gases generally do not form compounds hence their oxidation number is zero.