How this instrument works
A gas has no fixed density: squeeze it and each litre gets heavier, warm it and it thins. The ideal gas law pins that behaviour down. Start from PV = nRT, replace mole count n with mass over molar mass (m ⁄ M), then rearrange for m ⁄ V, and out falls ρ = P·M ⁄ (R·T). Density climbs in direct proportion to absolute pressure, drops in inverse proportion to absolute temperature, and scales with how heavy the molecules themselves are. At sea level and 15 °C air arrives at 1.225 kg/m³, helium at 0.169, and sulfur hexafluoride — the gas that drops a voice comically low — at roughly 6.2.
Three centuries of laboratory work sit behind that single line. Robert Boyle established the pressure–volume trade in 1662; Jacques Charles and Joseph Gay-Lussac added temperature dependence around 1787 and 1802; Amedeo Avogadro's 1811 hypothesis, that equal volumes of any gas hold equal numbers of molecules, is what lets one constant R serve every gas instead of a separate constant per substance. Émile Clapeyron folded all of it into a single equation of state in 1834. R itself stopped being a measured quantity on 20 May 2019: with Boltzmann's constant fixed at exactly 1.380649 × 10⁻²³ J/K and Avogadro's number at 6.02214076 × 10²³ per mole, their product 8.314462618… J/(mol·K) became exact by definition.
Ideality assumes molecules of zero volume that ignore one another entirely — true enough at ordinary pressures, false near a condensation line. Real gases carry a compressibility factor Z, giving ρ = P·M ⁄ (Z·R·T). For air around ambient conditions Z sits within a fraction of a percent of 1, so this sheet is honest to better than half a percent. Push toward 100 bar, or cool a vapour toward where it would rather be liquid, and mutual attraction packs molecules closer than ideality predicts: carbon dioxide near its critical point at 73.8 bar and 31 °C runs dramatically heavier than this formula claims. Johannes van der Waals wrote the first correction in 1873 and collected a Nobel Prize for it in 1910.
- Enter Absolute pressure — true pressure, so add atmospheric to any gauge reading. Pascals by default, with kPa, bar, atm and psi on its unit menu.
- Enter Molar mass (kg/mol). This field wants kilograms per mole, so divide the g/mol figure off a periodic table by 1000: dry air's 28.9647 becomes 0.0289647.
- Enter Absolute temperature (K). Add 273.15 to a Celsius reading — 20 °C is 293.15 K. Values at or below zero are rejected, since the scale must start at absolute zero.
- Read Gas density in kg/m³, or switch that field to g/cm³ or lb/ft³. Compare against air's 1.225 kg/m³ to see whether your gas rises or pools in a room.
Worked example — aviation's 1.225 kg/m³
The International Standard Atmosphere fixes mean sea level at 101325 Pa and 288.15 K — 15 °C — with dry air taken as 0.0289647 kg/mol. Enter those three and the arithmetic runs plainly: P·M = 101325 × 0.0289647 = 2934.848, R·T = 8.314462618 × 288.15 = 2395.812, and Gas density returns 1.224991 kg/m³.
Round that to 1.225 and you have a number stamped right through aviation. Lift and drag coefficients, published rates of climb, engine thrust ratings — all quoted against it. Pilots meet the formula bodily on a hot afternoon at a high-altitude strip: lower P and higher T each thin the air, a wing makes less lift per knot, and the takeoff roll stretches. That is all a density altitude chart is quietly computing.
Divers run the same arithmetic downward. At 40 metres of seawater absolute pressure reaches about five atmospheres, so breathing air thickens to roughly 6.1 kg/m³ — five times as much mass to haul through an airway on every breath. Technical diving guidance caps breathing gas near 6.2 kg/m³ for precisely that reason, which is why helium mixes take over below such depths.
Questions
Why must I use absolute pressure rather than gauge pressure?
Because this law counts molecules, and a gauge hides an entire atmosphere of them. Gauges read zero when a vessel holds ordinary air, not vacuum, so absolute pressure is gauge plus roughly 101325 Pa. A tyre showing 220 kPa on the forecourt actually sits at 321325 Pa; feed in the gauge figure and Gas density comes back about a third too low. Vacuum work is the same trap reversed — enter what remains, not what was pumped away.
Does temperature really have to be in kelvin?
Yes, and this is the mistake that bites hardest. Density varies inversely with absolute temperature, so the scale has to start at absolute zero. Typing 15 where 288.15 K belongs inflates your answer more than nineteenfold. Add 273.15 to any Celsius value before it enters the Absolute temperature (K) field; from Fahrenheit, convert to Celsius first. Sub-zero Celsius readings are perfectly legal once converted — minus 40 °C is 233.15 K.
Why is dry air's molar mass 0.0289647 kg/mol?
It is a weighted average of what air actually contains. Roughly 78% nitrogen at 28.013 g/mol, 21% oxygen at 31.999, 0.93% argon at 39.948 and a trace of carbon dioxide average out to 28.9647 g/mol — the value the 1976 US Standard Atmosphere adopted and aviation has used since. Air behaves as one gas here because that mixture stays remarkably uniform up to about 80 km. Divide by 1000 to reach kg/mol, which is what this field expects.
Is humid air denser than dry air?
No — moist air is lighter, which surprises almost everybody. Water vapour has a molar mass of 18.015 g/mol, well under air's 28.965, so every water molecule joining the mix displaces a heavier nitrogen or oxygen one at fixed pressure and temperature. Saturated air at 30 °C runs about 1% below dry air at identical conditions. Baseballs carry marginally farther on a muggy afternoon, and aircraft performance charts include a humidity correction for exactly this reason.
When does ρ = P·M ⁄ (R·T) stop being accurate?
Near condensation, and at high pressure. Ideality assumes molecules occupy no volume and exert no force on each other; both assumptions weaken as you crowd them together. For air, nitrogen, oxygen or helium at everyday pressures the result holds to well under 1%. Approach a critical point — 73.8 bar and 31 °C for carbon dioxide, 220 bar and 374 °C for steam — and true density runs well above the ideal figure. Serious work there divides by a compressibility factor Z, read off a chart or a fuller equation of state.
How does this differ from just dividing mass by volume?
Only in what you must measure. Density is always mass over volume, but weighing a gas and gauging its volume is fiddly, whereas pressure and temperature fall out of a gauge and a thermometer in seconds. This sheet uses the equation of state to turn two easy readings into the awkward one. Weigh a sealed flask, evacuate it, weigh again, and the direct route gives the same answer — the ideal gas law simply spares you the vacuum pump.