Article — Molar Mass of a Gas Calculator
Molar Mass of a Gas Calculator: M = mRT / (PV) from the Ideal Gas Law
The molar mass of a gas (M, in g/mol) is recovered from the ideal gas law: M = mRT / (PV). Measure the mass of a gas sample, the pressure, the volume it occupies, and the absolute temperature, then plug in R = 0.082057 L atm / (mol K). The result is the average molecular weight of whatever is in the container.
This is one of the oldest and most useful inversions in physical chemistry. Cannizzaro used the technique in 1860 to settle the atomic-weight chaos that had plagued chemistry for half a century. Modern labs still use it (or its mass-spectrometry descendants) for identifying unknown vapors.
What gas molar mass measures
Gas molar mass is an invariant property of a chemical species, not of a specific sample. Hydrogen gas H2 is 2.016 g/mol whether it sits at 1 atm or 100 atm, at 100 K or 1000 K. What changes with pressure and temperature is the density (mass per volume), not the molar mass.
For a mixture like air, "molar mass" means the mole-weighted average of all the components. Earth's atmosphere averages 28.97 g/mol because it is 78% N2 (28.01), 21% O2 (32.00), and 1% Ar (39.95) with traces of CO2 and water. The molar mass is the average mass per mole of gas particles, regardless of identity.
The gas molar mass formula
PV = nRT ideal gas lawn = m / M moles from massM = mRT / (PV) solve for MM = ρ RT / P from densitySubstituting n = m/M into PV = nRT and rearranging gives the working formula. The four inputs are the four laboratory observables: total mass, gauge pressure (after adjustment), measured volume, and temperature. With R = 0.082057 L atm / mol K, the formula expects pressure in atm and volume in liters; with R = 8.314 J / mol K, it expects pascals and cubic meters. Mixing unit systems is the leading source of error.
Measuring gas molar mass in the lab
The classical procedure (Dumas method, 1826) is simple. Take a small glass bulb of known volume, attach a stopcock, evacuate it, weigh it. Fill it with the gas at known pressure and temperature, weigh again, subtract. Apply M = mRT / (PV).
Modern equivalents include the Regnault apparatus (a heavier glass globe) and gas-injection mass spectrometry. The latter avoids weighing entirely: it measures m/z (mass-to-charge ratio) of individual ions, giving molar mass directly without needing to know temperature or volume.
Sulfur hexafluoride (SF6, M = 146 g/mol) is five times denser than air. People sometimes inhale it as a parlor trick: because the speed of sound is lower in dense gas, the voice drops to a low rumble. The opposite of helium, which makes the voice squeaky because it is light. SF6 is also a potent greenhouse gas, about 23,500 times more warming than CO2 per kg.
Gas molar mass from density
If a gas density measurement is more convenient than a mass-and-volume pair, use the rearrangement M = ρRT / P. Gas density is typically reported in g/L; an aerometer or a Cailletet-Mathias method gives you ρ directly.
At STP (273.15 K, 1 atm) the molar volume of any ideal gas is 22.414 L/mol. So at STP, gas density times 22.414 equals molar mass. CO2 at STP has ρ = 1.96 g/L; multiply by 22.414 to get 44.0 g/mol, the known molar mass.
Gas molar mass and real-gas corrections
The ideal gas law assumes molecules are points with no intermolecular forces. Real gases deviate, especially at high pressure (molecular volume matters) or low temperature (attractive forces matter). For most laboratory work at moderate conditions, the ideal-gas molar mass is accurate to about 1%.
The van der Waals equation adds correction terms a and b: (P + a(n/V)^2)(V - nb) = nRT. The compressibility factor Z = PV/nRT collapses real-gas behavior into a single number, charted as Z(P, T) for each species. For ammonia or water vapor near saturation, Z can dip to 0.7 or so, meaning the ideal-gas molar-mass calculation overestimates by 30%.
Common gas molar masses
- H2: 2.016 g/mol (lightest molecular gas)
- He: 4.003 g/mol (lightest monatomic gas)
- CH4: 16.04 g/mol (natural gas)
- NH3: 17.03 g/mol (refrigerant, fertilizer base)
- N2: 28.01 g/mol (78% of air)
- Air mixture: 28.97 g/mol
- O2: 32.00 g/mol (21% of air)
- Ar: 39.95 g/mol
- CO2: 44.01 g/mol
- SF6: 146.06 g/mol (5x heavier than air)
Applications of gas molar mass
Identifying an unknown vapor. Heat a small sample in a tared flask until it vaporizes; measure mass loss, vapor pressure, volume, temperature. Solve for M. Compare against a tabulated list to identify the substance. Originally Dumas's method, now refined into modern volatile-organic analysis.
Industrial gas mixtures. Anesthesiologists need to know the average molar mass of their gas mixture (O2, N2O, sevoflurane vapor) to dose by volumetric flow. Refrigeration engineers compute the molar mass of new HFC and HFO blends to size compressors.
Atmospheric science. The molar mass of dry air (28.97) and water vapor (18.02) enter every humidity calculation. Moist air is lighter than dry air at the same temperature because H2O is lighter than the N2/O2 it displaces, which has consequences for thunderstorm dynamics.
Gas molar mass calculation mistakes
The ideal gas law is built on absolute temperature. Plugging 25 instead of 298.15 K gives an answer 12 times too small. Always convert: K = °C + 273.15. The calculator can do this for you via the unit toggle; just be sure the toggle matches the value you typed.
Other regular slips: using gauge pressure instead of absolute pressure (add 1 atm to gauge readings), forgetting to subtract the vapor pressure of any other component (saturated water vapor in a hot bath, for instance), using mmHg with the L-atm form of R, and treating the volume measurement as too precise (small bubbles or temperature gradients during the reading can cause 1-3% errors).
For a sanity check, compare your calculated molar mass to common gases. 28-32 g/mol is air or pure N2/O2. 44 g/mol is CO2 or propane. 2 g/mol is hydrogen. If your number is way off any reasonable gas, recheck unit conversions before assuming you have discovered a new element.