Gas Density Calculator

Calculate gas density at any temperature and pressure.
Enter the molar mass, pressure, and temperature to find density in g/L using the ideal gas law.

Gas Density

The density of an ideal gas at any temperature and pressure follows directly from the ideal gas law (PV = nRT).

Since density = mass/volume and molar mass M = mass/moles:

d = PM / RT

Where P is pressure in atmospheres, M is molar mass in g/mol, R is the ideal gas constant (0.08206 L·atm/mol·K), and T is temperature in Kelvin.

To convert Celsius to Kelvin: T(K) = T(°C) + 273.15

For example, nitrogen gas (M = 28.02 g/mol) at STP (1 atm, 0°C = 273.15 K): d = (1 × 28.02) / (0.08206 × 273.15) = 1.250 g/L

At SATP (1 atm, 25°C = 298.15 K): d = (1 × 28.02) / (0.08206 × 298.15) = 1.145 g/L

The formula reveals why hot air rises (lower density) and why dense gases like sulfur hexafluoride (SF₆, M = 146 g/mol) sink to the floor and create the famous “floating boat” demonstrations in chemistry classrooms.

At very high pressures or low temperatures, real gases deviate from ideal behavior. Intermolecular attractions and molecular volume become significant. The van der Waals equation handles these corrections, but for most laboratory and engineering conditions below 10 atm, the ideal gas equation gives results within a few percent.

To find molar mass from measured density, rearrange to M = dRT/P. That is how early chemists determined molecular weights long before mass spectrometry existed: weigh a known volume of gas, note the temperature and pressure, and the molar mass falls out.

Dry air behaves like a gas of molar mass 28.96 g/mol, which puts it at 1.184 g/L at 25 °C and 1 atm. That single number is the one worth memorising, because it tells you at a glance whether a gas will pool on the floor or drift to the ceiling. Anything heavier than about 29 g/mol sinks. Propane at 44 g/mol collects in a boat bilge or a basement and is a genuine explosion risk, which is why propane detectors go near the floor while natural gas detectors (methane, 16 g/mol) go near the ceiling.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.