Gas Density Calculator

Calculate gas density from pressure, temperature and molar mass — or solve for P or T.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Gas density tells you how much mass a given volume of gas contains. It is a fundamental quantity in aerodynamics, combustion engineering, HVAC design, pipeline sizing, altitude physiology, and atmospheric science. This calculator derives density from first principles using the ideal gas law, one of the most precisely verified relationships in physics.

How it works

The ideal gas law states:

PV = nRT

where P is absolute pressure (Pa), V is volume (m³), n is amount (mol), R is the universal gas constant (8.31446 J·mol⁻¹·K⁻¹, CODATA 2018), and T is absolute temperature (K). Because density ρ = mass/volume = nM/V (where M is the molar mass in kg/mol), the law rearranges directly to:

ρ = (P × M) / (R × T)

All three quantities can be the unknown. The calculator supports solving for:

  • ρ — the most common use: what is the density of gas X at this P and T?
  • P — what pressure produces a target density at a given temperature?
  • T — what temperature corresponds to a measured density at a known pressure?

Every input accepts multiple units (Pa / kPa / bar / atm / psi / mmHg for pressure; K / °C / °F for temperature; kg/m³ / g/L / g/cm³ / lb/ft³ for density). Conversions happen automatically before the formula runs.

Worked example — CO₂ at pipeline conditions

Suppose you need the density of carbon dioxide at 5 MPa and 40 °C — typical conditions near the inlet of a CO₂ compression train.

  1. M = 44.01 g/mol = 0.04401 kg/mol
  2. P = 5 × 10⁶ Pa
  3. T = 40 + 273.15 = 313.15 K
  4. ρ = (5 000 000 × 0.04401) / (8.31446 × 313.15)
  5. ρ = 220 050 / 2603.8 ≈ 84.5 kg/m³

That is roughly 70 times denser than CO₂ at atmospheric pressure (1.96 kg/m³). Note that at 5 MPa the ideal gas approximation begins to diverge from measured values; real CO₂ near its critical point (73.8 atm, 31 °C) requires a compressibility correction. For conditions below ~1 MPa the formula is accurate to better than 1%.

GasMolar mass (g/mol)Density at 25 °C / 1 atm (kg/m³)
Hydrogen H₂2.0160.082
Helium He4.0030.164
Methane CH₄16.040.655
Dry air28.971.184
Oxygen O₂32.001.308
Argon Ar39.951.633
CO₂44.011.799
Propane C₃H₈44.101.802

Formula note

The derivation is exact within the ideal-gas approximation. Deviations arise from intermolecular forces (van der Waals interactions) and finite molecular volume, both captured by the compressibility factor Z. At atmospheric pressure Z ≈ 1.000 ± 0.001 for most gases, so the ideal formula is engineering-grade accurate for most everyday calculations — weather balloons, lab-bench gas flow, ventilation rates, and molar mass determination from measured density. For high-pressure (above ~5 MPa) or low-temperature (within ~50 K of the boiling point) work, use ρ = PM / (ZRT) with a tabulated or equation-of-state Z value.

Ad placeholder (rectangle)