A thermodynamically complete ab initio equation of state (EOS) for MgO was obtained using electron density functional theory and the quasiharmonic phonon approximation, and adjusted to match the ambient density. This EOS was demonstrated to be consistent with isotherm, thermal expansivity, heat capacity and melting curve measured in static experiments, and reproduced density and temperature measurements under shock wave loading of bulk and porous periclase. The Grüneisen parameter of periclase at a given density was shown to be weakly dependent on temperature. The B1–B2 phase change was calculated to occur near 320 GPa on the principal Hugoniot. The melting locus of periclase, relevant to the Earth's lower mantle pressures, was predicted to be accessible by shock wave loading of porous periclase, which could also put pressure and temperature bounds on B1–B2 transitions.