Photosynthesis is the process by which plants, algae, and some bacteria use sunlight, carbon dioxide, and water to produce glucose and oxygen. It occurs in the chloroplasts of photosynthetic organisms, where chlorophyll absorbs sunlight and thylakoids split water to produce oxygen, while the stroma converts carbon dioxide into sugar. Photosynthesis converts sunlight into chemical energy stored in glucose and transforms carbon dioxide and water into oxygen and energy-storing sugars that all organisms can use.