Skip to content
Chemistry

Molar Mass of Gas Calculator

Enter the pressure, volume, temperature, and sample mass of your gas to find its molar mass and the number of moles present. The calculator applies the ideal gas law (PV = nRT) rearranged as M = mRT / (ZPV), where Z accounts for real-gas behaviour. Switch pressure, volume, and temperature units freely - results update instantly.

Your details

Mass of the gas sample in grams.
g
Absolute pressure of the gas. Select the unit that matches your measurement.
Volume occupied by the gas sample.
Temperature of the gas. The calculator converts to Kelvin automatically.
Correction for real-gas behaviour. Z = 1 for an ideal gas (the default). Values below 1 indicate attractive intermolecular forces; values above 1 indicate repulsive forces. Consult a van der Waals table for your specific gas.
Molar massHydrogen-range gas
2.016g/mol

Mass per mole of the gas (M = mRT / ZPV)

Moles of gas1mol
Temperature (K)273.15K
Pressure (atm)1atm
Volume (L)22.414L
Moles (mol)1
Molar mass (g/mol)2.016
0112.07224.140510
Pressure (atm)

Molar mass: 2.016 g/mol

  • A molar mass of 2.02 g/mol is close to H2 (hydrogen).
  • The sample contains 1.0000 mol, equivalent to 6.022e+23 molecules (by Avogadro's number).
  • Z = 1 assumes ideal-gas behaviour. For high pressures or temperatures near the gas's critical point, use a compressibility chart (Nelson-Obert or NIST) to find Z.

Next stepCompare the result to known molar masses in a periodic table or CRC Handbook to identify or verify the gas. If the value seems off, check that your pressure is absolute (not gauge) and your temperature is correct.

Formula

n=PVZRT,M=mn=mRTZPV\mathrm{n} = \frac{PV}{ZRT}, \quad \mathrm{M} = \frac{m}{n} = \frac{mRT}{ZPV}

Worked example

A 2.016 g sample of a gas occupies 22.414 L at 273.15 K and 1.000 atm (STP, ideal gas). Then n = (1.000 × 22.414) / (1 × 0.082057 × 273.15) = 1.000 mol, and M = 2.016 / 1.000 = 2.016 g/mol, which matches hydrogen (H2).

How to find the molar mass of a gas using the ideal gas law

The ideal gas law, PV = nRT, links the pressure (P), volume (V), amount of substance (n), the universal gas constant (R = 0.082057 L·atm/mol·K), and the absolute temperature (T) of any gas that behaves ideally. Because n = mass / molar mass, you can substitute n = m/M into the equation to get PV = (m/M)RT, which rearranges to M = mRT / (PV). This means that if you can measure (or look up) the pressure, volume, temperature, and sample mass for a gas, you can calculate its molar mass without knowing its chemical identity. The method is routinely used in the lab to identify volatile unknown compounds.

Pressure, volume and temperature units - what to use

The ideal gas constant R has a different numerical value depending on which units you choose. The most common values are R = 0.082057 L·atm/(mol·K) and R = 8.31446 L·kPa/(mol·K). This calculator converts your chosen units automatically, so you can enter pressure in kPa, bar, mmHg, torr, or psi; volume in litres, millilitres, cubic decimetres, or cubic metres; and temperature in Kelvin, Celsius, or Fahrenheit. Temperature must always be converted to Kelvin internally because negative Kelvin values are physically impossible - the calculator handles that conversion for you. Always use absolute pressure (not gauge pressure) in the calculation.

Real gases and the compressibility factor Z

The ideal gas law assumes that gas molecules have no volume and do not interact with each other. Real gases deviate from this, especially at high pressures or near their critical temperature. The compressibility factor Z corrects for this: Z = PV / (nRT). For an ideal gas Z = 1. For a real gas under high pressure, Z is often greater than 1 because repulsive forces dominate. Near the condensation point, intermolecular attractions can make Z fall below 1. The corrected formula is M = mRT / (ZPV). For most lab experiments at atmospheric pressure and room temperature, Z is very close to 1 and can be left at the default value. If you need higher accuracy, look up the Z value for your gas in a van der Waals or Nelson-Obert chart, or obtain it from NIST webbook.

Standard conditions and molar volume

At standard temperature and pressure (STP: 0°C and 1 atm) one mole of any ideal gas occupies exactly 22.414 L, the standard molar volume. At standard ambient temperature and pressure (SATP: 25°C and 100 kPa, used by IUPAC since 1982), the molar volume is 24.790 L/mol. These reference points are useful for quick checks: if your gas sample fills 22.414 L at STP and you enter the correct mass, the calculator should return the expected molar mass. If it does not, check whether your pressure is absolute or gauge and whether your temperature is in the right unit.

Molar masses of common gases

GasFormulaMolar mass (g/mol)Class
HydrogenH22.016Diatomic
HeliumHe4.003Noble gas
MethaneCH416.043Alkane
AmmoniaNH317.031Compound
NeonNe20.18Noble gas
Carbon monoxideCO28.01Compound
NitrogenN228.014Diatomic
Dry airmixture28.97Mixture
OxygenO231.998Diatomic
Hydrogen sulfideH2S34.081Compound
ArgonAr39.948Noble gas
Carbon dioxideCO244.01Compound
Nitrous oxideN2O44.013Compound
PropaneC3H844.097Alkane
ButaneC4H1058.124Alkane
ChlorineCl270.906Diatomic
Sulfur dioxideSO264.066Compound
KryptonKr83.798Noble gas
XenonXe131.293Noble gas

Standard molar masses for frequently encountered gases. Use these to identify an unknown gas or verify your result.

Frequently asked questions

What is the formula for the molar mass of a gas?

The formula is M = mRT / (ZPV), derived from the ideal gas law. Here m is the sample mass in grams, R is the gas constant (0.082057 L·atm/mol·K), T is absolute temperature in Kelvin, Z is the compressibility factor (1 for an ideal gas), P is pressure in atm, and V is volume in litres. The same result comes from first calculating n = PV / (ZRT) and then M = m / n.

Why do I need to convert temperature to Kelvin?

The ideal gas law requires absolute temperature. At 0 K all molecular motion stops and gas volume theoretically reaches zero, so Kelvin is the natural scale for gas calculations. If you used Celsius, a temperature of 0°C would give a zero denominator in P/T = nR/V, which is physically wrong. The conversion is T(K) = T(°C) + 273.15. This calculator does the conversion automatically when you select Celsius or Fahrenheit.

What is the compressibility factor Z, and when should I change it from 1?

Z = PV/(nRT) is a dimensionless correction that measures how much a real gas deviates from ideal behaviour. At low pressures and temperatures well above the boiling point, Z is effectively 1 for most gases, and the ideal gas law is accurate to within a fraction of a percent. Z becomes important for high-pressure gas streams (above a few atm), gases near their critical temperature, or gases with strong intermolecular forces such as ammonia or steam. Tabulated Z values are available in Perry's Chemical Engineers' Handbook, the NIST WebBook, and Nelson-Obert generalized charts.

Does this method work for mixtures of gases?

Yes, but the result is the apparent or average molar mass of the mixture, not the molar mass of any individual component. Because the ideal gas law is additive for mixtures (Dalton's law of partial pressures), the n calculated from PV = nRT is the total moles of all species, and M = m/n gives the mass-weighted mean molar mass. Dry air, for example, gives about 28.97 g/mol by this method, reflecting the weighted average of nitrogen (28.01), oxygen (32.00), and argon (39.95).

What is standard molar volume and why is it 22.414 L?

Standard molar volume is the volume one mole of an ideal gas occupies at STP (0°C, 1 atm). Substituting into V = nRT/P: V = 1 mol × 0.082057 L·atm/mol·K × 273.15 K / 1 atm = 22.414 L. At the newer IUPAC SATP (25°C, 100 kPa) the value is 24.790 L/mol. The figure is useful as a quick sanity check: if you weigh a gas sample that occupies 22.414 L at STP, dividing that mass by 1 mol gives the molar mass directly.

How accurate is the ideal gas law for finding molar mass?

At atmospheric pressure and temperatures well above the boiling point of the gas, the ideal gas law gives molar masses accurate to about 0.1-1%, which is usually sufficient for identification purposes. At 10 atm the error can reach a few percent for common gases. At pressures of 100 atm or near the critical point, errors can be 10% or more and the compressibility factor Z must be included. For precision work, gas chromatography-mass spectrometry or high-resolution mass spectrometry gives much more accurate molar masses than the PV = nRT method.

Sources

Written by Dr. Sofia Marchetti, PhD Chemist · Milan, Italy

Physical chemist and laboratory educator bringing rigorous solution science to accessible, accurate online tools.

Search 3,500+ calculators

Loading search…