This calculator works out the moles of hydrogen gas (H₂) produced from a chemical reaction when you know the mass of the reacting metal or the volume of gas collected. You enter the relevant value and the calculator returns the number of moles using the ideal gas law or stoichiometry. The result is given in moles, which you can then convert to grams, liters, or number of molecules as needed.
Formula
The calculator uses two common approaches depending on what data you have:
1. From gas volume (ideal gas law):
n = (P × V) / (R × T)
- n = moles of hydrogen gas (mol)
- P = pressure of the gas (atm)
- V = volume of the gas (L)
- R = ideal gas constant = 0.082057 L·atm·mol⁻¹·K⁻¹
- T = absolute temperature (K) = temperature in °C + 273.15
2. From metal mass (stoichiometry):
For a metal like zinc reacting with acid: Zn(s) + 2HCl(aq) → ZnCl₂(aq) + H₂(g)
n(H₂) = mass of metal / molar mass of metal
- mass of metal = grams of metal consumed (g)
- molar mass of Zn = 65.38 g/mol (for the default example)
This works for any metal where one mole of metal produces one mole of H₂ (e.g., Zn, Mg, Fe, Al if you adjust the stoichiometry).
Worked Example
Let’s use the default values: mass = 10 g, volume = 1 L, temperature = 25°C, pressure = 1 atm.
From gas volume:
- Convert temperature to Kelvin: 25 + 273.15 = 298.15 K
- Plug into ideal gas law: n = (1 atm × 1 L) / (0.082057 × 298.15)
- n = 1 / 24.465 = 0.0409 mol
The calculator rounds to 0.041 mol.
From metal mass:
- n = 10 g / 65.38 g/mol = 0.1529 mol
The calculator rounds to 0.153 mol.
Notice the two results differ because the gas volume and metal mass are independent inputs – they don’t have to correspond to the same reaction.
When to Use Which Method
Use the gas volume method when you have collected hydrogen gas over water or in a graduated cylinder and know its volume, temperature, and pressure. This is common in lab experiments where you measure the gas produced.
Use the metal mass method when you know how much solid metal was consumed. This is useful for theoretical calculations before an experiment or when you want to predict how much gas a given mass of metal will produce.
If you have both measurements from the same reaction, they should agree (within experimental error). If they don’t, check for leaks, incomplete reaction, or measurement errors.
Common Mistakes and How to Avoid Them
- Forgetting to convert °C to K: Always add 273.15 to Celsius temperatures. Using Celsius directly gives a wildly wrong answer.
- Using the wrong gas constant: If pressure is in atm and volume in L, use R = 0.082057. If pressure is in kPa and volume in L, use R = 8.314. The calculator assumes atm and L.
- Ignoring water vapor pressure: When hydrogen is collected over water, the total pressure includes water vapor. You must subtract the vapor pressure of water at that temperature to get the partial pressure of H₂. This calculator does not do that – you need to adjust the pressure input manually.
- Mixing up stoichiometry: For metals like aluminum, 2 moles of Al produce 3 moles of H₂. The simple mass/molar mass formula only works for 1:1 metals (Zn, Mg, Fe). For others, multiply by the mole ratio.
- Rounding too early: Keep intermediate values with full precision, then round at the end.
Real-World Context and Applications
Hydrogen gas production is a staple in chemistry education and industry. In the lab, reacting a metal with acid is a classic way to generate hydrogen. The ideal gas law lets you calculate moles from the gas you collect, which is often easier than weighing a gas directly.
In industry, hydrogen is produced on a large scale via steam reforming of methane, but the same mole calculations apply when designing reactors or storage systems. For fuel cell research, knowing exactly how many moles of H₂ you have is critical for energy calculations.
This calculator is also handy for hobbyists doing electrolysis of water. In that case, 2 moles of water produce 2 moles of H₂ and 1 mole of O₂. You can measure the volume of gas collected and work backward to find moles.
Limitations and Accuracy
The ideal gas law assumes hydrogen behaves as an ideal gas. At high pressures (above a few atmospheres) or very low temperatures, real gases deviate. For most lab conditions (room temperature, 1 atm), the error is less than 1%.
The stoichiometric method assumes the metal is pure and reacts completely. If the metal has an oxide layer or impurities, the actual moles of H₂ will be lower than calculated.
Both methods ignore the solubility of hydrogen in water or acid. In practice, a tiny amount dissolves, but it’s negligible for most educational experiments.
Frequently Asked Questions
How do I convert moles of H₂ to grams?
Multiply moles by the molar mass of hydrogen gas, which is 2.016 g/mol (because H₂ has two hydrogen atoms, each ~1.008 g/mol). For example, 0.5 mol H₂ × 2.016 g/mol = 1.008 g.
What if my metal is aluminum instead of zinc?
Aluminum reacts as: 2Al + 6HCl → 2AlCl₃ + 3H₂. So 2 moles of Al give 3 moles of H₂. To use the calculator, first find moles of Al (mass / 26.98), then multiply by 3/2. For 10 g Al, that’s (10/26.98) × 1.5 = 0.556 mol H₂.
Why do I need to subtract water vapor pressure?
When you collect gas over water, the gas mixture contains water vapor. Dalton’s law says total pressure = P(H₂) + P(H₂O). The water vapor pressure at 25°C is about 23.8 mmHg (0.0313 atm). So if total pressure is 1 atm, P(H₂) = 1 – 0.0313 = 0.9687 atm. Use that in the calculator.
Can I use this for electrolysis of water?
Yes. In electrolysis, 2H₂O → 2H₂ + O₂. If you measure the volume of hydrogen gas collected, the ideal gas law gives you moles of H₂ directly. The mass method doesn’t apply because you’re not consuming a metal.
What is the molar volume of hydrogen gas at STP?
At standard temperature and pressure (0°C, 1 atm), one mole of any ideal gas occupies 22.4 L. So moles = volume (L) / 22.4. This is a special case of the ideal gas law.
Why does the calculator give different answers for the two methods?
Because the inputs are independent. If you enter 10 g of zinc, that corresponds to about 0.153 mol H₂, which at 25°C and 1 atm would occupy about 3.75 L. If you also entered 1 L, that’s a different scenario. The two outputs answer different questions.