InfyCalculator
🧪

Gas Density at Conditions Calculator

Calculate the density of an ideal gas at any pressure and temperature from its molar mass using the ideal gas law rearranged for density.

Molar mass of gas
Pressure
Temperature
Loading calculator…

How it works

ρ = P · M / ( R · T ) with R = 0.082057 L·atm·mol⁻¹·K⁻¹ · (g/L numerically equals kg/m³)

Rearranging the ideal gas law PV = nRT in terms of mass gives a gas density that depends on its molar mass, the pressure and the temperature. Density rises with pressure and with heavier molecules, and falls as temperature increases and the gas expands. Because a mole in grams divided by a volume in litres has the same numerical value as kilograms per cubic metre, the g/L figure doubles as the SI density.

Worked example

Carbon dioxide (M = 44.01 g/mol) at 1 atm and 273.15 K: ρ = (1 × 44.01) / (0.082057 × 273.15) = 44.01 / 22.414 = 1.964 g/L — matching the known STP density of CO₂.

Sources: Ideal gas law — Wikipedia

Frequently asked questions

Why is gas density so much lower than liquids?

Gas molecules are far apart, so a litre holds only a couple of grams rather than the roughly 1,000 g of a typical liquid. That is why gas densities are quoted in grams per litre.

How does temperature change the density?

Heating a gas at constant pressure lets it expand, spreading the same mass over more volume, so density falls in inverse proportion to absolute temperature. Cooling does the reverse.

Does this work for real gases?

The ideal gas law is an excellent approximation at ordinary pressures and temperatures. Near condensation — high pressure or low temperature — real gases deviate and need a correction such as the van der Waals equation.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.