Molar Mass of Gas Calculator — Using the Ideal Gas Law
This molar mass of gas calculator uses the ideal gas law to find the number of moles of any gas and — when you provide the sample mass — its molar mass. All calculations follow the formula PV = nRT. The tool supports both metric (SI) and US / imperial unit systems, so you can enter pressure in atm, kPa, Pa, bar, psi, or mmHg; volume in L, mL, m³, gallons, pints, or fluid ounces; temperature in K, °C, or °F; and mass in g, kg, mg, lb, or oz.
How to Calculate the Molar Mass of a Gas
You need four pieces of data about the gas sample:
- Pressure (P) — most commonly used units: atm, kPa
- Volume (V) — most commonly used units: L, mL, m³
- Temperature (T) — must be converted to Kelvin internally
- Mass (m) — only required for molar mass; not needed for moles alone
Ideal Gas Law Formula
The ideal gas law states:
PV = nRT
where:
- P — Pressure (atm)
- V — Volume (L)
- n — Number of moles (mol)
- R — Ideal gas constant = 0.082057 L·atm/(mol·K)
- T — Temperature (K)
Number of Moles
Rearranging for n:
n = PV / (RT)
Be careful with units! When using R = 0.082057 L·atm/(mol·K), pressure must be in atm, volume in liters, and temperature in Kelvin. Our calculator handles all unit conversions automatically.
Molar Mass
Once you know the number of moles, molar mass follows directly:
M = mass (g) / n (mol)
The result is expressed in g/mol — numerically identical to the atomic mass unit (u or Da, Dalton).
Standard Temperature and Pressure (STP)
At STP (0 °C = 273.15 K, 1 atm), exactly 1 mole of an ideal gas occupies 22.414 L. This is a useful reference: if your gas sample is at STP and you measure a volume of 22.414 L, it contains 1 mole.
Molar Mass vs Molecular Weight vs Atomic Mass
- Atomic mass — the mass of a single atom, expressed in atomic mass units (u).
- Molecular mass — the mass of one molecule; numerically the same as molar mass but in u instead of g/mol.
- Molar mass — the mass of one mole (6.022 × 10²³ entities) of a substance, in g/mol.
Related Gas Laws
- Boyle's Law — at constant temperature: P₁V₁ = P₂V₂
- Charles's Law — at constant pressure: V₁/T₁ = V₂/T₂
- Gay-Lussac's Law — at constant volume: P₁/T₁ = P₂/T₂
- Combined Gas Law — P₁V₁/T₁ = P₂V₂/T₂
- Ideal Gas Law — combines all: PV = nRT
Frequently Asked Questions
How do I calculate the molar mass of a gas?
- Use the ideal gas law to find n: n = PV / (RT) (consistent units required).
- Divide the sample mass by moles: M = mass / n.
- The result is in g/mol (or kg/mol if you used kg).
What is the molar mass of N₂?
N₂ has a molar mass of 28.0134 g/mol (two nitrogen atoms × 14.0067 g/mol each). Because N₂ is a known substance, you do not need the ideal gas law to find its molar mass — just look it up in a periodic table. The gas law approach is most useful for an unknown gas.
Is molar mass the same as molecular weight?
They share the same numerical value, but different units and meanings. Molar mass is the mass of one mole of substance (g/mol); molecular weight is the mass of one molecule (amu or u).
Can I use this calculator for gas mixtures?
For a mixture, the ideal gas law gives you the average (apparent) molar mass of the mixture, not the molar mass of any individual component. Use Dalton's Law and partial pressures to analyse individual components.