Gas Density Calculator — Ideal Gas Law, Altitude, and 20+ Gases

Gas density is determined by temperature, pressure, and molar mass, following the ideal gas law: ρ = PM / (RT), where P is pressure, M is molar mass, R is the universal gas constant, and T is absolute temperature. For air-specific reference values, see density of air.

This calculator supports 20+ common gases at any temperature (−200°C to 1000°C) and pressure (0.01 atm to 300 atm). It also includes an International Standard Atmosphere (ISA) altitude model, complementing the liquid density calculator where pressure effects are usually negligible.

Calculation mode

Air (dry): M = 28.966 g/mol, ρ at STP = 1.2924 kg/m³

Air (dry) at 15°C, 101.325 kPa

1.2251

kg/m³

Also expressed as:

g/L

1.2251

g/cm³

0.0012251

lb/ft³

0.076481

Relative to air (at same T, P): 1×

Formula: ρ = PM / (RT)

P = 101,325 Pa

M = 0.028966 kg/mol

R = 8.314 J/(mol·K)

T = 288.15 K

ρ = 101,325 × 0.028966 / (8.314 × 288.15) = 1.22511 kg/m³

Note: Based on ideal gas law. Accuracy decreases at high pressures (> 10 atm) or near condensation point.

The Ideal Gas Law for Density

The ideal gas law relates pressure, volume, temperature, and the amount of gas: PV = nRT, where P is pressure (Pa), V is volume (m³), n is the number of moles, R is the universal gas constant (8.314 J/mol·K), and T is absolute temperature (K). This equation describes the behaviour of most gases at moderate temperatures and pressures with good accuracy. For the base concept, see what is density.

PV = nRT     ρ = m / V = nM / V = PM / RT

Where:

  • ρ = gas density (kg/m³)
  • P = absolute pressure (Pa)
  • M = molar mass (kg/mol)
  • R = 8.314 J/(mol·K) — universal gas constant
  • T = absolute temperature (K)

This equation reveals two fundamental relationships: (1) Gas density is directly proportional to pressure — doubling the pressure doubles the density at constant temperature. This is why compressed air in a tank at 200 bar is approximately 200 times denser than atmospheric air. (2) Gas density is inversely proportional to absolute temperature — heating a gas at constant pressure reduces its density. A gas at 300 K is twice as dense as the same gas at 600 K under the same pressure.

The ideal gas law assumes gas molecules have no volume and no intermolecular attractions. These assumptions break down at high pressures (molecules are forced close together) and low temperatures (near the condensation point, where intermolecular forces become significant). For most engineering applications at atmospheric pressure and above −50°C, the ideal gas law gives accuracy within 1–2%. For high-pressure applications, the van der Waals equation or compressibility factor (Z-factor) corrections are required.

International Standard Atmosphere (ISA) Model

The International Standard Atmosphere (ISA), defined by ICAO (International Civil Aviation Organization), provides a standard model of how atmospheric temperature, pressure, and density vary with altitude. It is the universal reference for aviation performance calculations, aircraft certification, and altimeter calibration. The ISA assumes a sea-level temperature of 15°C, sea-level pressure of 101.325 kPa, and a temperature lapse rate of 6.5°C per 1,000 m in the troposphere (0–11,000 m).

The ISA divides the atmosphere into layers with different temperature gradients (lapse rates). The troposphere (0–11,000 m) has a lapse rate of −6.5°C/km. The stratosphere (11,000–20,000 m) is isothermal at −56.5°C. Above 20,000 m, the temperature begins to rise again. The calculator uses the full ISA model up to 86,000 m.

Altitude (m)Altitude (ft)Temp (°C)Pressure (kPa)Density (kg/m³)Density Ratio (σ)
0015.0101.3251.22501.000
5001,64011.895.4611.16730.953
1,0003,2818.589.8751.11170.908
1,5004,9215.284.5561.05810.864
2,0006,5622.079.4951.00660.822
3,0009,843−4.570.1090.90930.742
4,00013,123−11.061.6400.81940.669
5,00016,404−17.554.0480.73640.601
6,00019,685−24.047.2170.66010.539
8,00026,247−37.035.6000.52580.429
10,00032,808−50.026.5000.41350.338
11,00036,089−56.522.6320.36390.297
15,00049,213−56.512.1120.19480.159
20,00065,617−56.55.5290.08890.073
30,00098,425−46.61.1970.01840.015

σ (sigma) = density ratio = ρ / ρ₀, where ρ₀ = 1.225 kg/m³ (sea level). Pilots use density ratio to calculate "density altitude" — the altitude in the standard atmosphere that has the same density as the current conditions. High density altitude (hot, high-elevation airports) reduces lift and engine performance.

Gas Density Comparison at Standard Conditions

These are common gas densities at standard conditions (STP: 0°C, 101.325 kPa), ordered from low to high density and compared with air.

