The Mg grain boundary diffusion coefficients were measured in forsterite aggregates as a function of pressure (1 atm and 13 GPa), temperature (1100–1300 K), water content (<1–350 wt. ppm bulk water), and oxygen fugacity (10-18–10-0.7 bar) using a multi-anvil apparatus and a gas-mixing furnace. The diffusion profiles were analyzed by secondary ion mass spectrometer, whereas the water contents in the samples were measured by Fourier transform infrared spectrometer. The activation volume, activation enthalpy, water content exponent, and oxygen fugacity exponent for the Mg grain-boundary diffusion coefficients are found to be 3.9 ± 0.7 cm3/mol, 355 ± 25 kJ/mol, 1.0 ± 0.1, and –0.02 ± 0.01, respectively. By comparison with the Mg lattice diffusion data (Fei et al. 2018), the bulk diffusivity of Mg in forsterite is dominated by lattice diffusion if the grain size is larger than ∼1 mm under upper mantle conditions, whereas effective grain-boundary and lattice diffusivities are comparable when the grain size is ∼1–100 μm.