The X3Σ?g , A'3?u, A3Σ+u , 13Πg, and B3Σ?u electronic states of oxygen molecule (O2) are calculated by the multi-configuration self-consisted filed (MRCI)+Q method with the scalar relativistic correction and core–valence correlation correction. The obtained spectroscopic constants of the low-lying bound states are in excellent agreement with measure-ments. Based on the accurately calculated structure parameters, the opacities of the oxygen molecule at the temperaturesof 1000 K, 2000 K, 2500 K, and 5000 K under a pressure of 100 atm (1 atm=1.01325×105 Pa) and the partition functionsbetween 10 K and 104 K are obtained. It is found that with the increase of temperature, the opacities for transitions in a long wavelength range are enlarged because of the larger population on excited electronic states at the higher temperatures.