My confusion regarding Hydrogen peroxide In Hydrogen peroxide, the oxidation number of oxygen is "-1" instead of "-2".



But it seems to me that, the oxygen atoms have '-2' as their oxidation number as each oxygen atom here is connected to a hydrogen atom and an oxygen atom.

So, what's actually happening here?

If there's any problem in my question please inform me. Thanks!
Each oxygen atom is connected to a hydrogen atom(which develops -1 charge on oxygen and +1 on hydrogen) and to another $\textbf{oxygen}$ atom which contributes no charge to both(0 and 0). Similar for other oxygen atom. Hence oxygen state of each oxygen atom is -1 and for each hydrogen atom it is +1.

In general, in peroxide linkage, oxygen has -1 oxidation state