MgFe2(PO4)2 crystallizes in the triclinic P1 space group. Mg(1) is bonded to one O(3), one O(4), one O(5), one O(6), and one O(8) atom to form distorted MgO5 trigonal bipyramids that share corners with two equivalent P(1)O4 tetrahedra, corners with three equivalent P(2)O4 tetrahedra,  a cornercorner with one Fe(2)O5 trigonal bipyramid, corners with two equivalent Fe(1)O5 trigonal bipyramids, and  an edgeedge with one Fe(2)O5 trigonal bipyramid. There are two inequivalent Fe sites. In the first Fe site, Fe(1) is bonded to one O(1), one O(2), one O(3), one O(5), and one O(7) atom to form FeO5 trigonal bipyramids that share corners with two equivalent P(2)O4 tetrahedra, corners with three equivalent P(1)O4 tetrahedra, corners with two equivalent Mg(1)O5 trigonal bipyramids, and  an edgeedge with one Fe(2)O5 trigonal bipyramid. In the second Fe site, Fe(2) is bonded to one O(2), one O(4), one O(6), one O(7), and one O(8) atom to form distorted FeO5 trigonal bipyramids that share corners with two equivalent P(1)O4 tetrahedra, corners with three equivalent P(2)O4 tetrahedra,  a cornercorner with one Mg(1)O5 trigonal bipyramid,  an edgeedge with one Mg(1)O5 trigonal bipyramid, and  an edgeedge with one Fe(1)O5 trigonal bipyramid. There are two inequivalent P sites. In the first P site, P(1) is bonded to one O(1), one O(3), one O(4), and one O(7) atom to form PO4 tetrahedra that share corners with two equivalent Mg(1)O5 trigonal bipyramids, corners with two equivalent Fe(2)O5 trigonal bipyramids, and corners with three equivalent Fe(1)O5 trigonal bipyramids. In the second P site, P(2) is bonded to one O(2), one O(5), one O(6), and one O(8) atom to form PO4 tetrahedra that share corners with two equivalent Fe(1)O5 trigonal bipyramids, corners with three equivalent Mg(1)O5 trigonal bipyramids, and corners with three equivalent Fe(2)O5 trigonal bipyramids. There are eight inequivalent O sites. In the first O site, O(1) is bonded in a bent 120 degrees geometry to one Fe(1) and one P(1) atom. In the second O site, O(2) is bonded in a 3-coordinate geometry to one Fe(1), one Fe(2), and one P(2) atom. In the third O site, O(3) is bonded in a trigonal planar geometry to one Mg(1), one Fe(1), and one P(1) atom. In the fourth O site, O(4) is bonded in a 3-coordinate geometry to one Mg(1), one Fe(2), and one P(1) atom. In the fifth O site, O(5) is bonded in a trigonal planar geometry to one Mg(1), one Fe(1), and one P(2) atom. In the sixth O site, O(6) is bonded in a trigonal planar geometry to one Mg(1), one Fe(2), and one P(2) atom. In the seventh O site, O(7) is bonded in a distorted trigonal planar geometry to one Fe(1), one Fe(2), and one P(1) atom. In the eighth O site, O(8) is bonded in a 3-coordinate geometry to one Mg(1), one Fe(2), and one P(2) atom.
MgFe2(PO4)2 crystallizes in the triclinic P1 space group. Mg(1) is bonded to one O(3), one O(4), one O(5), one O(6), and one O(8) atom to form distorted MgO5 trigonal bipyramids that share corners with two equivalent P(1)O4 tetrahedra, corners with three equivalent P(2)O4 tetrahedra,  a cornercorner with one Fe(2)O5 trigonal bipyramid, corners with two equivalent Fe(1)O5 trigonal bipyramids, and  an edgeedge with one Fe(2)O5 trigonal bipyramid. The Mg(1)-O(3) bond length is 2.06 Å. The Mg(1)-O(4) bond length is 2.01 Å. The Mg(1)-O(5) bond length is 2.05 Å. The Mg(1)-O(6) bond length is 2.15 Å. The Mg(1)-O(8) bond length is 2.25 Å. There are two inequivalent Fe sites. In the first Fe site, Fe(1) is bonded to one O(1), one O(2), one O(3), one O(5), and one O(7) atom to form FeO5 trigonal bipyramids that share corners with two equivalent P(2)O4 tetrahedra, corners with three equivalent P(1)O4 tetrahedra, corners with two equivalent Mg(1)O5 trigonal bipyramids, and  an edgeedge with one Fe(2)O5 trigonal bipyramid. The Fe(1)-O(1) bond length is 2.01 Å. The Fe(1)-O(2) bond length is 2.14 Å. The Fe(1)-O(3) bond length is 2.14 Å. The Fe(1)-O(5) bond length is 2.15 Å. The Fe(1)-O(7) bond length is 2.08 Å. In the second Fe site, Fe(2) is bonded to one O(2), one O(4), one O(6), one O(7), and one O(8) atom to form distorted FeO5 trigonal bipyramids that share corners with two equivalent P(1)O4 tetrahedra, corners with three equivalent P(2)O4 tetrahedra,  a cornercorner with one Mg(1)O5 trigonal bipyramid,  an edgeedge with one Mg(1)O5 trigonal bipyramid, and  an edgeedge with one Fe(1)O5 trigonal bipyramid. The Fe(2)-O(2) bond length is 2.18 Å. The Fe(2)-O(4) bond length is 2.19 Å. The Fe(2)-O(6) bond length is 2.12 Å. The Fe(2)-O(7) bond length is 2.09 Å. The Fe(2)-O(8) bond length is 2.22 Å. There are two inequivalent P sites. In the first P site, P(1) is bonded to one O(1), one O(3), one O(4), and one O(7) atom to form PO4 tetrahedra that share corners with two equivalent Mg(1)O5 trigonal bipyramids, corners with two equivalent Fe(2)O5 trigonal bipyramids, and corners with three equivalent Fe(1)O5 trigonal bipyramids. The P(1)-O(1) bond length is 1.53 Å. The P(1)-O(3) bond length is 1.56 Å. The P(1)-O(4) bond length is 1.56 Å. The P(1)-O(7) bond length is 1.57 Å. In the second P site, P(2) is bonded to one O(2), one O(5), one O(6), and one O(8) atom to form PO4 tetrahedra that share corners with two equivalent Fe(1)O5 trigonal bipyramids, corners with three equivalent Mg(1)O5 trigonal bipyramids, and corners with three equivalent Fe(2)O5 trigonal bipyramids. The P(2)-O(2) bond length is 1.56 Å. The P(2)-O(5) bond length is 1.55 Å. The P(2)-O(6) bond length is 1.56 Å. The P(2)-O(8) bond length is 1.57 Å. There are eight inequivalent O sites. In the first O site, O(1) is bonded in a bent 120 degrees geometry to one Fe(1) and one P(1) atom. In the second O site, O(2) is bonded in a 3-coordinate geometry to one Fe(1), one Fe(2), and one P(2) atom. In the third O site, O(3) is bonded in a trigonal planar geometry to one Mg(1), one Fe(1), and one P(1) atom. In the fourth O site, O(4) is bonded in a 3-coordinate geometry to one Mg(1), one Fe(2), and one P(1) atom. In the fifth O site, O(5) is bonded in a trigonal planar geometry to one Mg(1), one Fe(1), and one P(2) atom. In the sixth O site, O(6) is bonded in a trigonal planar geometry to one Mg(1), one Fe(2), and one P(2) atom. In the seventh O site, O(7) is bonded in a distorted trigonal planar geometry to one Fe(1), one Fe(2), and one P(1) atom. In the eighth O site, O(8) is bonded in a 3-coordinate geometry to one Mg(1), one Fe(2), and one P(2) atom.