The oxidation state of hydrogen is +1 in all of its compounds (except in metallic hydride)
The oxidation state of Na and Mg is +1 and +2 respectively while the oxidation state of oxygen is −2 (except peroxides and OF2 ).
The oxidation state of N in NH3 is x+3(+1)=0 x=−3
The oxidation state of N in HNO3 is 1+x+3(−2)=0 x=5
The oxidation state of N in NaN3 is +1+3x=0 x=−1/3
The oxidation state of N in Mg3N2 is 3(2)+2x=0 6+2x=0 2x=−6 x=−3
Hence, three molecules (ie, NH3,NaN3,Mg3N2)
have negative oxidation state