Understanding the gas density calculator — concept and principle
Gas density is the mass of gas in a unit volume, usually in kg/m³. It decides whether a gas rises or sinks in air, how much buoyancy a balloon gets, how ventilation and leak detection should be planned, and how mass flow relates to volume flow in pipes and fans. This calculator uses the ideal gas law to find density from molar mass, pressure and temperature, and compares the gas with dry air.
How it is calculated
- ρ = P M / (R T), with R = 8.314462618 J/(mol·K).
- P is in kPa, M in g/mol and T in °C, converted to kelvin as T + 273.15. With these units the result comes out directly in kg/m³, because the factor of 1000 in kPa cancels the factor of 1000 in g/mol.
- Relative to air = M ÷ 28.97, where 28.97 g/mol is the average molar mass of dry air. At the same temperature and pressure, density is proportional to molar mass, so this ratio is the specific gravity of the gas compared with air.
The principle
The ideal gas law PV = nRT says that at a given pressure and temperature, one mole of any ideal gas takes up the same volume. Since n = m/M, rewriting gives m/V = PM/(RT). Heavier molecules therefore make a denser gas, higher pressure packs more molecules into the same space, and higher temperature spreads them out. The law works well for most gases near room conditions; it becomes less accurate at high pressure or close to condensation.
Worked example
- Inputs: M = 28.97 g/mol (dry air), P = 101.325 kPa, T = 20 °C.
- T in kelvin = 20 + 273.15 = 293.15 K.
- Numerator P × M = 101.325 × 28.97 = 2935.4.
- Denominator R × T = 8.314462618 × 293.15 = 2437.4.
- ρ = 2935.4 ÷ 2437.4 = 1.204 kg/m³.
- Relative to air = 28.97 ÷ 28.97 = 1.
| Molar mass (g/mol) | Density (kg/m³) |
|---|---|
| 7.24 | 0.3010793936 |
| 14.5 | 0.6021587873 |
| 21.7 | 0.9032381809 |
| 29 | 1.204317575 |
| 36.2 | 1.505396968 |
| 43.5 | 1.806476362 |
| 57.9 | 2.408635149 |
How to read the result
Dry air at sea-level pressure is about 1.204 kg/m³ at 20 °C and about 1.225 kg/m³ at 15 °C. A ratio above 1 means the gas is heavier than air and tends to collect in low spots (carbon dioxide, M ≈ 44 g/mol, ratio about 1.5). A ratio below 1 means it rises (helium, M ≈ 4 g/mol; methane, M ≈ 16 g/mol). Density falls by roughly 1% for every 3 °C of warming near room temperature, and also falls with altitude as pressure drops.
Common mistakes
- Entering gauge pressure instead of absolute pressure; add the local atmospheric pressure first.
- Using kelvin in the temperature field, which already expects °C.
- Entering molar mass in kg/mol (0.029) instead of g/mol (28.97).
- Ignoring humidity: moist air is slightly less dense than dry air at the same conditions.
Frequently asked questions
Why is humid air lighter than dry air?
Water vapour has a molar mass of about 18 g/mol, lower than the 28.97 g/mol of dry air, so replacing some air molecules with water molecules lowers the average molar mass.
What is the density of a gas mixture?
Use the mole-fraction-weighted average molar mass of the mixture as M, then apply the same formula.
Sources: IUPAC Compendium of Chemical Terminology (Gold Book), "ideal gas" · CODATA recommended value of the molar gas constant, NIST · ISO 2533, Standard Atmosphere