Gas Density Calculator

Calculate ideal gas density from molar mass, temperature, and pressure using ρ = PM/(RT). Presets for 12 common gases with comparison chart.

About the Gas Density Calculator

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 shows all 12 gases at your chosen conditions, which makes it easier to compare buoyancy, ventilation needs, or reaction volumes.

Why Use This Gas Density Calculator?

Gas density comes up in HVAC, combustion, ballooning, gas storage, reactor design, and air-quality work. A calculator is faster than doing the same ideal-gas rearrangement by hand every time you change pressure, temperature, or gas type.

The multi-gas comparison table is especially useful when you want to compare how a gas behaves relative to air at the same conditions.

How to Use This Calculator

  1. Select a preset gas or choose "Custom" and enter the molar mass in g/mol.
  2. Enter the temperature and select the unit (K, °C, or °F).
  3. Enter the absolute pressure and select the unit (Pa, kPa, atm, bar, psi, mmHg).
  4. View density in kg/m³ and g/L, molar volume, specific volume, and speed of sound.
  5. Check the comparison chart to see how your gas compares to others at the same conditions.

Formula

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.

Example Calculation

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).

Tips & Best Practices

The Ideal Gas Law and Density

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).

Practical Applications

| 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 ρ |

Sources & Methodology

Last updated:

Frequently Asked Questions

Does this work for real gases?

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.

What is STP in chemistry?

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.

Why is helium so light?

Helium has a molar mass of only 4.003 g/mol, about 7x lighter than air (28.97 g/mol). At the same T and P, gas density is proportional to molar mass.

How does altitude affect gas density?

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.

Can I use gauge pressure?

No. The ideal gas law requires absolute pressure. Add atmospheric pressure to gauge pressure: P_abs = P_gauge + P_atm.

What is the speed of sound estimate?

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.

Related Pages