Early stage amorphous precursors provide a low energy pathway for carbonate mineralization. Many natural deposits of carbonate minerals and biogenic calcium carbonate (both amorphous and crystalline) include significant amounts of Mg. To understand the role of magnesium-containing amorphous precursors in carbonate mineralization, we investigated the energetics and structure of synthetic amorphous Ca–Mg carbonates with composition Ca1−xMgxCO3·nH2O (0⩽x⩽1) using isothermal acid solution calorimetry and synchrotron X-ray scattering experiments with pair distribution function (PDF) analysis. Amorphous magnesium carbonate (AMC with x=1) is energetically more metastable than amorphous calcium carbonate (ACC with x=0), but it is more persistent (crystallizing in months rather than days under ambient conditions), probably due to the slow kinetics of Mg2+ dehydration. The Ca1−xMgxCO3·nH2O (0⩽x⩽1) system forms a continuous X-ray amorphous series upon precipitation and all intermediate compositions are energetically more stable than a mixture of ACC and AMC, but metastable with respect to crystalline carbonates. The amorphous system can be divided into two distinct regions. For x=0.00–0.47, thermal analysis is consistent with a homogeneous amorphous phase. The less metastable compositions of this series, with x=0.0–0.2, are frequently found in biogenic carbonates. If not coincidental, this may suggest that organisms take advantage of this single phase low energy amorphous precursor pathway to crystalline biogenic carbonates. For x⩾0.47, energetic metastability increases and thermal analysis hints at nanoscale heterogeneity, perhaps of a material near x=0.5 coexisting with another phase near pure AMC (x=1). The most hydrated amorphous phases, which occur near x=0.5, are the least metastable, and may be precursors for dolomite formation.