This calculator estimates a gas’s density from its pressure, temperature, and molar mass using the ideal-gas law. Enter absolute pressure, temperature in °C, and molar mass; the result is density in kg/m³, with molar concentration as a supporting value.
Formula
For an ideal gas, density is pressure multiplied by molar mass, divided by the universal gas constant and absolute temperature:
ρ = PM / (RT)
- ρ is density in kg/m³.
- P is absolute pressure in pascals (Pa). This calculator accepts kPa and converts it using 1 kPa = 1000 Pa.
- M is molar mass in kg/mol. The input is in g/mol and is converted using 1000 g = 1 kg.
- R is the molar gas constant, 8.31446261815324 J/(mol·K).
- T is absolute temperature in kelvins (K), calculated as temperature in °C + 273.15.
The supporting molar concentration is c = P/(RT), in mol/m³. Multiplying that value by molar mass in kg/mol gives density in kg/m³. The formula assumes gas behavior is sufficiently close to ideal.
Worked Example
Using the calculator’s defaults—101.325 kPa, 25 °C, and 28.97 g/mol—first convert the inputs:
- Pressure: 101.325 kPa × 1000 = 101325 Pa.
- Temperature: 25 + 273.15 = 298.15 K.
- Molar mass: 28.97 g/mol ÷ 1000 = 0.02897 kg/mol.
Then calculate density:
ρ = (101325 × 0.02897) / (8.31446261815324 × 298.15) = 1.181 kg/m³.
The corresponding molar concentration is c = 101325 / (8.31446261815324 × 298.15) = 40.874 mol/m³. Multiplying 40.874 mol/m³ by 0.02897 kg/mol gives approximately 1.184 kg/m³; the slight difference from the displayed density can arise from rounding the intermediate concentration. Direct calculation gives the displayed density, 1.181 kg/m³.
Assumptions
- The gas follows the ideal-gas equation of state; interactions and molecular volume are treated as negligible.
- Pressure is absolute, not gauge pressure.
- Temperature is converted to kelvins, and molar mass is supplied in g/mol.
- The entered molar mass represents the gas composition being considered. For a mixture, use its mean molar mass.
When This Calculation Is Useful
Pressure and temperature determine how many moles of an ideal gas occupy a given volume. Molar mass converts that amount per volume into mass per volume, which is density. This makes the equation useful for checking approximate gas properties, comparing conditions, and relating a gas volume to its mass in general study or lab-planning arithmetic.
At fixed composition, density increases in proportion to absolute pressure and decreases as absolute temperature rises. For example, doubling absolute pressure at the same temperature doubles the ideal-gas density. Raising temperature while keeping pressure constant lowers density because the gas occupies more volume per mole at that pressure.
For a gas mixture, use the mixture’s average molar mass, calculated from the mole fractions of its components. If the composition is unknown or changes during the process, a single molar-mass input may not represent the sample accurately.
Pressure, Temperature, and Units
The pressure must be absolute: it is measured from a vacuum. Gauge pressure is measured relative to the surrounding atmosphere, so it must be converted before use. At ordinary atmospheric conditions, absolute pressure is approximately gauge pressure plus local atmospheric pressure. Do not enter a gauge reading as though it were absolute; doing so can produce a substantial error, especially at low pressures.
Temperature must be expressed on an absolute scale within the formula. Celsius values are converted by adding 273.15. Do not substitute a Celsius number directly for T: the gas law depends on kelvins, whose zero represents absolute zero. The input limit of −273.15 °C prevents a temperature below absolute zero, but values close to it are not ordinary gas conditions and may not be physically attainable for a real sample.
Keep units consistent. This calculator handles the conversions from kPa to Pa, g/mol to kg/mol, and °C to K in its expression. If calculating by hand with another unit system, convert every quantity and use the matching form of R; mixing, for example, pressure in pascals with a gas constant expressed in L·atm/(mol·K) gives an invalid result.
Ideal Gas Versus Real Gas
The ideal-gas model is an approximation. It often works well at relatively low pressure and temperatures well away from condensation, but accuracy can deteriorate at high pressure, low temperature, or near a phase change. Under those conditions, attractions and finite molecular size can affect the relationship between pressure, volume, and temperature.
A common correction uses the compressibility factor Z, defined through PV = ZnRT. The corresponding density is ρ = PM/(ZRT). An ideal gas has Z = 1; a real gas may have a value different from 1 that depends on the substance and conditions. This calculator does not estimate Z, so a real-gas calculation requires a suitable value or equation of state for the particular gas, pressure, and temperature.
Humidity and composition also matter. “Air” does not have one exact molar mass under every condition: water vapor changes the mixture’s average molar mass, and the proportions of gases can vary. The default 28.97 g/mol is a conventional approximate value for dry air, not a universal constant.
Common Errors and Interpreting the Result
- Using gauge pressure: convert it to absolute pressure first.
- Using Celsius in place of kelvins: add 273.15 before applying the equation.
- Using the wrong molar mass: distinguish the mass of one mole of the gas from its molecular mass in atomic mass units; their numerical values correspond, but the units are different.
- Ignoring mixture composition: use a representative mean molar mass for a mixture.
- Overinterpreting precision: the output’s decimal places do not make approximate inputs or the ideal-gas assumption exact.
The output is mass per volume. For reference, 1 kg/m³ equals 1 g/L, so a result of 1.181 kg/m³ is also 1.181 g/L. Density is not the same as molar concentration: molar concentration counts moles per volume, while density measures mass per volume.
Frequently Asked Questions
How do you calculate density from pressure and temperature?
For an ideal gas, use ρ = PM/(RT). Convert pressure to absolute units, temperature to kelvins, and molar mass to units consistent with R. The calculator performs those conversions for kPa, °C, and g/mol.
Can pressure and temperature alone determine gas density?
Not by themselves. You also need the gas’s molar mass, or enough composition information to determine the mixture’s average molar mass. Different gases at the same pressure and temperature generally have different densities.
Does the formula use gauge or absolute pressure?
It requires absolute pressure, measured relative to a vacuum. Gauge pressure must be adjusted by adding local atmospheric pressure before it is entered.
Why does gas density change when temperature changes?
At constant pressure and composition, increasing absolute temperature increases the volume occupied per mole, so mass per unit volume decreases. At constant volume instead, pressure and temperature change together, so the conditions must be specified.
Is this density exact for air?
No. It is an ideal-gas estimate based on the molar mass entered. Humidity, air composition, pressure, and non-ideal behavior can affect the actual value; use condition-specific data when greater accuracy is needed.
Related
Formula used
in p | Absolute pressure | kPa | 101.325 | 0 in t | Temperature | °C | 25 | -273.15 in mm | Molar mass | g/mol | 28.97 | 0.000001 out d | Gas density | kg/m³ | (p * 1000) * (mm / 1000) / (8.31446261815324 * (t + 273.15)) | 3 out c | Molar concentration | mol/m³ | (p * 1000) / (8.31446261815324 * (t + 273.15)) | 3
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.
More in this section
- Hydrostatic Pressure and Density Calculator98,066 Pa
- Density in g/L: Meaning, Formula, and Conversions1,000.000 g/L
- Pressure From Density: Formula and Calculator19,613.30 Pa
- Hydrogen Density vs Pressure: Calculate Gas Density0.0838 kg/m³
- Air Density and Pressure: How They Are Related1.204 kg/m³
- Air Density from Pressure: Formula and Calculator1.199 kg/m³