Gas Density Calculator
Calculate gas density at any temperature and pressure.
Enter the molar mass, pressure, and temperature to find density in g/L using the ideal gas law.
The density of an ideal gas at any temperature and pressure follows directly from the ideal gas law (PV = nRT).
Since density = mass/volume and molar mass M = mass/moles:
d = PM / RT
Where P is pressure in atmospheres, M is molar mass in g/mol, R is the ideal gas constant (0.08206 L·atm/mol·K), and T is temperature in Kelvin.
To convert Celsius to Kelvin: T(K) = T(°C) + 273.15
For example, nitrogen gas (M = 28.02 g/mol) at STP (1 atm, 0°C = 273.15 K): d = (1 × 28.02) / (0.08206 × 273.15) = 1.250 g/L
At SATP (1 atm, 25°C = 298.15 K): d = (1 × 28.02) / (0.08206 × 298.15) = 1.145 g/L
The formula reveals why hot air rises (lower density) and why dense gases like sulfur hexafluoride (SF₆, M = 146 g/mol) sink to the floor and create the famous “floating boat” demonstrations in chemistry classrooms.
At very high pressures or low temperatures, real gases deviate from ideal behavior. Intermolecular attractions and molecular volume become significant. The van der Waals equation handles these corrections, but for most laboratory and engineering conditions below 10 atm, the ideal gas equation gives results within a few percent.
To find molar mass from measured density: M = dRT/P — this is how early chemists determined molecular weights before mass spectrometry.