GasFormulaDensity at STP (kg/m³)vs AirBehavior in Air
HydrogenH₂0.08990.070×Rises rapidly
HeliumHe0.17850.138×Rises rapidly
MethaneCH₄0.71680.555×Rises (natural gas leaks upward)
AmmoniaNH₃0.77100.597×Rises
Water vaporH₂O0.80400.622×Rises (humid air is lighter)
NeonNe0.90020.697×Rises slowly
NitrogenN₂1.25060.968×Nearly neutral
Air (dry)1.29221.000×Reference
Carbon monoxideCO1.24980.968×Nearly neutral (dangerous)
OxygenO₂1.42891.106×Sinks slowly
ArgonAr1.78371.381×Sinks
Carbon dioxideCO₂1.97681.530×Sinks (CO₂ accumulates low)
PropaneC₃H₈2.00981.556×Sinks (LPG leaks are dangerous)
ButaneC₄H₁₀2.59882.012×Sinks rapidly
ChlorineCl₂3.16402.450×Sinks rapidly
XenonXe5.89714.564×Sinks very rapidly

Safety implication: Gases lighter than air (hydrogen, methane, natural gas) accumulate near ceilings in enclosed spaces. Gases heavier than air (propane, butane, CO₂, chlorine) accumulate near floors and in low-lying areas such as basements, trenches, and pits — creating asphyxiation or explosion hazards that are not immediately obvious. For a broader reference across solids, liquids, gases, and minerals, see the density table.

Practical Applications

Aviation — Density Altitude

Aircraft performance (lift, engine power, propeller efficiency) depends directly on air density. On a hot day at a high-altitude airport, air density can be 20–30% lower than standard sea-level conditions, dramatically increasing the required takeoff distance and reducing climb rate. Pilots calculate "density altitude" — the ISA-equivalent altitude for current conditions — before every takeoff.

HVAC and Ventilation

Heating, ventilation, and air conditioning systems move specific masses of air to control temperature and air quality. Since air density decreases with temperature, a fan moving a fixed volume of hot air delivers less mass (and therefore less oxygen and less heat capacity) than the same fan moving cold air. HVAC engineers use density-corrected calculations for fan sizing, duct design, and energy consumption estimates.

Industrial Gas Storage

Compressed gas cylinders store gas at 150–300 bar. At 200 bar and 20°C, air density is approximately 240 kg/m³ — about 200 times atmospheric density. A standard 50-litre cylinder at 200 bar contains approximately 12 kg of air, equivalent to 10,000 litres at atmospheric pressure. Gas density calculations are essential for cylinder capacity, pipeline sizing, and safety relief valve design.

Combustion and Emissions

The air-fuel ratio in combustion engines is controlled by mass, not volume. At high altitude, the lower air density means less oxygen per intake stroke, requiring fuel injection systems to reduce fuel delivery proportionally to maintain the correct stoichiometric ratio. Turbocharged engines use a compressor to restore air density to near sea-level values regardless of altitude.

Calculate with Gas Density

Frequently Asked Questions

What is the density of air at sea level?

At standard sea-level conditions (15°C, 101.325 kPa), dry air has a density of 1.225 kg/m³. At 0°C (STP), air density is 1.293 kg/m³. The density decreases with altitude: at 10,000 m (typical cruising altitude), air density is only 0.414 kg/m³ — about one-third of sea-level density. See density of air for the full reference.

How do I calculate gas density using the ideal gas law?

Use the formula ρ = PM / (RT), where P is absolute pressure in Pascals, M is molar mass in kg/mol, R is 8.314 J/(mol·K), and T is absolute temperature in Kelvin. For example, CO₂ (M = 0.04401 kg/mol) at 25°C (298.15 K) and 1 atm (101,325 Pa): ρ = 101,325 × 0.04401 / (8.314 × 298.15) = 1.796 kg/m³.

Why is helium used in balloons instead of hydrogen?

Both helium (0.179 kg/m³) and hydrogen (0.090 kg/m³) are much less dense than air (1.225 kg/m³) and provide buoyancy. Hydrogen provides slightly more lift because it is lighter, but it is highly flammable and explosive when mixed with air. Helium is chemically inert and non-flammable, making it safe for use in populated areas. The small reduction in lift is a worthwhile trade-off for safety.

Why does CO₂ sink to the floor?

Carbon dioxide (M = 44 g/mol, ρ = 1.977 kg/m³ at STP) is about 53% denser than air (M = 28.97 g/mol, ρ = 1.293 kg/m³). In still air, CO₂ tends to settle in low-lying areas. This is why CO₂ from dry ice or fire suppression systems accumulates near the floor and in basements, creating asphyxiation hazards in confined spaces even though CO₂ is not toxic at low concentrations.

How does pressure affect gas density?

Gas density is directly proportional to pressure (at constant temperature). Doubling the pressure doubles the density. This follows directly from the ideal gas law: ρ = PM/(RT). At 200 bar (typical compressed gas cylinder), air density is approximately 200 times higher than at atmospheric pressure — about 240 kg/m³ compared to 1.225 kg/m³.

What is density altitude and why does it matter?

Density altitude is the altitude in the International Standard Atmosphere that corresponds to the actual air density at a given location. It accounts for both elevation and temperature. On a hot day (35°C) at an airport at 1,500 m elevation, the density altitude might be 2,800 m — meaning the air is as thin as it would be at 2,800 m in the standard atmosphere. Aircraft performance tables are based on density altitude, not geometric altitude.