Green plants, algae, and some bacteria use sunlight to synthesize foods from carbon dioxide and water. These organisms thrive with sunlight with minimal nutrient requirements. They use water and the energy of sunlight to convert atmospheric CO2 into organic compounds—a process called carbon fixation. A bi-product is oxygen (O2) released into water, and eventually, the atmosphere.
Photosynthesis in plants generally involves the green pigment chlorophyll (but also other colors and compounds) and generates oxygen as a byproduct. The process is:
6 H2O + 6 CO2 = C6H12O6 (glucose) + 6O2
In the oceans, photosynthesis is completed by microscopic and macroscopic plants.