Photosynthesis is the process by which plants, algae, and some bacteria use sunlight, water and carbon dioxide to produce oxygen and energy in the form of glucose. It occurs in the leaves of plants, specifically in structures called chloroplasts. The two main phases are the light-dependent reactions where light is absorbed to produce ATP and NADPH using pigments like chlorophyll, and the light-independent Calvin cycle where carbon dioxide is fixed into glucose using the energy from the light reactions. Photosynthesis provides the basic energy source for all living things and produces oxygen for the atmosphere.