Gas Density Calculator
Calculate the density of any gas from its absolute pressure, temperature, and molar mass using the ideal gas law. Enter values in kPa, Pa, bar, atm, psi, or mmHg and °C, K, or °F — the result is shown in kg/m³, g/L, and lb/ft³.
Find the Density of a Gas from Pressure and Temperature
Gas Density Formula
Where:
- \(\rho\) — density of the gas (kg/m³)
- \(P\) — absolute pressure of the gas (Pa)
- \(M\) — molar mass of the gas (kg/mol)
- \(R\) — universal gas constant, \(8.314462618\ \text{J·mol}^{-1}\text{·K}^{-1}\)
- \(T\) — absolute temperature (K)
This is the ideal gas law \(PV = nRT\) rearranged for density: since \(n = m/M\), the density \(\rho = m/V\) reduces to pressure times molar mass divided by \(RT\). The same relation gives the molar volume, \(V_m = RT/P\), so \(\rho = M / V_m\).
Gas Density – Calculation Example
Example: find the density of dry air (M = 28.97 g/mol) at 101.325 kPa and 25 °C — standard ambient conditions.
\[ T = 25 + 273.15 = 298.15\ \text{K}, \quad P = 101.325\ \text{kPa} = 101{,}325\ \text{Pa}, \quad M = 0.02897\ \text{kg/mol} \]
\[ \rho = \frac{101{,}325 \times 0.02897}{8.314462618 \times 298.15} = \frac{2935.41}{2478.96} \approx 1.1840\ \text{kg/m}^3 \]
Result: \(\rho \approx 1.184\ \text{kg/m}^3\) (the same as 1.184 g/L). The molar volume is \(V_m = RT/P \approx 24.465\ \text{L/mol}\).
How to Use the Gas Density Calculator
- Enter the Pressure (P) and choose its unit (kPa, Pa, bar, atm, mmHg, or psi). Use absolute pressure, not gauge pressure.
- Enter the Temperature (T) and its scale (°C, K, or °F). The value is converted to Kelvin automatically.
- Enter the Molar Mass (M) in g/mol. Use 28.97 for air, or the value for a pure gas (O₂ = 32.00, CO₂ = 44.01, He = 4.00, CH₄ = 16.04, N₂ = 28.01).
- Read the Gas Density in kg/m³, the conversion table in other units, and the molar volume in L/mol.
- The Calculation Details section shows the full substitution so you can verify each step by hand.
What Is Gas Density and Why It Matters
Gas density is the mass per unit volume of a gas. Unlike liquids and solids, gases are strongly affected by pressure and temperature: compress a gas and its density rises; heat it at constant pressure and its density falls. At ambient conditions a gas typically weighs only about 1 kg per cubic metre — roughly a thousandth of the density of water — which is why small errors in conditions can shift the result noticeably.
The formula shows the two drivers clearly. Density is directly proportional to pressure (Boyle's law behaviour: halving the volume doubles the density) and inversely proportional to absolute temperature (Charles's law behaviour). It is also directly proportional to molar mass, which is why carbon dioxide (M = 44 g/mol) is about 1.5 times denser than air and helium (M = 4 g/mol) is about seven times lighter — the reason CO₂ pools on the floor while helium balloons rise.
Gas density is used constantly in engineering and science: sizing compressors and pipelines, converting between volumetric and mass flow rates, calibrating flow meters, predicting buoyancy and plume behaviour, and converting gas volumes in stoichiometry problems. For example, the ISA standard atmosphere value for air — 1.225 kg/m³ at 101.325 kPa and 15 °C — is the reference used in aircraft performance calculations.
Because moles of gas at the same \(P\) and \(T\) occupy equal volumes regardless of identity (Avogadro's principle), the molar volume is the same for every ideal gas at given conditions: 22.414 L/mol at 0 °C and 101.325 kPa, and about 24.465 L/mol at 25 °C. Our Avogadro's law calculator and the Gay-Lussac's law calculator explore these pressure–temperature–volume relationships in more detail.
Assumptions, Limitations and Practical Tips
- Ideal gas behaviour is assumed. The calculator sets the compressibility factor \(Z = 1\). This is accurate to within a fraction of a percent for common gases near ambient conditions, but at high pressures or low temperatures real gases deviate. For those cases, a real-gas correction \(\rho = PM/(ZRT)\) is needed — see our Van der Waals equation calculator for a more realistic model.
- Use absolute pressure and absolute temperature. Gauge pressure readings must have atmospheric pressure added (e.g. 2 bar gauge = 3 bar absolute ≈ 300 kPa), and Celsius or Fahrenheit values are converted to Kelvin internally.
- Watch for condensation. Near the dew point or critical point of a gas, part of the substance may be liquid and the ideal-gas density is no longer meaningful.
- Dry gas is assumed. Humid air is slightly less dense than dry air because water vapour (M = 18 g/mol) replaces heavier molecules; for precise work, use the mean molar mass of the actual mixture.
- Gas mixtures: use the mole-weighted average molar mass. For air, \(0.21 \times 32 + 0.78 \times 28 + \cdots \approx 28.97\ \text{g/mol}\). Our percent composition calculator can help find molar masses of compounds.
- Sanity check: at 101.325 kPa, every ideal gas has \(M/22.414\) g/L of density at 0 °C — air should give ≈ 1.293 g/L, methane ≈ 0.716 g/L. If your result is far from such benchmarks, check the units of the inputs.
Frequently Asked Questions
How do I calculate gas density by hand without a calculator?
Convert pressure to pascals, temperature to Kelvin, and molar mass to kg/mol, then divide pressure × molar mass by 8.314 × temperature. A shortcut at standard conditions: at 0 °C and 101.325 kPa, one mole occupies 22.414 L, so density in g/L is simply the molar mass divided by 22.414. Oxygen therefore has a density of 32 / 22.414 ≈ 1.43 g/L. At other temperatures, scale by 273.15/T; at other pressures, scale by P/101.325.
What is a normal gas density value?
Most gases near sea-level pressure and room temperature fall between 0.1 and 2 kg/m³. Air is about 1.18 kg/m³ at 25 °C and 1.29 kg/m³ at 0 °C. Light gases like hydrogen (0.08 kg/m³) and helium (0.16 kg/m³) sit well below this range, while heavy gases like carbon dioxide (1.8 kg/m³) and propane (1.8 kg/m³) sit above it. If your answer is thousands of kg/m³, you likely entered pressure in the wrong unit.
Why is gauge pressure wrong to use, and how do I convert it?
The ideal gas law requires absolute pressure — the total pressure of the gas, not the reading above atmospheric. Gauge readings must have ambient pressure added: a tyre at 32 psi gauge is about 32 + 14.7 = 46.7 psi absolute. Similarly, 0 bar gauge equals roughly 1 bar absolute. Using gauge pressure directly always underestimates the density, sometimes by half or more near ambient pressure.
How do I find the density of a gas mixture like natural gas or flue gas?
First find the average molar mass: multiply each component's molar mass by its mole fraction and sum the results. For example, a mix of 90% methane and 10% ethane has M = 0.9 × 16.04 + 0.1 × 30.07 = 17.44 g/mol. Volume fractions (which equal mole fractions for ideal gases) can be used directly from a gas analysis report. Then enter this average molar mass in the calculator.
How does humidity change the density of air?
Moist air is less dense than dry air, which surprises many people. Water vapour (M = 18 g/mol) displaces molecules of nitrogen (28) and oxygen (32), lowering the average molar mass. At 25 °C and 100% humidity, air is about 1% less dense than dry air. For everyday estimates this barely matters, but for precise flow measurement or buoyancy work use the mole-weighted molar mass including water vapour.
When does the ideal gas law give wrong results?
The ideal formula assumes a compressibility factor Z = 1, which holds within about 1% for most gases below roughly 10 bar and well above their boiling points. Deviations grow at high pressure, low temperature, or near condensation — CO₂ at 50 bar or methane at −100 °C need real-gas corrections where density equals P·M/(Z·R·T) with Z looked up from tables or an equation of state.
How do I convert gas density between kg/m³, g/L, and lb/ft³?
The conversions are simple: 1 kg/m³ equals 1 g/L, since both express grams per litre. To convert to imperial units, multiply kg/m³ by 0.06243 to get lb/ft³, so air at 1.2 kg/m³ is about 0.075 lb/ft³. Going the other way, multiply lb/ft³ by 16.018 to get kg/m³. Specific gravity of a gas — its density relative to air — is just the ratio of molar masses at the same conditions.