Plants produce carbohydrates through photosynthesis, converting light energy, water, and carbon dioxide into glucose and other carbohydrate molecules. This makes plants the primary producers of carbohydrates in virtually all ecosystems, forming the base of food chains. Marine animals, coal tar, and crude oil either consume carbohydrates or are derived from ancient plant matter, but only plants actively synthesize carbohydrates from inorganic sources.