Calculate gas density using ρ = PM/RT from the ideal gas law. Enter pressure, temperature, and molar mass to get density in kg/m³ and g/L. Presets for air, CO₂, nitrogen, hydrogen, and more.
✓Verified: NIST CODATA 2022 — April 2026
Pa
Please enter a valid pressure greater than zero.
Absolute pressure of the gas
°C
Temperature must be above absolute zero (−273.15°C).
Temperature of the gas
g/mol
Please enter a valid molar mass.
Molecular weight of the gas
💡 ρ = PM/RT P in Pa | M in kg/mol | R = 8.314 J/(mol⋅K) | T in Kelvin
1 kg/m³ = 1 g/L (exact conversion).
Gas Density (ρ)
—
Was this calculator helpful?
Thanks for your feedback!
Was this calculator helpful?
✓ Thanks for your feedback!
Sources & Methodology
✓Formula and constants verified against NIST CODATA 2022 and IUPAC standard reference data.
Reference for molar masses and density values of common gases used in preset verification.
Formula: ρ = P × M / (R × T)
P converted to Pa | M in kg/mol (g/mol ÷ 1000) | T in Kelvin (°C + 273.15 or (°F − 32) × 5/9 + 273.15)
R = 8.314462618 J/(mol·K) Specific volume: v = 1/ρ (m³/kg) Specific gravity vs air: SG = M / 28.97 Unit note: 1 kg/m³ = 1 g/L (exact, since 1 m³ = 1000 L and 1 kg = 1000 g)
⏱ Last reviewed: April 2026
How to Calculate Gas Density in 2026
Gas density is the mass of gas per unit volume, typically expressed in kg/m³ or g/L. Unlike liquids and solids, gas density depends strongly on temperature and pressure because gases are highly compressible. The ideal gas law provides an accurate density formula for most engineering applications at moderate pressures and temperatures away from the boiling point.
The Gas Density Formula
ρ = PM / (RT)
ρ = density (kg/m³) P = pressure (Pa) M = molar mass (kg/mol) R = 8.314 J/(mol⋅K) T = temperature (Kelvin)
Example — air at 25°C, 1 atm:
ρ = 101325 × 0.02897 / (8.314 × 298.15) = 2933.4 / 2478.8 = 1.184 kg/m³
Gas Density Reference Table at 25°C, 1 atm (101325 Pa)
Gas
Formula
Molar Mass (g/mol)
Density (kg/m³)
vs Air
Hydrogen
H₂
2.016
0.0824
0.069× (lightest)
Helium
He
4.003
0.164
0.138×
Methane
CH₄
16.04
0.656
0.554×
Nitrogen
N₂
28.02
1.145
0.967×
Air
—
28.97
1.184
1.000× (reference)
Oxygen
O₂
32.00
1.308
1.105×
Argon
Ar
39.95
1.633
1.380×
Carbon dioxide
CO₂
44.01
1.799
1.520×
Propane
C₃H⁸
44.10
1.803
1.523×
How Temperature and Pressure Affect Gas Density
Gas density is directly proportional to pressure and inversely proportional to absolute temperature. Doubling pressure doubles density; doubling Kelvin temperature halves density. For air: at 0°C (sea level) density = 1.293 kg/m³; at 100°C it drops to 0.946 kg/m³. At 2,000 m altitude (pressure ~79 kPa), air density falls to ~0.942 kg/m³ — nearly 25% less than at sea level.
Practical Applications
HVAC design: Air density determines fan sizing, duct flow rates, and coil performance — must account for elevation and temperature
Combustion engineering: Fuel-air mixture stoichiometry depends on gas densities at intake conditions
Gas storage: Tank sizing and weight calculations for compressed gas cylinders
Buoyancy and lift: Hot air balloon lift = (air density − hot air density) × g × volume
💡 Specific gravity of gases: For ideal gases, specific gravity relative to air = M_gas / M_air = M / 28.97. Gases with SG < 1 (hydrogen, helium, methane) rise in air; those with SG > 1 (CO₂, propane, argon) sink and can accumulate in low-lying areas — an important safety consideration for gas leak detection.
Frequently Asked Questions
Gas density rho = PM / (RT), where P is absolute pressure in Pascals, M is molar mass in kg/mol, R = 8.314 J/(mol·K) is the universal gas constant, and T is absolute temperature in Kelvin. This is derived from the ideal gas law PV = nRT combined with density = mass/volume = nM/V.
Air density at STP (0°C, 101325 Pa) is approximately 1.293 kg/m³. At 20°C and 101325 Pa it is approximately 1.204 kg/m³. At 25°C (standard room temperature) it is approximately 1.184 kg/m³. Air has a molar mass of 28.97 g/mol (mixture of N₂, O₂, and Ar).
Gas density is inversely proportional to absolute temperature (Kelvin). Doubling T in Kelvin halves the density. Air at 0°C (273 K) = 1.293 kg/m³; at 100°C (373 K) = 0.946 kg/m³ — a 27% reduction. This is why hot air rises and why engines lose power in hot weather.
Gas density is directly proportional to pressure. Doubling pressure doubles density at constant temperature. At sea level (101325 Pa) air density ≈ 1.204 kg/m³; at 2,000 m altitude (~79,500 Pa) ≈ 0.942 kg/m³. Aircraft cabins are pressurised to maintain sufficient air density for passengers.
Key molar masses: Air = 28.97, N₂ = 28.02, O₂ = 32.00, CO₂ = 44.01, H₂ = 2.016, He = 4.003, CH₄ = 16.04, Ar = 39.95, propane C₃H₈ = 44.10, water vapour H₂O = 18.02 g/mol. Molar mass equals the sum of atomic masses for each atom in the molecule.
CO₂ has a molar mass of 44.01 g/mol versus 28.97 g/mol for air — about 52% heavier per mole. At the same temperature and pressure, density is proportional to molar mass, so CO₂ is approximately 44.01/28.97 = 1.52 times denser than air. This causes CO₂ to accumulate in cellars, mines, and low-lying areas, making it a confined-space hazard.
The conversion factor is exactly 1:1 — 1 kg/m³ = 1 g/L. This is because 1 m³ = 1000 L and 1 kg = 1000 g, so the factors cancel. Air at 1.204 kg/m³ equals 1.204 g/L. No calculation is needed — just change the units label.
STP (IUPAC 1982): 0°C and 100,000 Pa. At STP, 1 mol of ideal gas occupies 22.711 L. NTP: 20°C and 101,325 Pa — used in engineering. NIST Standard: 20°C and 101,325 Pa. Always specify the standard when reporting gas density, as the different definitions give different values.
Specific gravity of a gas = its density divided by air density at the same conditions. For ideal gases this simplifies to: SG = M_gas / M_air = M / 28.97. Gases with SG less than 1 (H₂ = 0.069, He = 0.138, CH₄ = 0.554) rise in air. Gases with SG greater than 1 (CO₂ = 1.52, propane = 1.52) sink to the floor.
The ideal gas law rho = PM/RT fails at high pressures (above ~10 MPa), temperatures near the boiling/condensation point, or at critical points. For accuracy under these conditions, use the real gas compressibility factor Z: rho = PM / (ZRT). Z = 1 for ideal gas; it deviates from 1 as pressure increases or temperature drops toward the critical point.
Calculate the average molar mass: M_mix = sum of (mole fraction × molar mass) for each component. For dry air: M = 0.78 × 28.02 + 0.21 × 32.00 + 0.01 × 39.95 = 28.97 g/mol. Then apply rho = PM_mix / (RT). This calculator accepts any molar mass, so you can input the mixture average directly.