The formula behind it
ρ = P × M ÷ (R × T)- M
- molar mass in g/mol (formula input supported)
- P / T
- absolute pressure and kelvin temperature
Gas density is the ideal gas law rearranged with molar mass substituted for n/V: ρ = PM/RT. It explains the kitchen-table facts — CO₂ (44 g/mol) is denser than air (28.97), helium (4) is not, and hot-air balloons work because heating lowers ρ at fixed pressure. The same-number line in kg/m³ exists because 1 g/L equals 1 kg/m³, keeping unit conversions from hiding the physics.
How to use this calculator
- 1
Enter pressure (atm or kPa), temperature (K or °C), and the gas's molar mass — type the formula and it is computed.
- 2
Press Calculate to see density in g/L and a comparison against air.
- 3
Compare the result against air's roughly 1.2 g/L at room conditions — lighter gases rise, heavier ones pool.
Worked examples
Air at sea level
1 atm, 293.15 K, M 28.97 → 1.204 g/L — the '1.2 kg/m³' of aeronautics.
CO₂ at 25 °C
1 atm, 298.15 K, M 44.01 → 1.799 g/L — 1.47× air, hence its lake-bottom lethality.