The high-pressure phase transition behaviors and pressure-dependent compressibility are investigated on K2X(CO3)2 using first-principles calculation from ambient pressure to 30 GPa. The reversible structural phase transitions of K2X(CO3)2 are determined based on enthalpy difference and cell volume collapses. The pressure point of structural phase transitions of K2Ca(CO3)2 is obtained at around 3.3 GPa and 10.3 GPa, while that is found at about 6.2 GPa and 22.6 GPa for K2Mg(CO3)2. Compared with the high axial rigidity of C-O bonds in [CO3] groups, the Ca+ and Mg+ coordination polyhedron show much more compressible. The displacement behavior of the Ca+ and Mg+ coordination polyhedron occurs simultaneously with the rotation behavior of [CO3] groups during compression, and reverses induced by the structural phase transition.