Like animals, fungi are heterotrophs: They use complex organic compounds as a source of carbon rather than fixing carbon dioxide from the atmosphere, as some bacteria and most plants do. In addition, fungi do not fix nitrogen from the atmosphere. Like animals, they must obtain it from their diet.
However, unlike most animals that ingest food and then digest it internally in specialized organs, fungi perform these steps in the reverse order. Digestion precedes ingestion. First, exoenzymes, enzymes that catalyze reactions on compounds outside of the cell, are transported out of the hyphae where they break down nutrients in the environment. Then, the smaller molecules produced by the external digestion are absorbed through the large surface areas of the mycelium. As with animal cells, the fungal storage polysaccharide is glycogen rather than starch, as found in plants.
Fungi are mostly saprobes, organisms that derive nutrients from decaying organic matter. They obtain their nutrients from dead or decomposing organic matter, mainly plant material. Fungal exoenzymes are able to break down insoluble polysaccharides, such as the cellulose and lignin of dead wood, into readily absorbable glucose molecules. Decomposers are important components of ecosystems, because they return nutrients locked in dead bodies to a form that is usable for other organisms. This role is discussed in more detail later. Because of their varied metabolic pathways, fungi fulfill an important ecological role and are being investigated as potential tools in bioremediation. For example, some species of fungi can be used to break down diesel oil and polycyclic aromatic hydrocarbons. Other species take up heavy metals such as cadmium and lead.