Now let us make this idea sharper. Oxidation number (ON) is not a real charge, it is an imaginary charge we assign by pretending that every covalent bond is completely ionic. The more electronegative atom gets the negative charge. This bookkeeping helps us track who lost electrons and who gained.
The rules are like traffic rules, easy once you remember. Free element is 0 like Na, O2, P4. Ion's ON = its charge like Na+ is +1, O2- is -2. Oxygen is -2 generally, but in peroxides like H2O2 it is -1, in superoxide KO2 it is -1/2, and in OF2 it is +2. Hydrogen is +1 normally but -1 in metal hydrides. Fluorine is always -1. Alkali metals +1, alkaline earth +2. And most important - sum of ON in a neutral molecule is 0, in an ion it equals ion charge.
Just see how useful this is. In KMnO4, K is +1, O four times -2 = -8, so Mn must be +7 to make sum zero. That huge +7 tells you it can strongly oxidise others!
Revision: ON = imaginary ionic charge. Rules: free element 0, ion charge = ON, O = -2 (H₂O₂ -1, KO₂ -1/2, OF₂ +2), H = +1 (-1 in hydrides), F = -1 always, alkali +1, alkaline +2. Sum neutral = 0, sum in ion = charge. Ex: KMnO₄ → Mn is +7.
Quick Revision Box
- Free 0 ion=charge O -2 except peroxide -1 superoxide -1/2 OF2 +2
- H +1/-1 F -1 alkali +1 alkaline +2 sum 0
- KMnO4 Mn+7