StatGardenREF. DESK
Calculators/Chemistry/Molar mass of a gas
Chemistry

Molar mass of a gas calculator

Finds a gas’s molar mass from its mass, pressure, volume and temperature (ideal gas law).

Published 9 August 2026 · Updated 25 September 2026

What this calculator does

Weighing a known volume of gas at a known pressure and temperature identifies it. A gram and a quarter occupying one litre at standard conditions gives 28.03 g/mol, which is nitrogen.

The method works because the ideal gas law fixes how many moles are present regardless of what the gas is. One litre at 1 atm and 273.15 K contains 0.0446 moles of anything, so the mass measurement alone determines the molar mass.

The formula

Formulan = PV / RT, then M = m / n (R = 0.0821 L·atm/(mol·K))

The ideal gas law gives the moles as PV over RT, using R of 0.0821 L·atm/(mol·K). Dividing the measured mass by that mole count gives the molar mass. Accuracy depends on the gas behaving ideally, which is reasonable near ambient conditions and degrades at high pressure or near condensation.

TermMeaning
Ideal gas lawPV = nRT, relating pressure, volume, moles and temperature.
Molar volume22.4 L per mole at 0 °C and 1 atm, which is the same relationship expressed differently.
Vapour densityA related historical method comparing a gas density with hydrogen.
Compressibility factorHow far a real gas departs from ideal behaviour.

The inputs explained

FieldWhat to enter
Mass of gas (g)Mass of gas in grams, measured by weighing the container full and empty.
Pressure (atm)Pressure in atmospheres.
Volume (L)Volume in litres.
Temperature (K)Temperature in kelvin.

When to use it

Identifying an unknown gas

The molar mass narrows the candidates immediately, often to one.

Confirming a synthesis

A gaseous product molar mass confirms its identity against the expected formula.

Teaching the gas laws

It is the classic practical application of PV = nRT, combining a physical measurement with a calculation.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

What molar mass does each measured mass give?

Different masses occupying the same volume at the same conditions.

1 L at 1 atm and 273.15 K
Mass of gasMolar massMoles of gas (n = PV/RT)Note
0.5 g11.21 g/mol0.0446 molAssumes ideal-gas behaviour; real gases deviate at high pressure or low temperature.
1.25 g28.03 g/mol0.0446 molAssumes ideal-gas behaviour; real gases deviate at high pressure or low temperature.
2 g44.85 g/mol0.0446 molAssumes ideal-gas behaviour; real gases deviate at high pressure or low temperature.
3 g67.28 g/mol0.0446 molAssumes ideal-gas behaviour; real gases deviate at high pressure or low temperature.
The mole count is 0.0446 in every row, because it depends only on pressure, volume and temperature and not at all on which gas is present. That is why the mass alone determines the answer: 1.25 g gives 28.03 g/mol, which is nitrogen, and 2 g gives 44.85, close to carbon dioxide.

Questions

Why is the mole count the same for every gas?

Because the ideal gas law contains no term for molecular identity. Equal volumes of any gas at the same temperature and pressure contain equal numbers of molecules, which is Avogadro law. The mass then varies entirely with the molar mass.

How accurate is this?

Good to a percent or so near ambient conditions for gases well above their boiling points. Accuracy falls at high pressure or near condensation, where molecular volume and intermolecular attraction matter. Weighing errors usually dominate in practice, since a litre of gas weighs very little.

What is molar volume?

22.4 litres per mole at 0 °C and 1 atm, which is the same relationship expressed as a constant. It gives a quick check: a litre at those conditions is one over 22.4 of a mole, which is the 0.0446 this calculator reports.

Which value of R should I use?

0.0821 L·atm/(mol·K) for pressure in atmospheres and volume in litres, which is what this uses. Using 8.314 J/(mol·K) requires pressure in pascals and volume in cubic metres. Mismatched units are the usual source of a wildly wrong answer.

For comparing effusion rates, see the Graham’s law calculator. For gas mixtures, see the partial pressure calculator.