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.
02 Read the ideal density
Ideal-gas mass density · ρ
kg/m³
Enter absolute pressure, temperature, and molar mass to begin.
Ideal estimate · Z = 1 assumed
- Absolute pressure · P
- Absolute temperature · T
- Molar mass · M
- Specific gas constant · R/M
Positive inputs and successful unit conversion do not establish that the gas behaves ideally.
03 Trace the gas-state calculation
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
- OpenStax, Chemistry 2e, section 9.3 — gas density from the ideal-gas law and molar mass.
- OpenStax, Chemistry 2e, section 9.6 — non-ideal behavior and compressibility.
- NIST: CODATA fundamental constants listing and NIST: Definitions of SI Base Units — R and the fixed SI constants used to derive it.
- NIST SP 811, Appendix B.9 — pressure, absolute temperature, and density units. Molar-mass conversions use the same local definitions as the Mass–Molar Flow Converter.
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.