Gas Density Calculator

Find the density of an ideal gas from pressure, molar mass and temperature.

Chemistry and LabUpdated 2026-11-172 min read
Gas Density Calculator
Air is about 28.97 g/mol.
Gas density
...
Temperature in kelvin...

What it does

The density of a gas tells you how much mass occupies a given volume. Unlike a solid or liquid, a gas changes density strongly with pressure and temperature, and the ideal gas law gives a simple way to calculate it.

This calculator evaluates pressure times molar mass divided by the gas constant times absolute temperature. It accepts pressure in kilopascals or pounds per square inch and temperature in Celsius or Fahrenheit, then returns density in kilograms per cubic metre.

The defaults describe dry air at 0 °C and standard atmospheric pressure. With a molar mass of 28.97 grams per mole, the density comes out near 1.2925 kilograms per cubic metre.

The ideal gas law is an approximation that works well at low and moderate pressures. Near condensation or at very high pressure, real gases depart from the simple relationship and a more detailed equation is needed.

Pressure must be absolute, not gauge. If you have a gauge reading, add atmospheric pressure before entering it.

How to use

  1. Choose metric for kPa and Celsius or imperial for psi and Fahrenheit.
  2. Enter the absolute pressure of the gas.
  3. Enter the molar mass in grams per mole.
  4. Enter the temperature in the chosen scale.
  5. Press calculate and read the density in kilograms per cubic metre.
  6. Check the kelvin temperature shown beside the result.

Formula

ρ = P × M / (R × T), with R = 8.314462618 J per mole per kelvin.
P
Absolute pressure in pascals after conversion.
M
Molar mass in kilograms per mole after conversion.
T
Absolute temperature in kelvin.
ρ
Density in kilograms per cubic metre.

One kilopascal is one thousand pascals and one psi is 6,894.757293 pascals. Fahrenheit is converted with (F minus 32) times five ninths, then 273.15 is added. Temperature must end above absolute zero.

Worked example

Example: air at 0 °C and 101.325 kPa

Metric defaults at standard atmospheric pressure.

  1. Convert pressure: 101.325 kPa is 101,325 Pa.
  2. Convert molar mass: 28.97 g/mol is 0.02897 kg/mol.
  3. Convert temperature: 0 °C is 273.15 K.
  4. Compute 101,325 times 0.02897 divided by 8.314462618 times 273.15.
  5. The tool shows 1.2925 kg/m³ and 273.15 K.

Reference table

Density of dry air at standard pressure and several temperatures
TemperatureDensity (kg/m³)
-20 °C1.3943
0 °C1.2925
20 °C1.2041
40 °C1.1273

Limits

  • Assumes ideal gas behaviour.
  • Uses absolute pressure, not gauge pressure.
  • Molar mass must correspond to the gas in question.
  • Near condensation the result becomes unreliable.

Common mistakes

  • Using gauge pressure instead of absolute pressure.
  • Entering Celsius directly without converting to kelvin.
  • Using molar mass in kilograms per mole.
  • Mixing psi with Celsius in the same calculation.
  • Forgetting that density changes with altitude.

Try it yourself

Quick checks. Answers sit tucked under each question.

Imperial: 14.696 psi, 28.97 g/mol, 32 °F?

1.2925 kg/m³ at 273.15 K.

101.325 kPa, 18.015 g/mol, 25 °C?

0.7363 kg/m³ at 298.15 K.

Questions

What is gas density?

The mass of gas per unit volume, which depends on pressure, temperature and molar mass.

What formula is used?

Pressure times molar mass divided by the gas constant times absolute temperature.

Do I need absolute pressure?

Yes. Add atmospheric pressure to any gauge reading first.

Why convert to kelvin?

The ideal gas law uses absolute temperature measured from zero.

Can I use psi and Fahrenheit?

Yes. Choose imperial and the tool converts both to SI units.

When does the ideal gas law fail?

Near condensation or at high pressure where molecular interactions matter.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.