Carbon added to sedimentary rocks can take the form of carbonates, or organic carbon compounds. In order of source quantity the organic carbon comes from phytoplankton, plants, bacteria and zooplankton. However terrestrial sediments may be mostly from higher plants, and some oxygen deficient sediments from water may be mostly bacteria. Fungi and other animals make insignificant contributions. On the oceans the main contributor of organic matter to sediments is plankton, either dead fragments or faecal pellets termed marine snow. Bacteria degrade this matter in the water column, and the amount surviving to the ocean floor is inversely proportional to the depth. This is accompanied by biominerals consisting of silicates and carbonates. The particulate organic matter in sediments is about 20% of known molecules 80% of material that cannot be analysed. Detritivores consume some of the fallen organic materials. Aerobic bacteria and fungi also consume organic matter in the oxic surface parts of the sediment. Coarse-grained sediments are oxygenated to about half a meter, but fine grained clays may only have a couple of millimetres exposed to oxygen. The organic matter in the oxygenated zone will become completely mineralized if it stays there long enough.
Deeper in sediments where oxygen is exhausted, anaerobic biological processes continue at a slower rate. These include anaerobic mineralization making ammonium, phosphate and sulfide ions; fermentation making short chain alcohols, acids or methyl amines; acetogenesis making acetic acid; methanogenesis making methane, and sulfate, nitrite and nitrate reduction. Carbon dioxide and hydrogen are also outputs. Under freshwater, sulfate is usually very low, so methanogenesis is more important. Yet other bacteria can convert methane, back into living matter, by oxidising with other substrates. Bacteria can reside at great depths in sediments. However sedimentary organic matter accumulates the indigestible components.
Deep bacteria may be lithotrophes, using hydrogen, and carbon dioxide as a carbon source.
In the oceans and other waters there is much dissolved organic materials. These are several thousand years old on average, and are called gelbstoff (yellow substance) particularly in fresh waters. Much of this is tannins. The nitrogen containing materials here appear to be amides, perhaps from peptidoglycans from bacteria. Microorganisms have trouble consuming the high molecular weight dissolved substances, but quickly consume small molecules.
From terrestrial sources black carbon produced by charring is an important component. Fungi are important decomposers in soil.