Skip to main content
Skip to calculator
Advertisement

Last updated: July 3, 2026

Molar Mass of Gas Calculator

Quick Answer

The molar mass of a gas is calculated from the ideal gas law as M = (mRT)/(PV), using mass in grams, pressure in atm, volume in litres, temperature in kelvin, and R = 0.082057 L·atm/(mol·K). If gas density is known, use M = (ρRT)/P to get g/mol directly.

To find the molar mass of a gas, multiply mass by the gas constant and temperature, then divide by pressure times volume. With density, multiply density by the gas constant and temperature, then divide by pressure.

Key Takeaways

  • Use M = (mRT)/(PV) for a weighed gas sample.
  • Use M = (ρRT)/P when density is measured directly.
  • This calculator uses R = 0.082057 L·atm/(mol·K), so enter P in atm and V in L.
  • Temperature must be absolute temperature in kelvin.
  • Ideal-gas results are best near low pressure and moderate temperature.
Helpful
Not helpful
Save as image
Share
Embed
Cite
Write feedback

Formula

M = (mRT)/(PV); density form: M = (ρRT)/P

Where:

  • M=Molar mass of gas(g/mol)
  • m=Gas sample mass(g)
  • R=Ideal gas constant(0.082057 L·atm/(mol·K))
  • T=Absolute temperature(K)
  • P=Gas pressure(atm)
  • V=Gas volume(L)
  • ρ=Gas density(g/L)
Molar Mass of Gas from the Ideal Gas LawA weighed gas bulb and a density cylinder feed into formula boxes for M equals mRT over PV and M equals rho RT over P, using pressure in atmospheres, volume in litres, and temperature in kelvin.Gas molar mass from ideal-gas measurementsWeighed gas samplem in gramsP, V, T measuredDensity methodρ in g/LChoose matching unitsM = mRT / PVM = ρRT / PR = 0.082057 L·atm/(mol·K)P: atmV: LT: KM: g/molConvert units before calculating the gas molar mass.
Molar Mass of Gas Calculator — ideal-gas law and density forms

Worked Examples

Gas sample near oxygen molar mass

A 2.0 g gas sample occupies 1.5 L at 1 atm and 300 K.

  1. 1Use R = 0.082057 L·atm/(mol·K).
  2. 2Substitute into M = (mRT)/(PV).
  3. 3M = (2.0 × 0.082057 × 300)/(1 × 1.5) = 32.82 g/mol.
Final Answer: 32.82 g/mol

Nitrogen-like density at STP

A gas density of 1.25 g/L at 1 atm and 273.15 K gives a nitrogen-like molar mass.

  1. 1Use the density form M = ρRT/P.
  2. 2Insert ρ = 1.25 g/L, R = 0.082057 L·atm/(mol·K), T = 273.15 K, and P = 1 atm.
  3. 3M = 1.25 × 0.082057 × 273.15 ÷ 1 = 28.02 g/mol.
Final Answer: 28.02 g/mol

Small high-pressure gas sample

A 0.5 g sample occupies 0.25 L at 2 atm and 350 K.

  1. 1Use the mass-volume form of the ideal gas law.
  2. 2M = (0.5 × 0.082057 × 350)/(2 × 0.25).
  3. 3The molar mass is 28.72 g/mol.
Final Answer: 28.72 g/mol

Introduction

The molar mass of a gas can be determined from ordinary laboratory measurements by combining the ideal gas law, PV = nRT, with n = m/M. This calculator uses consistent litre-atmosphere units with R = 0.082057 L·atm/(mol·K), so pressure must be in atm, volume in L, temperature in K, and mass in g. If you measured density instead of sample mass and volume, it uses the equivalent density equation M = ρRT/P. Pair this tool with the partial pressure calculator for gas mixtures and the molar ratio calculator for reaction stoichiometry. The formulas follow the ideal-gas treatment described by NIST and LibreTexts gas law resources.

How the ideal gas law gives molar mass

Start with PV = nRT. The amount of gas n equals mass divided by molar mass, n = m/M. Substituting gives PV = (m/M)RT, and solving for M gives M = (mRT)/(PV). This means a heavier gas sample at the same pressure, volume, and temperature has a larger molar mass.

  • Use mass in grams to obtain molar mass in g/mol.

  • Use pressure in atmospheres with R = 0.082057 L·atm/(mol·K).

  • Use volume in litres and temperature in kelvin.

  • The equation assumes ideal gas behavior.

