By definition, a redox reaction is one that entails changes in oxidation number (or oxidation state) for one or more of the elements involved. The oxidation number of an element in a compound is essentially an assessment of how the electronic environment of its atoms is different in comparison to atoms of the pure element. By this description, the oxidation number of an atom in an element is equal to zero. For an atom in a compound, the oxidation number is equal to the charge the atom would have in the compound if the compound were ionic. Consequential to these rules, the sum of oxidation numbers for all atoms in a molecule is equal to the charge on the molecule. To illustrate this formalism, examples from the two compound classes, ionic and covalent, will be considered.
Simple ionic compounds present the simplest examples to illustrate this formalism, since by definition the elements’ oxidation numbers are numerically equivalent to ionic charges. Sodium chloride, NaCl, is comprised of Na+ cations and Cl− anions, and so oxidation numbers for sodium and chlorine are, +1 and −1, respectively. Calcium fluoride, CaF2, is comprised of Ca2+ cations and F− anions, and so oxidation numbers for calcium and fluorine are, +2 and −1, respectively.
Covalent compounds require a more challenging use of the formalism. Water is a covalent compound whose molecules consist of two H atoms bonded separately to a central O atom via polar covalent O−H bonds. The shared electrons comprising an O−H bond are more strongly attracted to the more electronegative O atom, and so it acquires a partial negative charge in the water molecule (relative to an O atom in elemental oxygen). Consequently, H atoms in a water molecule exhibit partial positive charges compared to H atoms in elemental hydrogen. The sum of the partial negative and partial positive charges for each water molecule is zero, and the water molecule is neutral.
Imagine that the polarization of shared electrons within the O−H bonds of water were 100% complete—the result would be transfer of electrons from H to O, and water would be an ionic compound comprised of O2− anions and H+ cations. And so, the oxidations numbers for oxygen and hydrogen in water are −2 and +1, respectively. Applying this same logic to carbon tetrachloride, CCl4, yields oxidation numbers of +4 for carbon and −1 for chlorine. In the nitrate ion, $NO_3^-$, the oxidation number for nitrogen is +5 and that for oxygen is −2, summing to equal the 1− charge on the molecule:
$$(\text{1 N atom})\left(\frac{+5}{\text{N atom}}\right)+(\text{3 O atoms})\left(\frac{-2}{\text{O atom}}\right)=(+5)+(-6)=-1$$