Molar Mass of Gas Calculator

Quick answer

Find the molar mass of an unknown gas with the ideal gas law – from a weighed sample (mass, volume, pressure, temperature), from the gas density at a known pressure and temperature, or from mass and moles – and see which common gas it most likely is.

Absolute temperature must be above 0 K

Amount of gas n
0.044615 mol
Molar mass of the gas
28.0175
Density at these conditions
1.25
Density relative to air
0.9671
Molar volume at these conditions
22.414 L/mol
Closest common gas
Nitrogen N₂ / carbon monoxide CO (28.01 g/mol)

Weighing a gas is one of the oldest ways to identify it. The ideal gas law PV = nRT tells you how many moles of gas fill a container at a given pressure and temperature, whatever the gas. If you also know the mass of the gas, dividing the mass by the number of moles gives its molar mass – and the molar mass is often enough to tell nitrogen (28.01 g/mol) from oxygen (32.00), argon (39.95) or carbon dioxide (44.01).

Combining the two steps gives M = mRT/(PV). Since m/V is the density ρ, the same relation can be written M = ρRT/P: at 0 °C and 1 atm one mole of an ideal gas occupies 22.414 L, so the molar mass in g/mol is simply the density in g/L multiplied by 22.414. This is how the classic Dumas method determines the molar mass of a volatile liquid – vaporise it, let the vapour fill a flask of known volume, cool, weigh, and calculate.

Pick the data you have, enter them with any units, and the calculator returns the molar mass, the number of moles, the gas density at your conditions, the density relative to air and the closest common gas.

How to use the Molar Mass of Gas Calculator

  1. Known data
  2. Mass of gas
  3. Volume
  4. Gas density
  5. Pressure
  6. Temperature — Absolute temperature must be above 0 K
  7. Amount of gas

Results update as you type, every field has its own unit menu, and everything is calculated in your browser.

How it works

Temperatures are converted to kelvin, pressures to atm and volumes to litres, so R = 0.082057 L·atm/(mol·K) can be used directly. The calculator finds n = PV/RT (or uses your moles), then M = m/n; in density mode M = ρRT/P.

Worked example

A 1.00 L flask at 0 °C (273.15 K) and 1.00 atm contains 1.25 g of an unknown gas. n = PV/RT = (1.00 × 1.00) ÷ (0.082057 × 273.15) = 0.04462 mol, so M = 1.25 ÷ 0.04462 = 28.02 g/mol – consistent with nitrogen, N₂ (28.01 g/mol).

Density route: a gas has a density of 1.784 g/L at 0 °C and 1 atm. M = 1.784 × 0.082057 × 273.15 ÷ 1 = 39.99 g/mol – argon.

Molar masses of common gases

Gas Molar mass (g/mol) Density at 0 °C, 1 atm (g/L, ideal)
Hydrogen H₂ 2.02 0.090
Helium He 4.00 0.179
Methane CH₄ 16.04 0.716
Ammonia NH₃ 17.03 0.760
Neon Ne 20.18 0.900
Nitrogen N₂ / carbon monoxide CO 28.01 1.250
Dry air (average) 28.97 1.292
Oxygen O₂ 32.00 1.428
Hydrogen sulfide H₂S 34.08 1.520
Argon Ar 39.95 1.782
Carbon dioxide CO₂ / propane C₃H₈ / nitrous oxide N₂O 44.01 1.964
Butane C₄H₁₀ 58.12 2.593
Sulfur dioxide SO₂ 64.07 2.858
Chlorine Cl₂ 70.90 3.163
Sulfur hexafluoride SF₆ 146.06 6.516

Tips

  • Always start from a balanced equation – coefficients give the mole ratio.
  • Convert everything to moles first, then use the ratio, then convert back.
  • Every field has its own unit menu – g, mg, mol, mmol, L and mL all work.
  • Everything is calculated in your browser.

Common mistakes to avoid

  • Using mass ratios instead of mole ratios.
  • Forgetting water of crystallisation in the molar mass of hydrates.
  • Confusing molarity (per litre of solution) with molality (per kilogram of solvent).

