Ideal Gas Density Calculator
Test cases replayed : 2 of 2 match · Methodology · No outside source listed
Find how dense a gas is at a given pressure and temperature, from the ideal gas law rearranged for density.
Result
Density (kg/m³, same as g/L)
Density (lb/ft³)
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Pressure, in kPa: enter 0 or more.
- Temperature, in °C: enter -273.15 or more.
- Molar mass of the gas, in g/mol: enter 0 or more.
- Read the result: Density (kg/m³, same as g/L); the panel also shows Density (lb/ft³).
How this calculator works
From the ideal gas law PV = nRT and n = m ÷ M, the density is ρ = P × M ÷ (R × T), with P the absolute pressure, M the molar mass, T the absolute temperature (K = °C + 273.15) and R = 8.314462618 J/(mol·K), the molar gas constant (CODATA 2022 values from NIST (physics.nist.gov/cuu/Constants/Table/allascii.txt, read October 27, 2026)).
With P in kPa and M in g/mol the result comes out directly in kg/m³. The default molar mass of 28.96 g/mol is an example for dry air; enter the molar mass of your gas.
1 lb/ft³ = 16.018463 kg/m³ (0.45359237 kg ÷ 0.3048³ m³). Real gases depart from the ideal law at high pressure or near condensation.
The formula
| Symbol | Meaning | Unit |
|---|---|---|
| Pressure | kPa | |
| Temperature | °C | |
| Molar mass of the gas | g/mol | |
| Density (same as g/L) | kg/m³ |
Worked example
| Pressure | 101.325 kPa |
|---|---|
| Temperature | 20 °C |
| Molar mass of the gas | 28.96 g/mol |
| Density (lb/ft³) | 0.0752 |
|---|
Density (kg/m³, same as g/L) 1.2039
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
Why does a gas get less dense when it is heated?
At constant pressure the same mass takes up more volume as the temperature rises, since density is inversely proportional to the absolute temperature.
Should I use gauge or absolute pressure?
Absolute pressure. Add the atmospheric pressure to a gauge reading first.