Answer:
The photosynthesis equation is as follows: 6CO2 + 6H20 + (energy) → C6H12O6 + 6O2 Carbon dioxide + water + energy from light produces glucose and oxygen.
Explanation: (credit to Chris Hall in Quora)
On the geological scale, the equation for photosynthesis would be the opposite of combustion/respiration: carbon dioxide and water molecules converted into oxygen and carbohydrate (or hydrocarbon) molecules (one unit of -CH2O- per CO2).
However, such a simplistic formula is extremely misleading, especially when talking about individual plants and algae instead of macro-geo-chemistry. The oxidation of water to oxygen (aka the light reactions) is a separate (but concurrent) process from the reduction of carbon dioxide to carbohydrate or hydrocarbon (aka the dark reactions). See my answer to a similar question here: Chris Hall's answer to Where is the most detailed chemical structure breakdown of all steps of photosynthesis that is reliable?
Some bacteria, algae, and plant cells only perform one half of the typical photosynthetic pathway, either to produce energy without making sugar/hydrocarbon or to assimilate carbon dioxide using stored chemical energy rather than using light directly (similar to chemosynthesis). And some bacteria do photosynthesis without making oxygen at all, using sulfur in the place of oxygen.
In short, photosynthesis should be thought-of as a series of sequential processes and not as a single chemical reaction.