Inputs explained

Field What to enter
Known data Choose one: Mass, volume, pressure and temperature, Density, pressure and temperature, Mass and amount in moles
Mass of gas Units: g, mg, µg, kg, oz, lb
Volume Units: L, mL, µL, m³, dm³, cm³ …
Gas density Units: g/L, kg/m³, mg/mL, g/mL, mg/L, lb/ft³
Pressure Units: atm, kPa, Pa, bar, mmHg (Torr), psi
Temperature Units: K, °C, °F. Absolute temperature must be above 0 K
Amount of gas Units: mol, mmol, µmol, nmol, kmol

What each result means

  • Density relative to air = [Molar mass of the gas]÷28.97
  • Molar volume at these conditions = 0.0820573661×[Temperature]÷[Pressure]

Formula

n = PV ÷ RT · M = m ÷ n = mRT ÷ (PV) · M = ρRT ÷ P · R = 0.082057 L·atm/(mol·K) = 8.314 J/(mol·K)

Worked example

Inputs — Known data: Mass, volume, pressure and temperature; Mass of gas: 1.25 g; Volume: 1 L; Pressure: 1 atm; Temperature: 273.15 K.
Results — Amount of gas n = 0.044615 mol; Molar mass of the gas = 28.0175 g/mol; Density at these conditions = 1.25 g/L; Density relative to air = 0.9671; Molar volume at these conditions = 22.414 L/mol; Closest common gas = Nitrogen N₂ / carbon monoxide CO (28.01 g/mol).

Key terms

Ideal gas law
PV = nRT, linking pressure, volume, amount and absolute temperature of a gas.
Molar volume
Volume occupied by one mole of gas: 22.414 L at 0 °C and 1 atm, 24.465 L at 25 °C and 1 atm.
Gas constant (R)
8.314462618 J/(mol·K) = 0.082057 L·atm/(mol·K).
STP
Standard temperature and pressure; here 0 °C (273.15 K) and 1 atm.

Frequently asked questions

How do you find the molar mass of a gas?

Use M = mRT/(PV): weigh the gas, measure its volume, pressure and temperature, and divide. 1.25 g filling 1.00 L at 0 °C and 1 atm gives M = 28.0 g/mol – nitrogen.

How do you get molar mass from density?

M = ρRT/P. At STP (0 °C, 1 atm) this is M = ρ × 22.414 L/mol, so a gas with density 1.784 g/L has M = 39.99 g/mol – argon.

What value of R should I use?

0.082057 L·atm/(mol·K) with litres and atmospheres, or 8.314 J/(mol·K) = 8.314 Pa·m³/(mol·K) with SI units. The calculator converts all units for you.

What is the molar mass of air?

Dry air averages about 28.97 g/mol (78% N₂, 21% O₂, 1% Ar plus CO₂).

Why must temperature be in kelvin?

The ideal gas law needs absolute temperature. 25 °C is 298.15 K; using 25 instead would make the result about 12 times too small.

How accurate is the ideal gas assumption?

Within about 1% for most gases near room temperature and atmospheric pressure. Easily condensed gases (water vapour, butane) and high pressures cause larger errors.

What is the Dumas method?

A way to find the molar mass of a volatile liquid: it is vaporised in a flask of known volume at a known temperature and pressure, the flask is cooled and the condensed vapour weighed, then M = mRT/(PV).

What formula does the Molar Mass of Gas Calculator use?

n = PV ÷ RT · M = m ÷ n = mRT ÷ (PV) · M = ρRT ÷ P · R = 0.082057 L·atm/(mol·K) = 8.314 J/(mol·K).

Sources

  1. NIST – Fundamental physical constants (CODATA)
  2. OpenStax – Chemistry 2e
  3. LibreTexts Chemistry

Cite this calculator

Speedy Calculator. (2026). Molar Mass of Gas Calculator. Speedy Calculator. https://speedycalculator.com/calculators/chemistry/molar-mass-of-gas/