How to Use the Gas Density Calculator
Unlike liquids and solids, a gas has no fixed density — how tightly its molecules are packed depends directly on pressure and temperature. This calculator uses the ideal gas law to compute density, specific gravity relative to air, and molar volume from three inputs: the gas's molar mass, its absolute pressure, and its absolute temperature.
Deriving density from the ideal gas law
The ideal gas law states PV = nRT, where P is absolute pressure, V is volume, n is the number of moles, R is the universal gas constant (8.314 J/(mol·K), equivalently Pa·m³/(mol·K)), and T is absolute temperature. Since the number of moles n equals mass m divided by molar mass M, substituting n = m/M gives PV = (m/M)RT. Rearranging for density (ρ = m/V) yields the working formula: ρ = PM / (RT). Plug in air's molar mass (28.97 g/mol = 0.02897 kg/mol) at 1 atm (101,325 Pa) and 25°C (298.15 K) and you get ρ = (101325 × 0.02897) / (8.314 × 298.15) ≈ 1.184 kg/m³, matching the standard reference value for air at room temperature.
Picking correct units and the gas constant
Temperature must always be converted to Kelvin (K = °C + 273.15, or K = (°F − 32) × 5/9 + 273.15) — the ideal gas law only works with absolute temperature, and plugging in Celsius or Fahrenheit directly gives meaningless results. This calculator converts your pressure input (atm, kPa, Pa, bar, psi, or mmHg) to pascals and your temperature to Kelvin internally, then applies R = 8.314 J/(mol·K) with molar mass converted to kg/mol so the result comes out in kg/m³. Specific gravity (vapor density) compares a gas's molar mass directly to air's 28.97 g/mol, since the pressure and temperature terms cancel out when two gases are compared under the same conditions.
Real-world applications
- HVAC and ventilation engineers use gas density to size ductwork and calculate airflow mass rates at different altitudes and temperatures.
- Natural gas and industrial piping calculations use density to convert between volumetric and mass flow rates for billing and safety analysis.
- Specific gravity relative to air tells safety engineers whether a leaking gas (propane, natural gas, hydrogen) will pool near the floor or rise and disperse.
- Meteorologists and aviators use air density to calculate lift, engine performance, and "density altitude" for aircraft takeoff planning.