Skip to content
FiftyCalc Free calculators for all 50 states

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

Sample figures

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.

Ideal Gas Density Calculator

Pressure, in kPa: enter 0 or more. Prefilled example: 101.325.

Temperature, in °C: enter -273.15 or more. Prefilled example: 20.

Molar mass of the gas, in g/mol: enter 0 or more. Prefilled example: 28.96.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Pressure, in kPa: enter 0 or more.
  2. Temperature, in °C: enter -273.15 or more.
  3. Molar mass of the gas, in g/mol: enter 0 or more.
  4. 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

  1. ρ=p×mm8.314462618×(t+273.15)
Symbols used in the formula
SymbolMeaningUnit
pPressurekPa
tTemperature°C
mmMolar mass of the gasg/mol
ρDensity (same as g/L)kg/m³

Worked example

Pressure101.325 kPa
Temperature20 °C
Molar mass of the gas28.96 g/mol
Density (lb/ft³)0.0752
  1. ρ=101.325×28.968.314462618×(20+273.15)=1.2039

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.

Related calculators