The linkage between the variation of the seawater Mg budget and the long-term carbon cycle can be elucidated by seawater Mg isotope composition (δ26Mg). However, obtaining primary seawater δ26Mg signatures from marine archives is challenging due to the widespread alteration of diagenesis. Aragonite, a common primary marine carbonate, can effectively record seawater δ26Mg but is prone to alteration and transformation into calcite during early diagenesis. Therefore, a comprehensive understanding of Mg isotope behavior during the aragonite–calcite transition is essential to enhance the applicability of aragonite δ26Mg. In this study, we investigate the variation of aragonite δ26Mg during diagenesis with a limited supply of Mg by conducting a series of well-controlled aragonite–calcite transition experiments in a closed system. The experimental conditions encompass temperatures of 60 and 90 °C, the presence of Ca and Na in the solution, varying Na concentrations, as well as the presence of calcite seed. Results demonstrate that the significant decrease of bulk carbonate δ26Mg is accompanied by a substantial amount of Mg released into the solution during the aragonite–calcite transition, and the amount of released Mg is controlled by fluid chemistry via altering Mg partitioning in calcite. Furthermore, Mg isotope fractionation during calcite precipitation is influenced by temperature, ionic strength, and the presence of calcite seed, while kinetics played a negligible role in our experiments. Combined with previous experiments, the temperature-dependent Mg isotope fractionation during calcite precipitation in unseeded experiments is Δ26Mgcal-sol = (−0.13 ± 0.06) × 106/T2 – (0.47 ± 0.68). This fractionation is systematically higher than that of seeded experiments by 0.3–0.6 ‰ from 15 to 90 °C and can mainly be attributed to differences in surface free energy between homogeneous and heterogeneous calcite nucleation. These findings offer fundamental understandings of the Mg isotope behavior during the aragonite–calcite transformation, providing useful insights for interpreting the variation of δ26Mg in experimental and natural carbonates and facilitating ancient seawater δ26Mg reconstruction.