When sediment is compacted and cemented together, it turns into sedimentary rock. This transformation, called lithification, is how loose sand, mud, silt, and gravel become solid stone like sandstone, shale, and conglomerate. The process unfolds over millions of years as layers of sediment pile up, squeeze together, and get glued in place by minerals carried through groundwater.
How Compaction Works
Compaction is the simpler of the two processes. As new layers of sediment accumulate on top of older ones, the weight of the overlying material pushes down on everything beneath it. This overburden pressure forces individual grains closer together, squeezing out water and air trapped in the tiny spaces (called pore spaces) between them. The deeper the burial, the greater the pressure, and the tighter the grains pack.
The effect is dramatic in fine-grained sediments like mud and clay. Freshly deposited mud can start with a porosity around 46%, meaning nearly half its volume is just water-filled space. Under sustained pressure, that porosity can drop to 23% or lower, and at extreme depths it may fall below 2%. The grains physically rearrange themselves into tighter configurations, and the sediment shrinks considerably in volume. Coal beds, for example, represent organic material compressed to just 5 to 10% of its original thickness.
Coarser sediments like sand compact less efficiently because their rounded, rigid grains resist rearrangement. Sand grains don’t deform as easily under pressure, so they retain more pore space even at depth. This is one reason sandstones typically need cementation to become solid rock, while shale can form largely through compaction alone.
How Cementation Binds Grains Together
Cementation is the chemical half of lithification. Groundwater flowing through the remaining pore spaces between grains carries dissolved minerals. As conditions change (shifts in temperature, pressure, or water chemistry), those minerals precipitate out of the water and coat the grain surfaces. Over time, these mineral coatings grow thick enough to fill pore spaces and physically glue neighboring grains together.
Three types of natural cement are most common. Calcite, the same mineral that makes up limestone, is the most widespread cementing agent and forms readily in warm, shallow marine environments. Silica precipitates from groundwater as it rises toward the surface, creating an extremely hard, durable cement found in many sandstones. Iron oxides give cemented rocks a distinctive reddish or yellowish color and are common in sediments deposited in oxygen-rich environments. These cements often have a completely different mineral composition than the grains they’re binding together.
Under a microscope, you can see how cement changes a rock’s texture. Mineral crystals grow outward from the surface of each grain, forming what geologists call overgrowths. These overgrowths gradually fill the open spaces between grains, reducing both the porosity and the permeability of the rock. A loosely packed sand that once let water flow freely through it becomes a tight, solid sandstone.
The Rocks That Result
The type of rock that forms depends on the size and composition of the original sediment grains.
- Shale forms from compacted clay and silt. It’s one of the most common sedimentary rocks on Earth, and compaction does most of the work since the tiny, flat clay particles pack together tightly under pressure.
- Sandstone forms when sand-sized grains are cemented together. Because sand grains don’t compact as efficiently, cementation is the critical step. Quartz sandstone, made almost entirely of cemented quartz grains, is especially durable.
- Siltstone falls between shale and sandstone, formed from silt particles slightly larger than clay but smaller than sand.
- Conglomerate forms when rounded pebbles and cobbles are cemented together, often with finer sediment filling the gaps between them.
- Breccia forms the same way as conglomerate, but from angular, sharp-edged rock fragments rather than rounded ones.
All of these are clastic sedimentary rocks, meaning they’re built from broken pieces of pre-existing rocks that were weathered, transported, deposited, and then lithified.
Why It Takes So Long
Lithification is not a fast process. Most sandstones and shales require major water loss, significant compaction, and chemical cementation to become strong rock, all of which involve considerable time. Deep-ocean sediments accumulate at an average rate of about 0.01 millimeters per year. At that pace, an 800-meter-thick deposit of ocean-floor sediment represents roughly 80 million years of accumulation, and that’s before the sediment even finishes hardening into rock.
The speed of compaction depends partly on how fast new sediment piles on top. When sedimentation is slow, water trapped in pore spaces has time to escape, and compaction proceeds at a predictable rate with increasing depth. When sedimentation is rapid, water gets trapped because it can’t squeeze out fast enough. This creates zones of abnormally high pressure within the sediment, a condition called overpressure, where the rock retains more porosity than expected for its depth.
Lithification Within the Bigger Picture
Compaction and cementation are two steps within a broader set of changes called diagenesis. Diagenesis includes every physical, chemical, and biological change that happens to sediment after it’s deposited but before it gets hot enough to become metamorphic rock (which starts around 200°C). Beyond compaction and cementation, diagenesis also involves dissolution, where some minerals dissolve away, and recrystallization, where existing minerals change their crystal structure.
Together, these diagenetic processes increase the bulk density of the material while reducing its porosity and permeability. The end result is a transformation from a loose, water-saturated pile of grains into a solid, layered sedimentary rock. Push the temperature and pressure even higher, and that sedimentary rock begins to change again, entering the realm of metamorphism, where shale becomes slate and sandstone becomes quartzite.

