Gas Density Calculator Formula
Understand the math behind the gas density calculator. Each variable explained with a worked example.
Formulas Used
Gas Density
density = (pressure * molar_mass) / (0.08206 * temp)Variables
| Variable | Description | Default |
|---|---|---|
pressure | Pressure (P)(atm) | 1 |
molar_mass | Molar Mass (M)(g/mol) | 28.97 |
temp | Temperature (T)(K) | 273.15 |
How It Works
Gas Density from Ideal Gas Law
Formula
d = PM / (RT)
Where:
Derived from PV = nRT by substituting n = mass/M and d = mass/V.
Worked Example
Calculate the density of air (avg M = 28.97 g/mol) at 1 atm and 273.15 K.
pressure = 1molar_mass = 28.97temp = 273.15
- 01d = PM / (RT)
- 02d = (1)(28.97) / (0.08206 × 273.15)
- 03d = 28.97 / 22.414
- 04d = 1.292 g/L
Frequently Asked Questions
Why does gas density depend on pressure and temperature?
Unlike liquids, gases are compressible. Higher pressure packs more molecules into a given volume, increasing density. Higher temperature expands gas, decreasing density.
What is the density of air at STP?
Air has an average molar mass of about 28.97 g/mol. At STP (1 atm, 273.15 K), its density is approximately 1.29 g/L.
Can I use this for real gases?
At moderate conditions it works well. For very high pressures or low temperatures, use the van der Waals equation or compressibility factor corrections.
Ready to run the numbers?
Open Gas Density Calculator