On this page
Gas density questions need no new formula, just the ideal gas law, one substitution, and checked units. Most wrong answers here are right methods with a stray factor of 1000.
What is the formula for molar mass from gas density?
Start from pV = nRT and write the number of moles as n = m/M, where m is the mass and M the molar mass. Density is mass divided by volume, d = m/V, so the ideal gas law becomes d = MP/RT, the form given in OpenStax Chemistry 2e, section 9.3. Rearranged for the unknown, it reads:
M = dRT/P
The same OpenStax section works out that nitrogen (28.01 g/mol) at STP has a density of 1.25 g/L, using R = 0.0821 L atm/(mol K) and T = 273 K. Run it backwards and you have a typical exam question.
How do you work a gas density problem step by step?
Question: a gas has a density of 1.25 g/L at 273.15 K and 1 atm. Find its molar mass.
Route 1, litres and atmospheres:
Write the data with units: d = 1.25 g/L, R = 0.08206 L atm/(mol K), T = 273.15 K, P = 1 atm.
Substitute: M = 1.25 × 0.08206 × 273.15 / 1 = 28.0.
Cancel units: (g/L) × (L atm/(mol K)) × K / atm leaves g/mol. So M = 28.0 g/mol.
Route 2, SI units:
Convert the density: 1.25 g/L is the same as 1.25 kg/m³ (kg and m³ are each 1000 times bigger than g and L).
Use R = 8.314 J/(mol K); NIST lists it as exactly 8.314462618... J/(mol K). Use P = 101325 Pa, which NIST gives as the exact value of one standard atmosphere.
Substitute: M = 1.25 × 8.314 × 273.15 / 101325 = 0.0280 kg/mol, which is 28.0 g/mol.
28 g/mol fits nitrogen.
Why is my molar mass answer off by a factor of 1000?
Every slip below comes from writing numbers without their units:
Kilograms read as grams. Route 2 gives 0.0280 kg/mol. Write it as "0.028 g/mol" and your answer is 1000 times too small.
Kilopascals with SI density. Dividing by 101.325 kPa gives 28.0, and here the unit really is g/mol, since the kilo in kPa cancels the kilo in kg. Label it "28 kg/mol" and you are 1000 times too big.
Millilitres read as litres. If 0.500 g of gas fills 400 mL, the density is 0.500 / 0.400 = 1.25 g/L. Divide by 400 instead and you get 0.00125, so M comes out 1000 times too small. See our guide to converting cubic centimetres to litres.
R that doesn't match the pressure. Using 8.314 with pressure in atm and density in g/L gives about 2840, off by roughly 101, the number of kPa in one standard atmosphere. Our post on which value of R to use pairs each value with its units.
What is vapour density and why is M = 2 × VD?
Vapour density is the density of a gas relative to hydrogen: the mass of a volume of the gas divided by the mass of the same volume of hydrogen, and it has no units, as summarised in Wikipedia's entry on vapour density. The same entry gives vapour density = molar mass / 2.01568, where 2.01568 g/mol is the molar mass of hydrogen gas, H₂.
Why? In d = MP/RT, compare the gas and hydrogen at the same temperature and pressure: P, R and T cancel, so the density ratio equals the molar mass ratio. So VD = M / 2.016, and M ≈ 2 × VD.
Example: the NIST Chemistry WebBook lists carbon dioxide at 44.0095 g/mol, so its vapour density is about 22. Going the other way, a gas with vapour density 14 has M ≈ 28 g/mol.
A 30-second check before you write the answer
Write every quantity with its unit, including R.
Convert temperature to kelvin.
Pick the value of R that matches your pressure and volume units.
Cancel units on paper; what remains must be mass per mole.
Compare with hydrogen's 2.016 g/mol; 0.028 or 28000 means look for a 1000.
For vapour density, check whether the reference is hydrogen or air.
If you get the method right but the number wrong, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you can find the exact line where a unit slipped. If the ideal gas law itself feels shaky, the Fermi Concept Library gives each chemistry concept its own lesson and its place in the map.
Try it now: redo the last gas density question you got wrong with units on every line, the habit behind using dimensions to check your answers.



