How does carbon stored in the bodies of living organisms move into rocks

Carbon stored in the bodies of living organisms can move into rocks through the process of fossilization. When a living organism dies, its body may become buried in sediment or mud. Over time, the soft tissues of the organism are replaced by minerals that seep into the bones and other structures. The minerals act as a sort of mold, preserving the shape of the organism in the rock. Fossilization can occur in a variety of settings, such as in river banks, ocean floors, and even in amber or other forms of petrification. Over millions of years, the accumulated minerals and sediment may become compressed, cemented, and transformed into sedimentary rocks that contain carbon in the form of fossilized organic matter. As a result, carbon stored in the bodies of living organisms can be preserved and stored in rocks for millions of years.