Density method for gas molar mass

If you know gas density ρ in g/L, you do not need separate mass and volume values. Because density is m/V, the ideal-gas molar mass equation simplifies to M = ρRT/P. This is often convenient for identifying gases near standard temperature and pressure.

Density must match the pressure and temperature conditions entered; gas density changes strongly with both.

Unit consistency is the main source of error

The calculator is explicit: it uses R = 0.082057 L·atm/(mol·K). Convert kPa or Pa to atm before using the tool, convert millilitres to litres, and convert Celsius to kelvin. If you prefer SI units, the equivalent form uses R = 8.314 J/(mol·K), pressure in Pa, volume in m³, and mass in g for g/mol.

QuantityCalculator unitCommon conversion
Pressureatm1 atm = 101.325 kPa = 101325 Pa
VolumeL1 L = 0.001 m³
TemperatureKK = °C + 273.15
Densityg/L1 g/L = 1 kg/m³

How to calculate molar mass of a gas

Measure the gas sample carefully, choose the appropriate mode, and keep all values at the same conditions. For a weighed sample, record mass, pressure, volume, and temperature. For a density measurement, record density, pressure, and temperature. Then compare the molar mass with expected molecular masses or use the molarity calculator if the gas is being dissolved into solution.

  • Record temperature in kelvin, not Celsius.

  • Correct pressure for water vapor if the gas was collected over water.

  • Use dry gas mass when condensable vapor is present.

  • Round the final molar mass according to measurement precision.

When the ideal-gas assumption breaks down

Real gases deviate from PV = nRT at high pressure, low temperature, or near condensation. In those cases, the calculated molar mass may be biased because intermolecular forces and finite molecular volume matter. For precise work, use a compressibility factor Z or an equation of state rather than the simple ideal-gas law.

At ordinary teaching-lab conditions near 1 atm and room temperature, ideal-gas molar masses are usually good enough for gas identification.

Applications in identification and stoichiometry

Gas molar mass calculations help identify unknown gases, verify vapor-density experiments, estimate molecular formula candidates, and connect gas collection data to reaction yields. Once moles are known from PV/RT, you can compare reaction amounts with a molar ratio calculator or relate a component to mixture pressure using Dalton's law.

Quick Reference Card

Gas Molar Mass — Quick Reference

Quick referenceMolar Mass of Gas Calculator

M = (mRT)/(PV); or M = (ρRT)/P

Valid range: Best for dry gases that behave approximately ideally, commonly near 0.1–2 atm and away from condensation

Common Values

Helium4.00 g/mol
Nitrogen (N₂)28.01 g/mol
Oxygen (O₂)32.00 g/mol
Carbon dioxide44.01 g/mol
Air average≈ 28.97 g/mol

Watch Out

  • Do not enter Celsius; convert to kelvin first.
  • Pressure must be absolute pressure, not gauge pressure.
  • Use atm with the built-in R value; convert kPa or Pa first.
  • Correct wet gas measurements for water vapor pressure when needed.

Pro Tips

  • If density is available, use the density field and leave mass/volume blank.
  • At STP, density in g/L multiplied by about 22.414 L/mol estimates molar mass.
  • Repeat measurements and average molar mass for unknown-gas identification.
  • Compare the result with known molecular masses to screen candidate gases.

FAQs

What formula does this molar mass of gas calculator use?

It uses M = (mRT)/(PV) for a weighed gas sample and M = (ρRT)/P for a density measurement. The built-in gas constant is R = 0.082057 L·atm/(mol·K).

What units should I enter?

Enter mass in grams, pressure in atmospheres, volume in litres, temperature in kelvin, and density in grams per litre. These units make the result come out in g/mol.

Can I use pascals and cubic metres instead?

Yes manually: use R = 8.314 J/(mol·K), pressure in Pa, volume in m³, temperature in K, and mass in g. This calculator's fields are labelled for the litre-atmosphere version.

Why does density give molar mass?

Density is mass divided by volume. Replacing m/V in M = (mRT)/(PV) with ρ gives M = ρRT/P, so density contains the same mass-volume information.

Why is my result different from the periodic-table molecular mass?

Check unit conversions, water-vapor correction, leaks, temperature measurement, and non-ideal gas behavior. Experimental gas-law molar masses are sensitive to pressure, volume, and temperature errors.

Does the calculator work for gas mixtures?

It returns an average molar mass for the gas sample or density entered. For individual components in a mixture, use composition or partial-pressure information.