Equations describing the rate of vertical thinning of sandstones due to precipitation of quartz cement produced at stylolites are derived for constant temperature and for a linear temperature change. All temperature histories can be approximated by a series of linear segments, and the equations therefore enable the diagenetic thinning of sandstones undergoing quartz cementation to be calculated as a function of temperature history. Application of the equations to interbedded sandstone–shale sequences indicate that for heating rates and geothermal gradients commonly encountered in sedimentary basins, thermally driven diagenesis leads to cumulative rates of sandstone thinning in the range of 1–10 m Ma−1. This implies that when effects of thermally driven shale diagenesis, mechanical compaction and isostatic adjustment are taken into account, thermochemical diagenetic thinning may explain a large proportion of the total generation of accommodation space in many basins. The equations describing the rate of sandstone volume reduction and, therefore, rate of fluid expulsion, could also be utilized for calculating overpressure development.