MgEr2S4 crystallizes in the orthorhombic Cmc2_1 space group. Mg(1) is bonded to one S(1), one S(4), two equivalent S(2), and two equivalent S(3) atoms to form MgS6 octahedra that share corners with three equivalent Er(2)S6 octahedra, edges with two equivalent Mg(1)S6 octahedra, and edges with three equivalent Er(2)S6 octahedra. The corner-sharing octahedral tilt angles range from 10-54°. There are two inequivalent Er sites. In the first Er site, Er(1) is bonded in a 7-coordinate geometry to one S(2), two equivalent S(1), two equivalent S(3), and two equivalent S(4) atoms. In the second Er site, Er(2) is bonded to one S(3), one S(4), two equivalent S(1), and two equivalent S(2) atoms to form ErS6 octahedra that share corners with three equivalent Mg(1)S6 octahedra, edges with two equivalent Er(2)S6 octahedra, and edges with three equivalent Mg(1)S6 octahedra. The corner-sharing octahedral tilt angles range from 10-54°. There are four inequivalent S sites. In the first S site, S(1) is bonded to one Mg(1), two equivalent Er(1), and two equivalent Er(2) atoms to form distorted SEr4Mg trigonal bipyramids that share corners with two equivalent S(3)Er3Mg2 square pyramids, corners with six equivalent S(2)Er3Mg2 square pyramids, corners with five equivalent S(4)Er3Mg tetrahedra,  an edgeedge with one S(2)Er3Mg2 square pyramid, edges with three equivalent S(3)Er3Mg2 square pyramids,  an edgeedge with one S(4)Er3Mg tetrahedra, and edges with two equivalent S(1)Er4Mg trigonal bipyramids. In the second S site, S(2) is bonded to two equivalent Mg(1), one Er(1), and two equivalent Er(2) atoms to form SEr3Mg2 square pyramids that share corners with two equivalent S(3)Er3Mg2 square pyramids, corners with two equivalent S(4)Er3Mg tetrahedra, corners with six equivalent S(1)Er4Mg trigonal bipyramids, edges with two equivalent S(2)Er3Mg2 square pyramids, edges with three equivalent S(3)Er3Mg2 square pyramids, edges with two equivalent S(4)Er3Mg tetrahedra, and  an edgeedge with one S(1)Er4Mg trigonal bipyramid. In the third S site, S(3) is bonded to two equivalent Mg(1), one Er(2), and two equivalent Er(1) atoms to form SEr3Mg2 square pyramids that share corners with two equivalent S(2)Er3Mg2 square pyramids, corners with five equivalent S(4)Er3Mg tetrahedra, corners with two equivalent S(1)Er4Mg trigonal bipyramids, edges with two equivalent S(3)Er3Mg2 square pyramids, edges with three equivalent S(2)Er3Mg2 square pyramids,  an edgeedge with one S(4)Er3Mg tetrahedra, and edges with three equivalent S(1)Er4Mg trigonal bipyramids. In the fourth S site, S(4) is bonded to one Mg(1), one Er(2), and two equivalent Er(1) atoms to form SEr3Mg tetrahedra that share corners with two equivalent S(2)Er3Mg2 square pyramids, corners with five equivalent S(3)Er3Mg2 square pyramids, corners with two equivalent S(4)Er3Mg tetrahedra, corners with five equivalent S(1)Er4Mg trigonal bipyramids,  an edgeedge with one S(3)Er3Mg2 square pyramid, edges with two equivalent S(2)Er3Mg2 square pyramids, and  an edgeedge with one S(1)Er4Mg trigonal bipyramid.
MgEr2S4 crystallizes in the orthorhombic Cmc2_1 space group. Mg(1) is bonded to one S(1), one S(4), two equivalent S(2), and two equivalent S(3) atoms to form MgS6 octahedra that share corners with three equivalent Er(2)S6 octahedra, edges with two equivalent Mg(1)S6 octahedra, and edges with three equivalent Er(2)S6 octahedra. The corner-sharing octahedral tilt angles range from 10-54°. The Mg(1)-S(1) bond length is 2.65 Å. The Mg(1)-S(4) bond length is 2.54 Å. Both Mg(1)-S(2) bond lengths are 2.63 Å. Both Mg(1)-S(3) bond lengths are 2.63 Å. There are two inequivalent Er sites. In the first Er site, Er(1) is bonded in a 7-coordinate geometry to one S(2), two equivalent S(1), two equivalent S(3), and two equivalent S(4) atoms. The Er(1)-S(2) bond length is 3.05 Å. Both Er(1)-S(1) bond lengths are 2.90 Å. Both Er(1)-S(3) bond lengths are 2.78 Å. Both Er(1)-S(4) bond lengths are 2.69 Å. In the second Er site, Er(2) is bonded to one S(3), one S(4), two equivalent S(1), and two equivalent S(2) atoms to form ErS6 octahedra that share corners with three equivalent Mg(1)S6 octahedra, edges with two equivalent Er(2)S6 octahedra, and edges with three equivalent Mg(1)S6 octahedra. The corner-sharing octahedral tilt angles range from 10-54°. The Er(2)-S(3) bond length is 2.69 Å. The Er(2)-S(4) bond length is 2.69 Å. Both Er(2)-S(1) bond lengths are 2.74 Å. Both Er(2)-S(2) bond lengths are 2.68 Å. There are four inequivalent S sites. In the first S site, S(1) is bonded to one Mg(1), two equivalent Er(1), and two equivalent Er(2) atoms to form distorted SEr4Mg trigonal bipyramids that share corners with two equivalent S(3)Er3Mg2 square pyramids, corners with six equivalent S(2)Er3Mg2 square pyramids, corners with five equivalent S(4)Er3Mg tetrahedra,  an edgeedge with one S(2)Er3Mg2 square pyramid, edges with three equivalent S(3)Er3Mg2 square pyramids,  an edgeedge with one S(4)Er3Mg tetrahedra, and edges with two equivalent S(1)Er4Mg trigonal bipyramids. In the second S site, S(2) is bonded to two equivalent Mg(1), one Er(1), and two equivalent Er(2) atoms to form SEr3Mg2 square pyramids that share corners with two equivalent S(3)Er3Mg2 square pyramids, corners with two equivalent S(4)Er3Mg tetrahedra, corners with six equivalent S(1)Er4Mg trigonal bipyramids, edges with two equivalent S(2)Er3Mg2 square pyramids, edges with three equivalent S(3)Er3Mg2 square pyramids, edges with two equivalent S(4)Er3Mg tetrahedra, and  an edgeedge with one S(1)Er4Mg trigonal bipyramid. In the third S site, S(3) is bonded to two equivalent Mg(1), one Er(2), and two equivalent Er(1) atoms to form SEr3Mg2 square pyramids that share corners with two equivalent S(2)Er3Mg2 square pyramids, corners with five equivalent S(4)Er3Mg tetrahedra, corners with two equivalent S(1)Er4Mg trigonal bipyramids, edges with two equivalent S(3)Er3Mg2 square pyramids, edges with three equivalent S(2)Er3Mg2 square pyramids,  an edgeedge with one S(4)Er3Mg tetrahedra, and edges with three equivalent S(1)Er4Mg trigonal bipyramids. In the fourth S site, S(4) is bonded to one Mg(1), one Er(2), and two equivalent Er(1) atoms to form SEr3Mg tetrahedra that share corners with two equivalent S(2)Er3Mg2 square pyramids, corners with five equivalent S(3)Er3Mg2 square pyramids, corners with two equivalent S(4)Er3Mg tetrahedra, corners with five equivalent S(1)Er4Mg trigonal bipyramids,  an edgeedge with one S(3)Er3Mg2 square pyramid, edges with two equivalent S(2)Er3Mg2 square pyramids, and  an edgeedge with one S(1)Er4Mg trigonal bipyramid.