Gas density:
why warm air is lighter and CO₂ sinks
Take the ideal gas law, swap moles for mass over molar mass, and density falls out. A worked comparison of air and carbon dioxide shows why it matters.
Calcylator Editorial Team
Updated · 4 min read
From PV = nRT to a density
Solids and liquids have densities you look up in a table. Gases do not, because the same gas can be thin or dense depending on how much it is compressed and how hot it is. The ideal gas law lets you calculate the value for exactly the conditions you have.
Start with PV = nRT. The amount of gas n equals its mass m divided by its molar mass M. Replace n, then move volume to the other side and you have m/V on one side, which is just density. The derivation is two lines, and it explains every behaviour of the final formula.
- p:
- absolute pressure in Pa
- M:
- molar mass in kg/mol
- R:
- 8.314 J/(mol·K)
- T:
- temperature in K
What each term does to the answer
- Higher pressure packs more molecules into the same space, so density grows in direct proportion.
- Higher molar mass means each molecule weighs more, so a heavier gas is denser at identical conditions.
- Higher temperature spreads molecules out, so density drops. Because T is in kelvin, going from 300 K to 330 K lowers density by about 9%, not by the ratio of Celsius figures.
Molar mass in this equation must be in kilograms per mole. Air has a molar mass of about 28.97 g/mol, which is 0.02897 kg/mol. The slip of leaving it in grams gives a result 1,000 times too large, and it is easy to catch because the answer then reads over a thousand kg/m³, denser than water.
Worked example: air at one atmosphere and 300 K
Pressure
101,325 Pa
Molar mass of air
0.02897 kg/mol
R
8.314 J/(mol·K)
Temperature
300 K
Density of air
≈ 1.177 kg/m³
101,325 × 0.02897 ÷ (8.314 × 300) = 2,935.4 ÷ 2,494.2 = 1.177.
That is close to the figure often quoted for room-temperature air, about 1.2 kg/m³. At 273.15 K the same formula gives about 1.29 kg/m³ and at 350 K about 1.01 kg/m³, so a hot day makes the air in a room measurably lighter.
A cubic metre of air at 300 K therefore weighs a little over a kilogram. A 4 m × 5 m × 3 m room holds 60 m³, which is roughly 70 kg of air, a figure that surprises many people the first time they work it out.
Comparing carbon dioxide with air
Carbon dioxide has a molar mass of about 44.01 g/mol, or 0.04401 kg/mol, roughly 1.52 times that of air. Under the same pressure and temperature the density scales by the same ratio.
| Gas | Molar mass (kg/mol) | Density at 101,325 Pa and 300 K |
|---|---|---|
| Air | 0.02897 | ≈ 1.177 kg/m³ |
| Carbon dioxide | 0.04401 | ≈ 1.788 kg/m³ |
| Helium | 0.004003 | ≈ 0.163 kg/m³ |
This is why carbon dioxide released from dry ice or a fermenting vat pools in low spots and why a helium balloon rises. The same reasoning matters in cellars, wells and silos, where heavy gas can displace the air a person needs to breathe. Safety rules for confined spaces exist for exactly that reason.
Running the formula backwards to find a molar mass
Because density depends on molar mass, a measured density can identify an unknown gas. Rearrange to M = ρ × R × T ÷ p. Suppose a gas measures 1.96 kg/m³ at 273.15 K and 101,325 Pa.
Density
1.96 kg/m³
R
8.314 J/(mol·K)
Temperature
273.15 K
Pressure
101,325 Pa
Molar mass
≈ 0.0439 kg/mol = 43.9 g/mol
1.96 × 8.314 × 273.15 ÷ 101,325 = 0.04393.
A value near 44 g/mol points to carbon dioxide, nitrous oxide or propane, which share that molar mass, so a density measurement alone cannot settle the identity; a second property such as a chemical test is needed. Still, ruling out gases that are far from 44 g/mol is a quick and useful first step in the lab.
Density difference and lift
Anything lighter than the air around it floats, and the available lift per cubic metre is simply the density of air minus the density of the gas inside. Helium at 300 K gives 1.177 − 0.163 = about 1.01 kg of lift per cubic metre, which is why a party balloon with a few litres of helium can lift only a few grams.
Hot-air balloons use the same idea with temperature rather than a lighter gas. Heating the air inside from 300 K to 350 K cuts its density to roughly 1.01 kg/m³, leaving about 0.17 kg of lift for every cubic metre of envelope. That is why a balloon envelope has a volume of thousands of cubic metres.
Density of a mixture such as air
A mixture behaves as one gas with an average molar mass, found by weighting each component's molar mass by its mole fraction. For dry air, 0.78 × 28.01 + 0.21 × 32.00 + 0.0093 × 39.95 comes to about 28.9 g/mol, in line with the 28.97 g/mol used above once the trace gases are included.
This is the quickest way to estimate the density of any gas blend: compute its average molar mass first, then apply the single-gas formula. The mole fractions come from composition data reported by volume, because for ideal gases volume percent and mole percent are the same.
When to trust this and when to measure
The formula works well for gases that are far from condensing. For steam close to saturation, for refrigerants and for gases above roughly 10 atmospheres, real-gas behaviour adds a correction known as the compressibility factor Z, and density becomes pM ÷ (Z × R × T). Engineering tables or software supply Z for the gas in question.
Altitude and weather also move the inputs. Atmospheric pressure drops with height and temperature changes through the day, so the density of the air at a hill station is noticeably lower than at the coast. If a result will drive a safety-critical or purchase decision, such as sizing a vent or buying bottled gas, verify it against supplier data.
A general chemistry calculator can be handy to keep the surrounding quantities, such as moles or masses, in order as you work, but substitute the pressure, molar mass and temperature carefully, because the unit conversions are where mistakes enter.
Common questions
How do you calculate the density of a gas?
Multiply pressure by molar mass and divide by gas constant times absolute temperature, ρ = pM ÷ (RT). With p in pascals, M in kg/mol, R = 8.314 J/(mol·K) and T in kelvin, the result is in kg/m³. For air at 300 K and 101,325 Pa it is about 1.177.
Why does warm air have lower density?
Heating at constant pressure makes the gas expand, so the same mass occupies more volume. In the formula, temperature sits in the denominator. Raising air from 300 K to 330 K cuts its density by about 9%, which is what makes warm air rise.
Is carbon dioxide denser than air?
Yes. Carbon dioxide has a molar mass of about 44 g/mol against roughly 29 g/mol for air, so at the same conditions it is about 1.5 times as dense. At 300 K and 1 atm that is roughly 1.79 kg/m³ against 1.18 kg/m³.
What units must molar mass be in?
Use kilograms per mole when pressure is in pascals and R is 8.314 J/(mol·K). Air is 0.02897 kg/mol, not 28.97. Using grams per mole makes the answer 1,000 times too large, so it is expressed in g/m³ rather than kg/m³.
Does the formula work for humid air?
Only approximately if you use the molar mass of dry air. Water vapour is lighter than nitrogen and oxygen, so humid air is slightly less dense. For precise work, use the mixture's average molar mass or a psychrometric table.
Was this guide helpful?
Continue reading
View all blogsMole Fraction Explained With a Water–Ethanol Mix
Mole fraction is one component's moles divided by all moles present. See it worked on 36 g of water and 46 g of ethanol, giving 0.667 and 0.333.
4 min read
Ideal Gas Pressure: Using P = nRT/V Correctly
Gas pressure follows P = nRT/V. Half a mole of gas in 10 L at 298 K presses at about 124 kPa, and the guide shows which units make that come out right.
4 min read
Percent Excess Reactant: Formula, Steps and a Worked Case
Percent excess = (fed − required) ÷ required × 100. Feeding 6 mol of N₂ where 5 mol is needed means a 20% excess; the steps tell you which species to use.
4 min read




