M = dRT / P
The ideal gas law PV = nRT rearranges to PV = (m/M)RT, giving d = PM/(RT) or M = dRT/P. By measuring the density of an unknown gas at known T and P, its molar mass can be calculated. At STP (0°C, 1 atm), gas density in g/L equals M/22.414. The Dumas method (1826) heats a volatile liquid in a flask until it vaporizes, then weighs the condensed vapor to find d and thus M. This technique identified many molecular weights before mass spectrometry existed. For real gases at high pressures, the compressibility factor Z must be included: M = dZRT/P. Common gas densities at STP: H₂ = 0.090 g/L, N₂ = 1.25, O₂ = 1.43, CO₂ = 1.96, SF₆ = 6.52.