THE CALCULATION DESK / INTERACTIVE TOOL

Ideal-Gas Density Calculator

Estimate gas mass density from absolute pressure, absolute temperature, and a supplied molar mass using the ideal-gas equation. Convert SI and engineering units, inspect normalized inputs, and follow the calculation steps.

THERMODYNAMICSAbsolute P and T · ideal model, Z = 1

01 Define the gas state

Enter absolute pressure. Convert gauge readings using their reference pressure first; no atmospheric offset is added.

Use a temperature reading, not a temperature difference. Converted absolute temperature must be greater than 0 K.

Supply the gas molar mass, or the matching mean molar mass for a gas mixture. No gas property is selected automatically.

This calculation assumes Z = 1. Gas phase and real-gas accuracy require a separate assessment. Read the model limits.

Changing units converts entered values, including temperature offsets.

Calculations run in your browser. Input values are not sent to the server.

02 Read the ideal density

Ideal-gas mass density · ρ

—kg/m³

Enter absolute pressure, temperature, and molar mass to begin.

Engine 1.0.0 · Constants 1.0.0Read the method, input basis, and sources below.

Formula and method

Combine PV = nRT with molar mass M = m/n and mass density ρ = m/V to obtain ρ = PM/(RT). Equivalently, molar density is n/V = P/(RT), and ρ = (n/V)M. The specific gas constant is Rspecific = R/M.

The engine uses absolute P in Pa, absolute T in K, M in kg/mol, and R = 8.31446261815324 J/(mol·K). The result is kg/m³ before output conversion. This SI value of R follows R = NAkB from the fixed Avogadro and Boltzmann constants; browser arithmetic uses double precision.

Density output choices are kg/m³, g/L, g/cm³, and lbm/ft³. In particular, 1 g/L = 1 kg/m³; changing between them preserves the numerical density value.

Absolute pressure, temperature, and molar mass

  • Pressure must be absolute and positive. A gauge reading must first be converted using Pabsolute = Pgauge + Preference in consistent units. No atmospheric offset is added automatically. The atm unit is 101325 Pa and does not set your local atmospheric pressure.
  • Temperature is a scale reading, not a difference. Celsius and Fahrenheit inputs are converted to kelvin with offsets: T(K) = T(°C) + 273.15 and T(K) = [T(°F) − 32] × 5/9 + 273.15. Rankine uses T(K) = T(°R) × 5/9. The resulting temperature must be greater than 0 K.
  • Molar mass must be positive and match the gas basis. Enter g/mol, kg/kmol, kg/mol, or lbm/lbmol. g/mol, kg/kmol, and lbm/lbmol share the same numerical value; kg/mol differs by a factor of 1000. For a gas mixture, use its mean molar mass on the same wet/dry and composition basis.
  • For mixture total mass density, use total absolute pressure with mixture mean molar mass. A component’s partial pressure with its own molar mass instead gives that component’s ideal partial mass density. The tool cannot infer which basis your input represents.

See the Mass–Molar Flow Converter for molar-mass units and component versus mixture basis. No compound, humidity, composition, or property lookup supplies your molar mass here.

Ideal-gas assumptions and limits

  • The model assumes Z = 1, negligible molecular volume and intermolecular interactions, and a homogeneous gas state. It supplies an ideal estimate, not a validated real-fluid density.
  • Real-gas deviations depend on substance, mixture, pressure, and temperature. High pressure, low temperature, proximity to condensation or a critical region, and strong interactions may require a suitable real-gas equation of state or validated property source. There is no universal pressure/temperature cutoff that establishes accuracy for every gas.
  • A real-gas calculation with known compressibility would use ρ = PM/(ZRT). This calculator fixes Z at 1; it does not estimate Z, phase equilibrium, saturation, dissociation, or composition changes.
  • P, T in kelvin, and M must be strictly positive. Normalized inputs, RT, molar density, mass density, specific gas constant, and output must be finite and representable. Nonzero underflow is rejected. Results display up to 8 significant digits, with steps up to 10; extra displayed digits do not establish model accuracy.

Worked example

Take an illustrative gas with supplied M = 28.97 g/mol at P = 101.325 kPa absolute and T = 25 °C. Normalize P = 101325 Pa, T = 298.15 K, and M = 0.02897 kg/mol.

ρ = 101325 × 0.02897 / (8.31446261815324 × 298.15) ≈ 1.184121070 kg/m³. The corresponding specific gas constant is approximately 287.0025067 J/(kg·K). The supplied molar mass is an example input, not an automatically selected gas property.

At the same T and M, doubling the absolute pressure doubles ideal density. At fixed P and M, doubling absolute temperature in kelvin halves it. Doubling a Celsius or Fahrenheit scale reading does not imply doubling absolute temperature.

Sources and calculation version

Changelog: engine 1.0.0 introduces ideal-gas mass density, explicit absolute P/T, supplied molar mass, SI normalization, specific gas constant, temperature-scale conversion, examples, and range checks. Unit factors, molar-mass definitions, and gas-constant data are version 1.0.0. No chemical-property or real-gas dataset is used. Engineering review status: independent review pending.