K2Mg(CoO2)2 crystallizes in the monoclinic Cm space group. There are two inequivalent K sites. In the first K site, K(1) is bonded in a 5-coordinate geometry to one O(2), two equivalent O(3), and two equivalent O(4) atoms. In the second K site, K(2) is bonded in a 7-coordinate geometry to two equivalent O(1), two equivalent O(2), and three equivalent O(3) atoms. Mg(1) is bonded to one O(1), one O(3), and two equivalent O(4) atoms to form MgO4 tetrahedra that share corners with two equivalent Mg(1)O4 tetrahedra, corners with three equivalent Co(2)O4 tetrahedra,  a cornercorner with one Co(1)O4 trigonal pyramid, and edges with two equivalent Co(1)O4 trigonal pyramids. There are two inequivalent Co sites. In the first Co site, Co(1) is bonded to one O(1), one O(4), and two equivalent O(3) atoms to form distorted CoO4 trigonal pyramids that share  a cornercorner with one Mg(1)O4 tetrahedra, corners with two equivalent Co(1)O4 trigonal pyramids,  an edgeedge with one Co(2)O4 tetrahedra, and edges with two equivalent Mg(1)O4 tetrahedra. In the second Co site, Co(2) is bonded to one O(1), one O(4), and two equivalent O(2) atoms to form CoO4 tetrahedra that share corners with two equivalent Co(2)O4 tetrahedra, corners with three equivalent Mg(1)O4 tetrahedra, and  an edgeedge with one Co(1)O4 trigonal pyramid. There are four inequivalent O sites. In the first O site, O(1) is bonded in a 5-coordinate geometry to two equivalent K(2), one Mg(1), one Co(1), and one Co(2) atom. In the second O site, O(2) is bonded in a 5-coordinate geometry to one K(1), two equivalent K(2), and two equivalent Co(2) atoms. In the third O site, O(3) is bonded in a 3-coordinate geometry to two equivalent K(1), three equivalent K(2), one Mg(1), and two equivalent Co(1) atoms. In the fourth O site, O(4) is bonded in a 6-coordinate geometry to two equivalent K(1), two equivalent Mg(1), one Co(1), and one Co(2) atom.
K2Mg(CoO2)2 crystallizes in the monoclinic Cm space group. There are two inequivalent K sites. In the first K site, K(1) is bonded in a 5-coordinate geometry to one O(2), two equivalent O(3), and two equivalent O(4) atoms. The K(1)-O(2) bond length is 2.78 Å. Both K(1)-O(3) bond lengths are 2.94 Å. Both K(1)-O(4) bond lengths are 2.86 Å. In the second K site, K(2) is bonded in a 7-coordinate geometry to two equivalent O(1), two equivalent O(2), and three equivalent O(3) atoms. Both K(2)-O(1) bond lengths are 2.81 Å. Both K(2)-O(2) bond lengths are 2.72 Å. There are two shorter (3.04 Å) and one longer (3.21 Å) K(2)-O(3) bond length. Mg(1) is bonded to one O(1), one O(3), and two equivalent O(4) atoms to form MgO4 tetrahedra that share corners with two equivalent Mg(1)O4 tetrahedra, corners with three equivalent Co(2)O4 tetrahedra,  a cornercorner with one Co(1)O4 trigonal pyramid, and edges with two equivalent Co(1)O4 trigonal pyramids. The Mg(1)-O(1) bond length is 1.93 Å. The Mg(1)-O(3) bond length is 2.10 Å. Both Mg(1)-O(4) bond lengths are 1.99 Å. There are two inequivalent Co sites. In the first Co site, Co(1) is bonded to one O(1), one O(4), and two equivalent O(3) atoms to form distorted CoO4 trigonal pyramids that share  a cornercorner with one Mg(1)O4 tetrahedra, corners with two equivalent Co(1)O4 trigonal pyramids,  an edgeedge with one Co(2)O4 tetrahedra, and edges with two equivalent Mg(1)O4 tetrahedra. The Co(1)-O(1) bond length is 1.91 Å. The Co(1)-O(4) bond length is 2.11 Å. Both Co(1)-O(3) bond lengths are 2.01 Å. In the second Co site, Co(2) is bonded to one O(1), one O(4), and two equivalent O(2) atoms to form CoO4 tetrahedra that share corners with two equivalent Co(2)O4 tetrahedra, corners with three equivalent Mg(1)O4 tetrahedra, and  an edgeedge with one Co(1)O4 trigonal pyramid. The Co(2)-O(1) bond length is 2.04 Å. The Co(2)-O(4) bond length is 2.17 Å. Both Co(2)-O(2) bond lengths are 2.00 Å. There are four inequivalent O sites. In the first O site, O(1) is bonded in a 5-coordinate geometry to two equivalent K(2), one Mg(1), one Co(1), and one Co(2) atom. In the second O site, O(2) is bonded in a 5-coordinate geometry to one K(1), two equivalent K(2), and two equivalent Co(2) atoms. In the third O site, O(3) is bonded in a 3-coordinate geometry to two equivalent K(1), three equivalent K(2), one Mg(1), and two equivalent Co(1) atoms. In the fourth O site, O(4) is bonded in a 6-coordinate geometry to two equivalent K(1), two equivalent Mg(1), one Co(1), and one Co(2) atom.