# Oxidation number oxygen

This exception is in effect here, because $\ce{BaO2}$ is a peroxide consisting of $\ce{Ba^{2+}}$ and $\ce{O2^{2-}}$ ions. The oxidation number of Ba is +II, and the oxidation number of each of the oxygens in the peroxide anion is -I. This fits with the charge of the peroxide anion ($2 \times -1 = -2$), and as $\ce{BaO2}$ is a neutral compound, the sum of all oxidation numbers is 0. Moreover, there are even more exceptions to the rule of thumb cited above, for example, the superoxide radical anion $\ce{O2-}$ with a fractional oxidation numer of $-\frac{1}{2}$, or the dioxygenyl cation $\ce{O2+}$ with a formal oxidation number of $+\frac{1}{2}$ for each oxygen.