Works on this device
Gas Density Calculator
The density of a gas depends on its pressure, its temperature and the mass of its molecules. Name a gas or type its molar mass, or build a mixture from its analysis, and see the density with the working.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to use this calculator
- Choose a task: one gas, a mixture of gases, a gas at a standard condition (STP and others), or the pressure or temperature for a density you know.
- Name the gas by its formula (CO2, CH4, H2) or type its molar mass in g/mol. The menu above the fields fills common gases.
- Enter the absolute pressure and the temperature in the units you have.
- For a mixture, add a row for each gas with its share in percent, and say whether the shares are mole (volume) or mass fractions.
- Choose Calculate. How it was worked out shows the formula with your numbers.
The formula
ρ = P × M ÷ (Z × R × T). ρ is the density in kg/m³, P the absolute pressure in pascals, M the molar mass in kg/mol, T the temperature in kelvin and R = 8.31446261815324 J/(mol·K) the molar gas constant.
Z is the compressibility factor. For an ideal gas Z = 1, and the formula is the ideal gas law P V = n R T with n = m ÷ M. For a real gas at high pressure, look up Z for your gas, pressure and temperature and type it under More options.
- Mixture by mole (volume) fractions: M_mix = Σ x_i × M_i.
- Mixture by mass fractions: 1 ÷ M_mix = Σ w_i ÷ M_i.
- Partial pressure of each gas: p_i = x_i × P (Dalton's law).
- Relative density to air (the specific gravity of a gas): M ÷ M_air, with M_air = 28.9644 g/mol for dry air. Vapour density relative to hydrogen: M ÷ 2.016, often rounded to M ÷ 2 in school books.
- Turned round: P = ρ × Z × R × T ÷ M and T = P × M ÷ (ρ × Z × R).
Worked examples
Carbon dioxide (CO2, M = 44.009 g/mol) at 20 °C (293.15 K) and 101.325 kPa: ρ = 101,325 × 0.044009 ÷ (8.31446 × 293.15) = 1.8295 kg/m³. Its relative density to air is 44.009 ÷ 28.9644 = 1.519, so it is about one and a half times as heavy as air.
Biogas with 60% methane (16.043 g/mol) and 40% carbon dioxide by volume: M_mix = 0.6 × 16.043 + 0.4 × 44.009 = 27.229 g/mol. At 20 °C and 101.325 kPa, ρ = 1.1320 kg/m³.
Methane at the standard condition of 15 °C and 101.325 kPa: ρ = 101,325 × 0.016043 ÷ (8.31446 × 288.15) = 0.6785 kg/m³. At the IUPAC STP (0 °C and 100 kPa) it is 0.7064 kg/m³.
Which calculator does which job
- This page: the density of a gas in depth, for one gas or a mixture, with a Z factor and at named standard conditions.
- Ideal Gas Law Calculator: P V = n R T for pressure, volume, moles or temperature, and the molar mass from a measured density. For an ideal gas it gives the same density as this page.
- Gas Volume Calculator: the volume of a gas at STP and other conditions.
- Psychrometric Calculator: the density of moist air from temperature and humidity.
Limits you should know
- Without a Z factor the gas is ideal. That is close for most gases near room temperature and normal pressure. At high pressure, at low temperature or near the point where the gas turns to liquid, the error grows: type Z from a table or chart.
- This page does not hold real-gas data. It cannot give the density of refrigerants such as R-134a or R-410A, of supercritical CO2, or of any liquid (liquid CO2, liquid ammonia, LPG in a tank). Those need property tables of the fluid.
- The example mixtures in the menu are only examples. Natural gas, biogas, LPG and flue gas differ from place to place; type the analysis of your own gas.
- Molar masses from a formula use the IUPAC abridged standard atomic weights (2021). Results are for study and planning, not a check of gas metering or a safety system.