In this study, we present the results of a search for new stable structures of SrC O and BaC O in the pressure range of 0-100 GPa based on the density functional theory and crystal structure prediction approaches. We have shown that the recently synthesized pyrocarbonate structure SrC O - is thermodynamically stable for both SrC O and BaC O . Thus, SrC O - is stable relative to decomposition reaction above 10 GPa, while the lower-pressure stability limit for BaC O - is 5 GPa, which is the lowest value for the formation of pyrocarbonates. For SrC O , the following polymorphic transitions were found with increasing pressure: at 40 GPa and 1000 K, at 90 GPa and 1000 K. SrC O - and SrC O - are characterized by the framework and layered structures of [CO ] tetrahedra, respectively. For BaC O , with increasing pressure, decomposition of BaC O - into BaCO and CO is observed at 34 GPa without any polymorphic transitions.