Diagenesis (pronunciation: /ˌdaɪəˈdʒɛnəsɪs/) is the change of sediments or existing sedimentary rocks into a different sedimentary rock during and after rock formation (lithification), at temperatures and pressures less than that required for the formation of metamorphic rocks. It does not include changes from weathering. It is any chemical, physical, or biological change undergone by a sediment after its initial deposition, after its lithification. This process excludes surface alteration (weathering) and metamorphism. These changes happen at relatively low temperatures and pressures and result in changes to the rock's original mineralogy and texture. There is no sharp boundary between diagenesis and metamorphism, but the latter occurs at higher temperatures and pressures than the former. Hydrothermal solutions, meteoric groundwater, porosity, permeability, solubility, and time are all influential factors.
After deposition, sediments are compacted as they are buried beneath successive layers of sediment and cemented by minerals that precipitate from solution. Grains of sediment, rock fragments and fossils can be replaced by other minerals during diagenesis. Porosity usually decreases during diagenesis, except in rare cases such as dissolution of minerals and dolomitization.
The study of diagenesis in rocks is used to understand the geologic history they have undergone and the nature and type of fluids that have circulated through them. From a commercial standpoint, such studies aid in assessing the likelihood of finding various economically viable mineral and hydrocarbon deposits.