Mg3(PO4)4 crystallizes in the cubic I-43m space group. There are two inequivalent Mg sites. In the first Mg site, Mg(1) is bonded to four equivalent O(1) atoms to form MgO4 tetrahedra that share corners with four equivalent P(1)O4 tetrahedra. All Mg(1)-O(1) bond lengths are 1.84 Å. In the second Mg site, Mg(2) is bonded to four equivalent O(3) atoms to form MgO4 tetrahedra that share corners with four equivalent P(1)O4 tetrahedra. All Mg(2)-O(3) bond lengths are 1.75 Å. P(1) is bonded to one O(2), one O(3), and two equivalent O(1) atoms to form PO4 tetrahedra that share  a cornercorner with one Mg(2)O4 tetrahedra and corners with two equivalent Mg(1)O4 tetrahedra. The P(1)-O(2) bond length is 1.51 Å. The P(1)-O(3) bond length is 1.54 Å. Both P(1)-O(1) bond lengths are 1.53 Å. There are three inequivalent O sites. In the first O site, O(2) is bonded in a single-bond geometry to one P(1) atom. In the second O site, O(3) is bonded in a bent 150 degrees geometry to one Mg(2) and one P(1) atom. In the third O site, O(1) is bonded in a bent 150 degrees geometry to one Mg(1) and one P(1) atom. Linkers: 24 [O]P([O])([O])=O. Metal clusters: 18 [Mg]. The MOF has largest included sphere 10.40 A, density 0.96 g/cm3, surface area 3604.72 m2/g, accessible volume 0.71 cm3/g