Molar Mass of a Gas Calculator

Compute the molar mass of a gas from its sample mass, pressure, volume, and temperature using the ideal gas law.

Science Ideal gas M=mRT/PV K or C
Rate this calculator · 5.0 (1)

Molar Mass of Gas Calculator

Ideal gas law - M = mRT/(PV) - K or C

Instructions — Molar Mass of a Gas Calculator

The calculator uses the ideal gas law to recover molar mass from four measurable quantities:

  1. Mass of the gas sample in grams. This is the total mass collected in the vessel.
  2. Pressure in atmospheres. Convert from kPa by dividing by 101.325; from mmHg by dividing by 760.
  3. Volume in liters. The volume the gas occupies at the measured pressure and temperature.
  4. Temperature in K or °C (toggle at the top). The calculator converts °C internally.

The result is the molar mass M in g/mol. The calculator also returns the implied moles n = PV / (RT) and the gas density m / V in g/L.

Formulas

Start from the ideal gas law:

$$ PV = nRT $$

Substitute n = m / M and rearrange to solve for M:

$$ M = \frac{mRT}{PV} $$

where m is the sample mass (g), R is the gas constant (0.082057 L atm / mol K, or equivalently 8.314 J/mol K with SI units), T is absolute temperature (K), P is pressure (atm), and V is volume (L).

Alternative density form:

$$ M = \frac{\rho RT}{P} $$

where ρ = m/V is gas density in g/L. Useful when you measure density directly rather than mass and volume separately.

Reference

Molar masses of common gases (IUPAC 2021):

GasFormulaM (g/mol)
HydrogenH22.016
HeliumHe4.003
MethaneCH416.04
AmmoniaNH317.03
NitrogenN228.01
Air (mix)--28.97
OxygenO232.00
ArgonAr39.95
Carbon dioxideCO244.01
ChlorineCl270.91
Sulfur hexafluorideSF6146.06

Standard conditions used in chemistry:

  • STP (IUPAC, post-1982): 273.15 K, 1 bar = 100 kPa. Molar volume = 22.711 L/mol.
  • STP (legacy): 273.15 K, 1 atm = 101.325 kPa. Molar volume = 22.414 L/mol.
  • SATP: 298.15 K, 1 bar. Molar volume = 24.79 L/mol.

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

Gas molar mass
PV = nRT ideal gas law
n = m / M moles from mass
M = mRT / (PV) solve for M
M = ρ RT / P from density

Substituting 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.

Did you know

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

Temperature must be in Kelvin

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).

Tip

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.

FAQ

Measure four quantities of a gas sample: mass (m), pressure (P), volume (V), and temperature (T). Apply M = mRT / (PV). The ideal gas law is rearranged from PV = nRT by substituting n = m/M.
R = 0.082057 L atm / (mol K) is convenient when pressure is in atm and volume in liters. R = 8.314 J / (mol K) uses SI units (pressure in Pa, volume in m^3). R = 62.36 L Torr / (mol K) for mmHg-based work. Pick the version whose units match your inputs.
The ideal gas law requires absolute temperature. Celsius and Fahrenheit have arbitrary zero points (the freezing point of water for C, the freezing point of brine for F); Kelvin is anchored at absolute zero. Plugging in Celsius without converting gives wrong answers by 273 units.
For most gases at moderate conditions (around 1 atm, room temperature) the ideal gas law is accurate to about 1%. Deviations grow at high pressure or low temperature, where real-gas effects (intermolecular forces and finite molecular volume) become important. Polar gases like NH3 and CO2 deviate more than nonpolar gases.
Gas density is mass per unit volume (g/L) and depends on temperature and pressure. Molar mass is an invariant property of the gas itself (g/mol). At fixed T and P, density and molar mass are proportional: M = ρRT/P.
Yes, but you get the average molar mass of the mixture, not any single component. Air, for instance, gives about 28.97 g/mol because it averages N2, O2, Ar, and CO2. For pure-component analysis, separate the mixture first or use mass spectrometry.
Use the van der Waals equation or compressibility-factor charts. For most undergraduate and field work the ideal-gas result is within experimental error. Real-gas corrections matter at low T or high P, near the critical point, or for very polar gases.
1 atm = 101.325 kPa = 760 mmHg = 760 Torr = 14.696 psi. Divide kPa by 101.325 to get atm; divide mmHg by 760 to get atm. Many labs also use bar: 1 bar = 0.98692 atm, close enough to 1 for rough work.