What is the oxidation state of oxygen in Na2O2? I am asked to determine what is the O.S. of oxygen in $\ce{Na2O2}$

I was under the impression that oxygen had a charge of -2 and I multiplied that charge by 2 giving me a total of -4. 

However, the computer program I am using, states that I am wrong. Can someone clarify why?
Oxygen can take multiple oxidation states. This particular compound is sodium peroxide.

You're right that usually oxygen has a charge of -2, but in this case, there's no way that each $\ce{Na}$ can have an oxidation state of +2.

So you then work backwards, deciding if it's $\ce{Na+}$ then you have +2 from the sodium, and oxygen must have an average oxidation number of -1 per oxygen atom.

Besides peroxides ($\ce{O2^{2-}}$) there are also superoxides ($\ce{O2^{-}}$).

It's not surprising that these compounds are usually very reactive.