Ideal Gas Density Calculator

Calculate gas density using ρ = PM/(RT). Find density of any gas from pressure, temperature, and molar mass with built-in gas database and unit conversions.

°C
kPa
Gas Density
1.1841 kg/m³
Mass per unit volume
Density (g/L)
1.1841
Grams per liter (same as kg/m³)
Density (lb/ft³)
0.073922
Imperial units
Specific Volume
0.8445 m³/kg
844.51 L/kg
Number Density
2.461e+25 /m³
Molecules per cubic meter
Mean Free Path
66.8 nm
Avg distance between molecular collisions
Speed of Sound
346.1 m/s
For diatomic gas (γ = 1.4)
Molar Mass
28.970 g/mol
Molecular weight of the gas
Density Comparison (at current T, P)
Air
1.184
Nitrogen (N₂)
1.145
Oxygen (O₂)
1.308
Carbon Dioxide (CO₂)
1.799
Hydrogen (H₂)
0.082
Helium (He)
0.164
Methane (CH₄)
0.656
Argon (Ar)
1.633
GasM (g/mol)ρ at STP (kg/m³)ρ at Current (kg/m³)
Air28.9701.29251.1841
Nitrogen (N₂)28.0141.24981.1450
Oxygen (O₂)32.0001.42771.3080
Carbon Dioxide (CO₂)44.0101.96351.7989
Hydrogen (H₂)2.0160.08990.0824
Helium (He)4.0030.17860.1636
Methane (CH₄)16.0400.71560.6556
Argon (Ar)39.9481.78231.6328
Propane (C₃H₈)44.1001.96751.8025
Ammonia (NH₃)17.0310.75980.6961
Water Vapor (H₂O)18.0150.80370.7363
Planning notes, formulas, and examples

About the Ideal Gas Density Calculator

The **Ideal Gas Density Calculator** determines the density of any gas using the ideal gas law rearranged to ρ = PM/(RT). Gas density depends on three factors: pressure, temperature, and the molecular weight of the gas. This relationship is fundamental to atmospheric science, chemical engineering, combustion analysis, and HVAC system design.

Understanding gas density is essential in numerous applications. Lighter-than-air gases like hydrogen and helium float because their low molar mass gives them lower density than air. Hot air rises because heating decreases density. Industrial gas handling, pipeline design, and combustion calculations all require accurate density data at specific conditions.

This calculator includes a database of common gases with their molar masses, provides density in multiple unit systems, and computes derived quantities including specific volume, number density, mean free path, and speed of sound. Compare densities of different gases side by side at your specified conditions.

When This Page Helps

Gas density calculations are needed constantly in chemical engineering, atmospheric science, combustion analysis, and HVAC design. This calculator handles any gas at any stated conditions, with a built-in database that removes the need to look up molar masses separately.

The comparison charts make it easy to see relative densities of different gases at your specified conditions — useful for gas mixture analysis, leak behavior prediction, and buoyancy calculations.

How to Use the Inputs

  1. Select a gas from the dropdown or choose "Custom" to enter a molar mass.
  2. Enter the temperature in your preferred unit (°C, °F, or K).
  3. Enter the pressure in your preferred unit (kPa, atm, bar, psi, or mmHg).
  4. Use preset buttons for common conditions (STP, 25°C, high pressure).
  5. Read density in kg/m³, g/L, and lb/ft³ from the output cards.
  6. Review the comparison chart and table to see how different gases compare.
Formula used
Gas Density: ρ = PM / (RT) Where: - ρ = density (kg/m³) - P = pressure (Pa) - M = molar mass (kg/mol) - R = universal gas constant = 8.31446 J/(mol·K) - T = temperature (K) Specific Volume: v = 1/ρ (m³/kg) Number Density: n = P/(k_B·T) (molecules/m³)

Example Calculation

Result: 1.1839 kg/m³

Air (M = 28.97 g/mol) at 25°C (298.15 K) and 101.325 kPa: ρ = (101325 × 0.02897) / (8.31446 × 298.15) = 1.1839 kg/m³. Slightly less than the standard density of 1.225 kg/m³ at 15°C because warm air is less dense.

Tips & Best Practices

  • At constant pressure, gas density is inversely proportional to temperature — doubling T halves density.
  • Gas density is directly proportional to pressure — doubling P doubles density.
  • Air density at sea level ranges from ~1.4 kg/m³ (cold winter) to ~1.1 kg/m³ (hot summer).
  • For gas mixtures, use a weighted average molar mass based on mole fractions.
  • The speed of sound increases with temperature because it depends on molecular velocity.
  • Number density at STP is about 2.69 × 10²⁵ per m³ (Loschmidt constant).

Gas Density and the Ideal Gas Law

The ideal gas density formula ρ = PM/(RT) is a direct rearrangement of PV = nRT. By substituting n = m/M and rearranging, we get ρ = m/V = PM/(RT). This elegant formula shows that density depends only on pressure, temperature, and the molecular identity of the gas.

For gas mixtures like air, we use the average molar mass weighted by mole fractions. Air's effective molar mass of 28.97 g/mol reflects its composition: 78% N₂ (28.01), 21% O₂ (32.00), and 1% Ar (39.95). Humid air is actually slightly less dense than dry air because water vapor (M = 18.02) replaces heavier N₂ and O₂ molecules.

Engineering Applications

**Combustion:** Fuel-air ratios and flame temperatures depend critically on air density. At altitude, engines produce less power because less dense air delivers fewer oxygen molecules per cylinder volume.

**Pipeline Design:** Gas pipeline pressure drops and flow rates require accurate density at operating conditions. Natural gas density varies with composition (methane content), pressure, and temperature along the pipeline.

**Balloon and Airship Design:** The lifting force equals the weight of air displaced minus the weight of the enclosed gas. Helium (ρ = 0.164 kg/m³ at STP) provides about 1.0 kg of lift per cubic meter compared to air.

Real Gas Effects

The ideal gas law assumes no intermolecular forces and zero molecular volume. Real gases deviate from this, especially near their critical points. The compressibility factor Z = PV/(nRT) quantifies the deviation: Z = 1 for ideal behavior, Z < 1 when attractive forces dominate, and Z > 1 when molecular volume matters. For air at atmospheric conditions, Z ≈ 0.9997 — the ideal gas assumption is excellent.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Standard Temperature and Pressure: 0°C (273.15 K) and 101.325 kPa (1 atm). At STP, air density is 1.292 kg/m³. Some references use 25°C as standard, giving 1.184 kg/m³.