# How much hydrogen or oxygen will be produced in the electrolysis of water?

Is there a way to exactly calculate the quantity of hydrogen or oxygen in a water electrolysis? I am thinking of a plain and simple electrolysis like an anode and cathode in salted water separating oxygen and hydrogen.

I am looking for the relation between the amounts of hydrogen $$n(\ce{H2})$$ or oxygen $$n(\ce{O2})$$ and the amounts of water and salt, current, voltage and time of electrolysis.

I'm not sure it's appropriate to explain the relationship between all the variables above, here, as there are a lot of concepts that would need to be explored. However, fundamentally (assuming there are no other reactions apart from the electrolysis) the charge passed through the cell is proportional to the amount of products formed, described by Faraday's laws of electrolysis. Here is a useful rearrangement: $$n = \frac{Q}{Fz}$$ Where $Q$ is the charge passed, $F$ is the Faraday constant and $z$ is the number of electrons transferred per redox reaction. For example, $z = 2$ for hydrogen because it takes two electrons to convert $\ce{H+}$ to $\ce{H2}$ as $\ce{2H+ + 2e- <=> H2}$. Therefore, for every coulomb of charge, we get: \begin{align} n &= \frac{1\ \mathrm{C}}{(96.485\ \mathrm{kC/mol})(2)}\\ &= 5.18\ \mathrm{µmol} \end{align} of hydrogen gas produced. So if we can measure the charge (or current integrated over time), we can calculate the amount of product produced. This is true no matter what voltage is applied or what the electrolyte content of the solution is, however if more than one reaction is occurring at an electrode, you won't be able to separate the contributions from each reaction with only the charge as information. There will also be a minor contribution from charging the double layer capacitance when the potential is first applied.