The differentiation effect of a solvent on the equilibrium of five- and six-membered heterocyclic β-keto esters and β-diketones containing =O, =S, =SO, =NR, =NRHC1, and -S-C(R)2-S-fragments and, for comparison, on the equilibrium of aliphatic and carbocyclic β-keto esters and β-diketones was studied. The differentiating effect of a solvent is explained by different kinds of solvation of the heteroatomic fragments in the ketone and enol forms of heterocyclic β-dicarbonyl compounds.