The crystal structures of magnesium hydrogen citrate dihydrate, Mg(HC6H5O7)(H2O)2, (I), and bis(dihydrogen citrato)magnesium, Mg(H2C6H5O7)2, (II), have been solved and refined using synchrotron X-ray powder diffraction data, and optimized using density functional techniques. In (I), the citrate anion occurs in the trans, trans-conformation, and triply chelates to the Mg cation. In (II), the citrate anion is trans, gauche, and doubly chelates to the Mg cation. In both compounds the Mg cation coordination polyhedron is an octahedron. In (I), the MgO6 coordination polyhedra are isolated, while in (II), they share edges to form chains. Strong O—H...O hydrogen bonds are prominent in the two structures, as well as in the previously reported magnesium citrate decahydrate.