Ideal Gas Density Calculator

Calculate gas density from absolute pressure, temperature, and molar mass with the ideal gas law.

Calculate ideal gas density
Enter SI values to evaluate density = pressure × molar mass ÷ gas constant ÷ temperature.

About ideal gas density

Gas density describes the mass contained in a unit volume. For an ideal gas, density follows directly from the ideal gas law. Starting with pressure × volume = amount × gas constant × temperature and replacing amount with mass divided by molar mass gives density = pressure × molar mass ÷ gas constant ÷ temperature. This calculator applies that rearrangement using the universal gas constant 8.314462618 joules per mole kelvin. The units must be consistent. Enter absolute pressure in pascals, absolute temperature in kelvin, and molar mass in grams per mole. The calculator converts molar mass to kilograms per mole before evaluating the equation, so the displayed density is kilograms per cubic metre. Gauge pressure is not suitable unless it is first converted to absolute pressure. For example, a gauge reading of zero in an open room still corresponds to roughly one atmosphere of absolute pressure. Temperature must also use an absolute scale. Convert degrees Celsius to kelvin by adding 273.15. A temperature of 20 degrees Celsius is therefore 293.15 kelvin. The inverse temperature relationship explains why a gas becomes less dense when heated at constant pressure. The direct pressure relationship explains why compression increases density when temperature and composition remain unchanged. Molar mass controls how much each mole weighs, so heavier gases are denser than lighter gases under identical conditions. Air is a mixture rather than a pure gas, but dry air can often be represented with an average molar mass near 28.97 g/mol. Nitrogen is about 28.01 g/mol, oxygen about 32.00 g/mol, carbon dioxide about 44.01 g/mol, helium about 4.00 g/mol, and hydrogen about 2.016 g/mol. Humidity changes the effective molar mass of air because water vapor is lighter than the primary components of dry air. The ideal gas model is most reliable at moderate pressures and temperatures far from condensation. Real molecules occupy space and attract one another, so gases can depart from ideal behavior at high pressure or near a phase boundary. For engineering work in those regions, use a compressibility factor or a real-gas equation of state. For classroom problems, ventilation estimates, low-pressure process calculations, and broad comparisons, the ideal gas density formula is transparent and usually sufficiently accurate. Always match the pressure, temperature, and composition to the same physical state before interpreting the result.

Ideal gas density examples

These examples show how pressure, temperature, and molecular weight affect density.

InputsDensityInterpretation
Air: 101325 Pa, 288.15 K, 28.97 g/molAbout 1.225 kg/m³A familiar standard-atmosphere reference near sea level.
Helium: 101325 Pa, 293.15 K, 4.0026 g/molAbout 0.166 kg/m³Low molar mass makes helium much less dense than air.
Carbon dioxide: 101325 Pa, 293.15 K, 44.01 g/molAbout 1.829 kg/m³Carbon dioxide is denser because its molar mass is larger.

How to calculate ideal gas density

  1. Enter the gas absolute pressure in pascals.
  2. Enter the absolute temperature in kelvin.
  3. Enter the gas or mixture molar mass in grams per mole.
  4. Select Calculate Gas Density to obtain kilograms per cubic metre.

Ideal gas density FAQ

Which gas constant does the calculator use?

It uses the universal gas constant 8.314462618 J/(mol·K). The input conversions are arranged so density is returned in kg/m³.

Should pressure be gauge or absolute?

Use absolute pressure in the ideal gas equation. Add local atmospheric pressure to a gauge reading before entering it.

Can I enter Celsius temperature?

No, the formula requires an absolute temperature in kelvin. Add 273.15 to a Celsius value before using the calculator.

Why does density decrease as temperature rises?

At constant pressure, hotter gas expands and the same mass occupies more volume. The ideal gas formula therefore makes density inversely proportional to absolute temperature.

When is the ideal gas estimate inaccurate?

Deviation grows at high pressures and near condensation or critical conditions. A real-gas model with compressibility data is preferable in those regions.