Skip to content

Gas Density Calculator

Calculate the density of a gas from its pressure, molar mass, and temperature.

Molar mass: 28.97 g/mol

Use absolute pressure, not gauge pressure.

1 kg/m³ = 1 g/L

Gas density

1.184 kg/m³

1.184 g/L

Molar mass
28.97 g/mol
Pressure
101.325 kPa
Temperature
25 °C

Try an example:

How it was calculated

T = 25 + 273.15 = 298.15 K

M = 28.97 g/mol = 0.02897 kg/mol

ρ = (101,325 × 0.02897) / (8.314462618 × 298.15)

ρ = 1.184 kg/m³

What is gas density?

Gas density is the mass of gas in a given volume. Unlike liquids and solids, a gas's density changes noticeably with pressure and temperature.

For an ideal gas, density increases when pressure increases and decreases when temperature increases.

The formula

ρ = P × M / (R × T)

R = 8.314462618 J/(mol·K)

ρ —
gas density
P —
absolute pressure
M —
molar mass
R —
gas constant
T —
absolute temperature

Important note

This calculator assumes the gas behaves ideally. The result is a good approximation under ordinary conditions, but real gases can deviate at high pressures or near condensation.

Why absolute pressure?

The ideal-gas density formula requires absolute pressure. If you have a gauge-pressure reading, convert it to absolute pressure before calculating.

Common mistakes

Using gauge pressure instead of absolute pressure
Entering °C directly into the formula instead of converting to Kelvin
Entering the molar mass in the wrong unit
Using mass fraction instead of molar mass
Treating gas density as constant when pressure or temperature changes

Related tools

Need the full gas-law calculation?

Need molar mass?

Need to calculate moles?

FAQ

Frequently asked questions

How is gas density calculated?

For an ideal gas, use ρ = PM / RT, where pressure is absolute and temperature is in Kelvin.

What units are used for gas density?

Common units include kg/m³ and g/L. These two units have the same numerical value.

Does gas density change with temperature?

Yes. At constant pressure, gas density decreases as temperature increases.

Does gas density change with pressure?

Yes. For an ideal gas at constant temperature, density increases as absolute pressure increases.

Can I calculate the density of any gas?

Yes, if you know its molar mass, pressure, and temperature. The calculation assumes ideal-gas behavior.

Should I use gauge or absolute pressure?

Use absolute pressure. Gauge pressure must be converted to absolute pressure first.