In electrolysis of pure water, reaction at anode
2H2O→ O2 (g) + 4 H+ (aq) + 4e−
At cathode,
2 H+ (aq) + 2e− → H2 (g)
Half reaction can be balanced using base. To add half reactions they must both be balanced with either acid or base. So,
At Anode, 4 OH- (aq) → O2 (g) + 2 H2O (l) + 4 e− (oxidation)
At Cathode, 2 H2O (l) + 2e− → H2 (g) + 2 OH-(aq) (Reduction)
Combining either half reaction pair yields the same overall decomposition of water into oxygen and hydrogen:
Overall reaction: 2 H2O (l) → 2 H2 (g) + O2 (g)
The number of hydrogen molecules produced is thus twice the number of oxygen molecules.