Calculate ideal gas density from molar mass, temperature, and pressure using ρ = PM/(RT). Presets for 12 common gases with comparison chart.
The ideal gas law gives density directly: ρ = PM/(RT), where P is absolute pressure, M is molar mass, R is the universal gas constant, and T is absolute temperature. This calculator computes gas density for any gas at any temperature and pressure.
Choose from 12 preset gases—including air, nitrogen, oxygen, CO₂, helium, hydrogen, argon, methane, propane, ammonia, SO₂, and water vapor—or enter a custom molar mass. The calculator supports six pressure units (Pa, kPa, atm, bar, psi, mmHg) and three temperature units (K, °C, °F).
Results include density in kg/m³ and g/L, molar volume, specific volume, and an estimated speed of sound. The side-by-side comparison chart and table show all 12 gases at your chosen conditions, making it easy to compare buoyancy, ventilation needs, or reaction volumes. Check the example with realistic values before reporting. Use the steps shown to verify rounding and units. Cross-check this output using a known reference case. Use the example pattern when troubleshooting unexpected results.
Gas density is fundamental to HVAC, combustion, ballooning, gas storage, chemical reactor design, and air quality calculations. This calculator gives instant results with full unit flexibility and a unique multi-gas comparison.
The side-by-side comparison table is especially useful for ventilation engineering (heavier-than-air gases settle, lighter ones rise) and for estimating gas storage requirements at non-standard conditions.
Ideal Gas Density: ρ = PM / (RT), where P = absolute pressure (Pa), M = molar mass (kg/mol), R = 8.31446 J/(mol·K), T = absolute temperature (K). Molar Volume: V_m = RT/P. Speed of Sound (approx): c = √(γRT/M) with γ ≈ 1.4 for diatomic gases.
Result: 1.2922 kg/m³
ρ = (101325 × 0.02897) / (8.31446 × 273.15) = 1.2922 kg/m³. This is the standard air density at STP (0 °C, 1 atm).
The ideal gas equation PV = nRT can be rearranged by substituting n = m/M (mass over molar mass) and rearranging to ρ = PM/(RT). This elegant form shows that gas density is directly proportional to pressure and molar mass, and inversely proportional to temperature.
Key insight: at the same T and P, any gas's density is proportional to its molar mass. This is why the "relative density to air" column in the comparison table equals M_gas / M_air (= M_gas / 28.97).
| Application | Gas Property Used | |---|---| | Hot air balloons | Lower ρ of heated air vs. ambient | | Helium balloons | Low M and therefore low ρ | | CO₂ fire suppression | CO₂ sinks (heavier than air) | | Combustion air flow | Air density at elevation and temperature | | Natural gas metering | CH₄ density at line T and P | | Diving gas mixtures | Respiratory resistance depends on ρ |
It assumes ideal behavior (Z = 1). For most gases at moderate pressures and temperatures, the error is under 2%. At very high pressures or near the boiling point, use the van der Waals or Peng-Robinson equation instead.
Standard Temperature and Pressure: 0 °C (273.15 K) and 1 atm (101325 Pa). At STP, one mole of ideal gas occupies 22.414 L.
Helium has a molar mass of only 4.003 g/mol—about 7× lighter than air (28.97 g/mol). At the same T and P, gas density is proportional to molar mass.
As altitude increases, pressure drops and density decreases. At 5,500 m (~18,000 ft), atmospheric pressure is about half sea-level, so air density is roughly half as well.
No—the ideal gas law requires absolute pressure. Add atmospheric pressure to gauge pressure: P_abs = P_gauge + P_atm.
The calculator uses c = √(γRT/M) with γ = 1.4, which is accurate for diatomic gases (N₂, O₂, air). For monatomic gases (He, Ar), γ = 5/3, giving a higher speed.