Chlorophyll is vital for photosynthesis, which allows plants to absorb energy from light. Light energy is converted into chemical energy. Using the energy of light, carbohydrates such as sugars are synthesised from carbon dioxide and water. Chlorophyll is found in virtually all photosynthetic organisms, including green plants, cyanobacteria, and algae. With photosynthesis, chlorophyll absorbs energy and then transforms water and carbon dioxide into oxygen and carbohydrates. Chlorophyll A contains a magnesium ion encased in a large ring structure known as a chlorine. The chlorin ring is a heterocyclic compound derived from pyrrole.