The ground state electronic structures of the actinide oxides AO, A2O3 and AO2 (A=U, Np, Pu, Am, Cm, Bk, Cf) are determined from first-principles calculations, using the self-interaction corrected local spin-density (SIC-LSD) approximation. Emphasis is put on the degree of f-electron localization, which for AO2 and A2O3 is found to follow the stoichiometry, namely corresponding to A 4+ ions in the dioxide and A 3+ ions in the sesquioxides. In contrast, the A 2+ ionic configuration is not favorable in the monoxides, which therefore become metallic. The energetics of the oxidation and reduction of the actinide dioxides is discussed, and it is found that the dioxide is the most stable oxide for the actinides from Np onwards. Our study reveals a strong link between preferred oxidation number and degree of localization which is confirmed by comparing to the ground state configurations of the corresponding lanthanide oxides. The ionic nature of the actinide oxides emerges from the fact that only those compounds will form where the calculated ground state valency agrees with the nominal valency expected from a simple charge counting.