Gas Density Calculator

Compute gas density (ρ) from pressure, temperature, and molar mass. Visualize density vs. temperature, convert units, and explore real-world gas behavior.

g/mol
Common gases: Air (28.96), O₂ (32.00), N₂ (28.01), CO₂ (44.01), CH₄ (16.04)
?️ Air at STP (0°C, 1 atm)
? Oxygen at 25°C, 1 atm
? CO₂ at 30°C, 2 bar
? Methane at -20°C, 1.5 atm
?️ Hot Air (100°C, 1 atm)
Privacy first: All calculations are performed locally in your browser. No data is sent to any server.

Fundamentals of Gas Density: The Ideal Gas Law

The gas density (ρ) is a measure of mass per unit volume. For ideal gases, density is derived directly from the Ideal Gas Law: PV = nRT. By substituting n = m/M (mass over molar mass), we obtain the engineering form: ρ = PM / (RT), where P is absolute pressure, M is molar mass, R is the universal gas constant (8.314462618 J/(mol·K)), and T is absolute temperature in Kelvin. This relationship reveals that density is proportional to pressure and molar mass, and inversely proportional to temperature.

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

ρ [kg/m³], P [Pa], M [kg/mol], R = 8.31446 J/(mol·K), T [K]

Why This Calculator Is Essential

  • Engineering & Design: Calculate air density for HVAC systems, aerodynamic drag, or combustion chamber design.
  • Chemical Process Optimization: Determine gas density for pipeline flow, reactor feed, or storage tank sizing.
  • Environmental Science: Model pollutant dispersion, stack emissions, or atmospheric buoyancy.
  • Educational Tool: Visualize how temperature and pressure affect gas density in real time.

Step-by-Step Calculation Methodology

  1. Convert user inputs to SI units: Pressure to Pascals (Pa), Temperature to Kelvin (K). Molar mass from g/mol to kg/mol.
  2. Apply ideal gas equation: ρ = (P_abs * M_kg) / (R * T_K).
  3. Output density in kg/m³ and also g/L (1 kg/m³ = 1 g/L).
  4. The interactive graph plots ρ vs T (from -50°C to 200°C) at fixed current pressure, showing the theoretical hyperbolic decay. A marker indicates the current point.

Comprehensive Gas Density Reference Table

Gas Formula Molar Mass (g/mol) Density at STP (0°C, 1 atm) (kg/m³)
Air 28.96 1.293
Oxygen O₂ 32.00 1.429
Nitrogen N₂ 28.01 1.251
Carbon Dioxide CO₂ 44.01 1.977
Methane CH₄ 16.04 0.717
Hydrogen H₂ 2.016 0.090
Case Study: Air Density and Aircraft Performance

At sea level (101.325 kPa, 15°C), air density is approximately 1.225 kg/m³. For an aircraft taking off from a high-altitude airport (e.g., Denver at 1600 m, ~83.5 kPa, 20°C), the density drops to about 0.99 kg/m³. This 20% reduction directly affects lift force (L = ½ ρ v² S C_L) and engine performance. Using our calculator, pilots and engineers can quickly assess density altitude effects and adjust takeoff parameters. The interactive graph demonstrates how warming temperature at fixed pressure reduces density — critical for hot-and-high operations.

Real Gas vs. Ideal Gas: Limitations

The ideal gas law assumes no intermolecular forces and negligible molecular volume. For most engineering conditions (near atmospheric pressure and above 0°C), deviations are <2%. However, at very high pressures (>50 bar) or cryogenic temperatures, compressibility factor Z must be introduced: ρ = PM/(ZRT). This calculator focuses on ideal behavior, suitable for the vast majority of educational and practical applications. For critical scenarios, refer to NIST REFPROP or Peng-Robinson EOS.

Frequently Asked Questions

The calculator uses the universal gas constant R = 8.314462618 J/(mol·K) with double-precision arithmetic. Typical error from ideal gas assumption is less than 0.5% at ambient conditions. For extreme pressures or near condensation, consult real gas models.

Pressure: kPa, bar, atm, psi, Pa. Temperature: °C, K, °F. Internal conversion ensures consistent SI units before applying the formula.

At constant pressure, increasing temperature causes gas molecules to move faster and occupy a larger volume, reducing density (inverse proportionality).

Yes. Enter the average molar mass of the mixture. For air, the standard value is 28.9647 g/mol (including argon, CO₂). For custom blends, compute mole-weighted M.

Authoritative References & Further Reading

  • Atkins, P., & de Paula, J. (2018). Atkins' Physical Chemistry. Oxford University Press.
  • Moran, M. J., Shapiro, H. N. (2014). Fundamentals of Engineering Thermodynamics. Wiley.
  • NIST Chemistry WebBook: Thermophysical properties of fluids.
  • IUPAC Gold Book – Gas Density Definition.
Developed using standard thermodynamic relations. Reviewed by the GetZenQuery Tech team. Last update: April 2026.