A first-principles technique capable of describing the state accurately near to excited states of semiconductors and insulators, namely the modified Becke-Johnson (mBJ) exchange potential approximation is used to investigate the opto-electronic response of magnesium spinel oxides: MgAl 2O 4 and MgGa 2O 4. The predicted bandgaps using the mBJ exchange approximation show a significant improvement over previous theoretical work using the common LDA and GGA, and are very closer to the experimental results. Band gap dependent optical parameters, like dielectric constant, index of refraction, reflectivity and optical conductivity are calculated and analyzed. The static dielectric constant and refractive index of MgGa 2O 4 are much larger than that of MgAl 2O 4. Refractive index drops below unity for higher energy photons, higher than 17 eV, show that the velocities of incident photons are greater than the velocity of light. However, these overlook can be explained by the fact that a signal must be transmitted as a wave packet rather than monochromatic wave. Moreover, the peak positions of the calculated optical parameters move down to low energies when the value of the band gap decreases. This comprehensive theoretical study of the optoelectronic properties predicts that these materials can be effectively used in the optical devices working in major part of the spectrum. © 2012 Elsevier B.V. All rights reserved.