Ab initio calculations detailed in open-access publication: Jackson, A. J. & Walsh, A. Oxidation of GaN: An ab initio thermodynamic approach. Phys. Rev. B 88, 165201 (2013). MATLAB code written by AJJ Thermochemical data from literature is cited where it appears in the code, and in the paper.