Since pressure induces exotic chemical and physical properties of materials, investigation of the high-pressure effect on structural phase transition and the related properties is paramount. Structural phase transitions and electronic properties of Li2O2 and Na2O2 under high pressure were investigated using first-principles calculations based on the density functional theory. Structural phase transitions of Li2O2 up to 500 GPa were predicted at ~75 GPa from the P63/mmc to the P21 structures and at ~136 GPa from the P21 to the P21/c structures. The calculated�band gaps of all phases increase with elevated pressure. At 11 and 40 GPa, the band gaps decrease, while the O-O bond lengths and the electron localization function (ELF) values increase, resulting in the O-O stretching mode softening. Structural phase transitions of Na2O2 up to 300 GPa were investigated with elevated temperature�up to 600 K based on the quasi-harmonic approximation. Two new phases were predicted consisting of the Amm2 and the P21/c structures, which are stable at low temperatures in the 0-22 and 22-28 GPa pressure ranges, respectively. At the elevated temperature, the P-62m and the�Pbam structures more favor temperature than the Amm2 and the�P21/c structures, respectively. In the 2-3 and 9-10 GPa pressure ranges, some phonon modes softening and some elastic stiffnesses decreasing result�in the phonon free energies�decreasing and the ELF values increasing. Their band gaps also increase with increasing pressure. High-pressure Raman measurements and Raman calculations for Na2O2 provide the evidence for the presence of an unidentified�structure at 8.6-21.5 GPa and the Pbam structure at 24.8 GPa. The calculated Gibbs free energy changes of the CO2 capture reactions by Li2O2 and Na2O2�suggest�that the reactions are spontaneous under high pressure�and temperature�studied.