Water electrolysis of is a nonspontaneous chemical reaction that consumes electricity to produce hydrogen and oxygen. The electric current decomposes the water molecule into ions of hydroxide (OH) at the cathode and into H+ protons at the anode. The protons accept electrons in an oxidation reaction thus forming hydrogen gas.