Skip to content
Other

Gas Density Calculator

Enter the pressure, temperature, and molar mass of any gas to instantly find its density using the ideal gas law. Choose a preset gas to fill in the molar mass automatically, pick your preferred pressure and density units, and flip to reverse-solve mode to find pressure, temperature, or molar mass from a known density. The show-your-work panel traces every step of the algebra.

Your details

Choose which quantity you want to find. All other fields become inputs.
Pick a common gas to pre-fill molar mass, or choose Custom to enter your own value.
Absolute pressure (not gauge). Standard atmosphere is 101325 Pa or 1 atm.
Gas temperature. Standard conditions are 25 C (298.15 K) or 20 C (293.15 K).
Molecular weight of the gas. Auto-filled when you pick a preset gas.
g/mol
Known density to use when solving for pressure, temperature, or molar mass.
Gas densityNear air density
1.1841

Mass per unit volume of the gas at the given conditions

Density unitkg/m³
Pressure101,325
Temperature25
Molar mass28.97
Specific volume0.8445
Pressure (kPa)101.325
Temperature (K)298.15
Molar volume24.4654
1.1841 kg/m³
Very light<0.5Lighter than air0.5-1Near air1-1.5Denser than air1.5-3Much denser3+
01.192.38-12575275
Temperature (C)
Density (kg/m³)
Temperature (C)Selected gasDry air (reference)
-1252.382.38
-1032.072.07
-811.831.83
-581.641.64
-361.491.49
-141.361.36
81.251.25
311.161.16
531.081.08
751.011.01
970.950.95
1190.90.9
1420.850.85
1640.810.81
1860.770.77
2080.730.73
2310.70.7
2530.670.67
2750.640.64
  • Selected gas
  • Dry air (reference)

Gas density is 1.1841 kg/m³ at these conditions.

  • This gas is 1.7% lighter than dry air at 20 C and 1 atm, so it will rise in open air.
  • Specific volume is 0.8445 m³/kg, meaning each kilogram of gas occupies about 844.51 litres.
  • One mole of the gas occupies 24.47 L at these conditions. Compare this to 22.41 L/mol at STP (0 C, 1 atm).

Next stepUse the density to compute buoyancy forces, pipe flow rates, or combustion stoichiometry. For high pressures (above ~10 bar), apply a real-gas compressibility correction (Z-factor).

Formula

ρ=PMRT,P=ρRTM,T=PMρR,M=ρRTP\rho = \dfrac{P M}{R T}, \quad P = \dfrac{\rho R T}{M}, \quad T = \dfrac{P M}{\rho R}, \quad M = \dfrac{\rho R T}{P}

Worked example

Dry air (M = 28.97 g/mol) at 25 C and 101325 Pa: rho = (101325 x 0.02897) / (8.314 x 298.15) = 2935.4 / 2478.8 = 1.1844 kg/m3. Specific volume = 1 / 1.1844 = 0.8443 m3/kg. Molar volume = (8.314 x 298.15) / 101325 = 0.02445 m3/mol = 24.45 L/mol.

What is gas density and why does it matter?

Gas density is the mass of a gas per unit volume, expressed in kilograms per cubic metre (kg/m3) or grams per litre (g/L). Unlike liquids and solids, gases are highly compressible, so their density changes significantly with pressure and temperature. This matters in many practical contexts: engineers designing HVAC ducts, gas pipelines, or combustion systems all need accurate density values to compute mass flow rates, pressure drops, and buoyancy effects. Safety assessments for fuel storage also depend on knowing whether a leaking gas will rise (lighter than air, such as hydrogen or methane) or pool at floor level (heavier than air, such as propane or CO2).

The ideal gas law and its limits

This calculator uses the ideal gas law in the form rho = PM/(RT), where P is absolute pressure in pascals, M is the molar mass in kg/mol, R is the universal gas constant (8.314 J/(mol K)), and T is the absolute temperature in Kelvin. The ideal gas law is accurate to within about 1% for most common gases at pressures below 10 bar and temperatures well above the boiling point. At higher pressures or near the liquefaction point, real-gas effects become important: the compressibility factor Z modifies the equation to rho = PM/(ZRT). For most atmospheric and low-pressure engineering work, Z equals 1 and the ideal gas law gives reliable results.

Reverse-solve: find pressure, temperature, or molar mass

