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.
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 (σ) |
|---|---|---|---|---|---|
| 0 | 0 | 15.0 | 101.325 | 1.2250 | 1.000 |
| 500 | 1,640 | 11.8 | 95.461 | 1.1673 | 0.953 |
| 1,000 | 3,281 | 8.5 | 89.875 | 1.1117 | 0.908 |
| 1,500 | 4,921 | 5.2 | 84.556 | 1.0581 | 0.864 |
| 2,000 | 6,562 | 2.0 | 79.495 | 1.0066 | 0.822 |
| 3,000 | 9,843 | −4.5 | 70.109 | 0.9093 | 0.742 |
| 4,000 | 13,123 | −11.0 | 61.640 | 0.8194 | 0.669 |
| 5,000 | 16,404 | −17.5 | 54.048 | 0.7364 | 0.601 |
| 6,000 | 19,685 | −24.0 | 47.217 | 0.6601 | 0.539 |
| 8,000 | 26,247 | −37.0 | 35.600 | 0.5258 | 0.429 |
| 10,000 | 32,808 | −50.0 | 26.500 | 0.4135 | 0.338 |
| 11,000 | 36,089 | −56.5 | 22.632 | 0.3639 | 0.297 |
| 15,000 | 49,213 | −56.5 | 12.112 | 0.1948 | 0.159 |
| 20,000 | 65,617 | −56.5 | 5.529 | 0.0889 | 0.073 |
| 30,000 | 98,425 | −46.6 | 1.197 | 0.0184 | 0.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.
| Gas | Formula | Density at STP (kg/m³) | vs Air | Behavior in Air |
|---|---|---|---|---|
| Hydrogen | H₂ | 0.0899 | 0.070× | Rises rapidly |
| Helium | He | 0.1785 | 0.138× | Rises rapidly |
| Methane | CH₄ | 0.7168 | 0.555× | Rises (natural gas leaks upward) |
| Ammonia | NH₃ | 0.7710 | 0.597× | Rises |
| Water vapor | H₂O | 0.8040 | 0.622× | Rises (humid air is lighter) |
| Neon | Ne | 0.9002 | 0.697× | Rises slowly |
| Nitrogen | N₂ | 1.2506 | 0.968× | Nearly neutral |
| Air (dry) | — | 1.2922 | 1.000× | Reference |
| Carbon monoxide | CO | 1.2498 | 0.968× | Nearly neutral (dangerous) |
| Oxygen | O₂ | 1.4289 | 1.106× | Sinks slowly |
| Argon | Ar | 1.7837 | 1.381× | Sinks |
| Carbon dioxide | CO₂ | 1.9768 | 1.530× | Sinks (CO₂ accumulates low) |
| Propane | C₃H₈ | 2.0098 | 1.556× | Sinks (LPG leaks are dangerous) |
| Butane | C₄H₁₀ | 2.5988 | 2.012× | Sinks rapidly |
| Chlorine | Cl₂ | 3.1640 | 2.450× | Sinks rapidly |
| Xenon | Xe | 5.8971 | 4.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.