This dataset contains relevant data for the paper "Comparative analysis of surface phase diagrams in aqueous environment: implicit vs explicit solvation models" (J. Chem. Phys. 160, (2024); doi: 10.1063/5.0190304). It consists of two files. dft_data.tar.gz contains the raw DFT data, which is created with pyiron and vasp. phase_diagram.tar.gz contains the pandas table which summarizes the data and the jupyter notebook used to create the figures. The pandas tables and jupyter notebooks can also be found on github: https://github.com/eisenforschung/Mg-surface-phase-diagram.