To constrain the Mg isotopic composition of the oceanic mantle, investigate Mg isotope fractionation of abyssal peridotites during seafloor alteration, and assess Mg budget in the oceans, a suite of 32 abyssal peridotite samples from the Gakkel Ridge and Southwest Indian Ridge (SWIR) was, for the first time, selected for high-precision Mg isotope analyses. Although most of these samples are extensively altered, largely by serpentinization and weathering, primary olivine, diopside and enstatite grains are preserved in some samples. Olivine grains from the least altered samples have ?26Mg varying from ?0.30 to ?0.12‰ (n = 7), whereas enstatite and diopside have ?26Mg varying from ?0.27 to ?0.16‰ (n = 7), and from ?0.23 to ?0.09‰ (n = 6), respectively. Whole-rock ?26Mg values range from ?0.24 to 0.03‰ with an average of ?0.12 ± 0.13‰ (2SD, n = 32). Strongly serpentinized peridotites have lower average ?26Mg values (?26Mg = ?0.19 ± 0.07‰, 2SD, n = 7) than weathering-dominated ones (?26Mg = ?0.10 ± 0.12‰, 2SD, n = 25). Calculated Mg isotopic compositions of fresh mantle peridotites vary from ?0.29 to ?0.13‰, beyond the previously reported range of the subcontinental lithospheric mantle (?0.25 ± 0.04‰) and the analytical uncertainty (±0.07‰, 2SD). Our study therefore indicates that the oceanic mantle may have similar but slightly heterogeneous Mg isotopic compositions to that of subcontinental lithospheric mantle. Secondary serpentinization does not fractionate Mg isotopes of abyssal peridotites, whereas low-T weathering and formation of clay can result in the enrichment of heavy Mg isotopes in abyssal peridotites. This study also demonstrates that fluid-rock interaction does not necessarily produce rocks with intermediate Mg isotopic compositions. Magnesium isotopes of the rocks thereafter are dependent on the secondary minerals formed. We also conclude that the release of light Mg isotopes into the ocean during alteration of abyssal peridotites can be an important influx of Mg for the seawater Mg budget. Abyssal peridotites with a heavy Mg isotopic signature can be recycled into the mantle in subduction zones and may thus result in heterogeneous Mg isotopic compositions of the oceanic mantle and heavy Mg isotopic compositions of arc magmas.