Because the ideal gas law relates four quantities, you can solve for any one of them given the other three. Use the "Solve for" selector at the top: choose Pressure to find what pressure is needed to achieve a target density at a known temperature, choose Temperature to find how hot or cold a gas must be to reach a given density, or choose Molar mass to identify an unknown gas from a measured density, pressure, and temperature. The show-your-work panel beneath the result traces the algebra for whichever mode you select.

Unit conversions and how to use this calculator

Pressure can be entered in Pa, kPa, MPa, bar, atm, or psi. Temperature can be in Celsius, Kelvin, or Fahrenheit. Density can be displayed in kg/m3, g/L (numerically equal to kg/m3), or lb/ft3. Always use absolute pressure, not gauge pressure: add your local atmospheric pressure (roughly 101.325 kPa or 14.696 psi at sea level) to any gauge reading before entering it. The ten preset gases auto-fill the molar mass field, or choose Custom to enter your own value for any pure gas or gas mixture (calculate the mixture molar mass as the mole-fraction-weighted average of the component molar masses).

Molar mass and density of common gases at STP (0 C, 101.325 kPa)

GasFormulaMolar mass (g/mol)Density at STP (kg/m3)vs. dry air
HydrogenH22.0160.0899x0.07 - rises fast
HeliumHe4.0030.1785x0.15 - rises fast
MethaneCH416.040.7168x0.60 - rises
AmmoniaNH317.030.7710x0.64 - rises
Dry airmix28.971.2922x1.00 - reference
NitrogenN228.011.2506x0.97 - near air
OxygenO232.001.4290x1.11 - sinks
ArgonAr39.951.7839x1.38 - sinks
Carbon dioxideCO244.011.9768x1.53 - sinks
PropaneC3H844.101.9675x1.52 - sinks

Densities computed from the ideal gas law at standard temperature and pressure (0 C, 1 atm). Values match NIST data for ideal-gas behavior.

Frequently asked questions

What is the density of air at room temperature?

Dry air at 20 C (68 F) and standard atmospheric pressure (101.325 kPa) has a density of about 1.204 kg/m3. At 25 C the value drops to about 1.184 kg/m3. Humidity slightly reduces density because water vapour (M = 18 g/mol) is lighter than dry air (M = 28.97 g/mol).

Why must I use absolute pressure instead of gauge pressure?

The ideal gas law requires the total pressure acting on the gas, which includes the atmospheric contribution. Gauge pressure reads zero at atmospheric pressure, so if your gauge reads 2 bar, the absolute pressure is about 3.013 bar (2 + 1.013). Using gauge pressure directly will understate the density.

Does the formula work for gas mixtures?

Yes. Calculate the effective molar mass of the mixture as the weighted average: M_mix = sum(x_i x M_i) where x_i is the mole fraction of component i. For example, a mixture that is 80% N2 (28.01 g/mol) and 20% O2 (32.00 g/mol) has M_mix = 0.80 x 28.01 + 0.20 x 32.00 = 28.81 g/mol. Enter this value in the Custom molar mass field.

When is the ideal gas law not accurate enough?

The ideal gas law assumes no intermolecular forces and zero molecular volume. These assumptions break down at high pressures (above about 10 bar) or near the critical point or boiling point of the gas. In those cases, use the van der Waals equation or a full equation of state (Peng-Robinson, Soave-Redlich-Kwong) with a compressibility factor Z. For most atmospheric and low-pressure HVAC or ventilation work, the ideal gas law is accurate to better than 1%.

How do I find the density of a gas at standard conditions?

Standard conditions vary by convention. IUPAC standard (STP) uses 0 C and 100 kPa; the older NIST standard uses 0 C and 101.325 kPa; some engineering standards use 15 C and 101.325 kPa. Set the temperature and pressure to your chosen standard and the calculator gives the correct density. At IUPAC STP, one mole of any ideal gas occupies 22.71 L; at 0 C and 1 atm it occupies 22.41 L.

What gases are lighter than air, and which are heavier?

Gases with a molar mass below 28.97 g/mol (dry air) are lighter than air and will rise: hydrogen (2.02), helium (4.00), methane (16.04), and ammonia (17.03) are common examples. Gases heavier than air sink and can accumulate in low-lying areas: propane (44.10), carbon dioxide (44.01), argon (39.95), and oxygen (32.00) all fall into this category. The reference table on this page lists densities for ten common gases at STP.

Sources

Written by Grace Mbeki, MSc Data Scientist & Educator · Nairobi, Kenya

Turning everyday numbers into clear, actionable answers for the decisions that matter most.

Search 3,500+ calculators

Loading search…