Sacrificial anodes have been broadly deployed in electro-synthesis for the development of reductive electrosynthetic reactions. The metal cations released from sacrificial anodes during these processes are widely believed to not affect reaction outcomes. Here, we disclose an electrochemical deutero-(di)carboxylation of acetylenes and cinnamic acids that in fact relies on anodically generated Mg2+cations to achieve regioselective α-carboxylation to afford deuterated malonic acids with precise control over both the site and amount of deuteration. The unusual, beneficial role of Mg2+ cations on product selectivity is supported by mechanistic studies and density functional theory [ZORA-B3LYP-D3BJ/def2-TZVP/DMF(SMD)] calculations, and is believed to mimic enzymatic α-carboxylation mechanisms. The deuteration patterns in the malonic acid products can be precisely controlled, providing a platform for the concise synthesis of high-value β–d₂– and β–d₁–α-amino acid analogs, as well as other precisely deuterated frameworks.