molecalculator

Moles & Molar Mass

Pressure, Density, and Temperature: How They Relate

Calculator No. 01-2085 · Updated · Formula and assumptions shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

For study and lab planning. The result follows from the numbers you enter and the formula shown. Check it against your method before you weigh, mix or dilute anything, follow the safety data sheet and your supervisor, and do not use it for clinical, dosing or medication work.

Pressure, density, and temperature are linked because they describe how matter behaves at the particle level. For a fixed amount of an ideal gas, pressure is proportional to density times absolute temperature: P = ρRT/M, where temperature must be in kelvins and M is the gas’s molar mass. This calculator finds pressure from density and temperature, with molar mass as an input; it returns pressure in pascals and kilopascals.

Formula

For an ideal gas, the pressure–density relationship is P = ρRT/M. In the calculator’s units, it is P (Pa) = ρ (kg/m³) × R × [t (°C) + 273.15] ÷ [M (g/mol) ÷ 1000]. The conversion / 1000 changes molar mass from grams per mole to kilograms per mole; adding 273.15 converts Celsius to kelvins.

  • P is absolute pressure in pascals (Pa).
  • ρ (rho) is gas mass density in kilograms per cubic metre (kg/m³).
  • R is the molar gas constant, exactly 8.31446261815324 J/(mol·K).
  • T is absolute temperature in kelvins (K), calculated as t + 273.15.
  • M is molar mass in kg/mol, calculated from the entered g/mol value divided by 1000.

Because 1 J = 1 Pa·m³, the units reduce to pascals. The relationship assumes ideal-gas behaviour and uses absolute pressure, not gauge pressure.

Worked Example

Using the defaults—density 1.225 kg/m³, temperature 15 °C, and molar mass 28.97 g/mol:

  1. Convert temperature: T = 15 + 273.15 = 288.15 K.
  2. Convert molar mass: M = 28.97 / 1000 = 0.02897 kg/mol.
  3. Substitute: P = 1.225 × 8.31446261815324 × 288.15 / 0.02897.
  4. Calculate: P ≈ 101324.9 Pa, which rounds to 101325 Pa at zero decimals.
  5. Convert to kilopascals: 101324.9 / 1000 = 101.3249 kPa, which rounds to 101.325 kPa.

Assumptions

  • The gas is treated as ideal and its composition, hence molar mass, is uniform.
  • Density means mass per volume of the gas at the same temperature and pressure being calculated.
  • Temperature is converted from °C to K; absolute zero is the lower input limit.
  • The result is absolute pressure. No gauge-pressure offset is included.

How Pressure, Density, and Temperature Relate

The ideal gas law is commonly written PV = nRT, where V is volume and n is the amount of gas in moles. Since density is mass divided by volume, and the gas’s mass is nM, density can be written ρ = nM/V. Rearranging gives P = ρRT/M. This form makes the role of density explicit and is useful when a gas’s mass per unit volume is known.

For a particular gas with fixed molar mass, pressure rises in direct proportion to density if temperature stays constant. Double the density and the ideal-gas pressure doubles. At fixed density, pressure also rises in direct proportion to absolute temperature: doubling kelvins doubles pressure. These comparisons require the stated quantity to remain fixed; changing a gas in a closed rigid container, for example, generally changes its density as its temperature changes.

Molar mass matters when comparing different gases. At the same density and temperature, a gas with a larger molar mass has lower pressure according to this equation. Conversely, at the same pressure and temperature, the ideal-gas density is ρ = PM/(RT), so heavier gases are denser. Mixtures use the mixture’s average molar mass, derived from composition.

What the Relationship Means in Practice

The calculator is useful for estimating a gas pressure when density, temperature, and composition are already available. It can also clarify why a density value is incomplete without its conditions: gas density changes with both pressure and temperature. A value measured in one environment should not be treated as a universal property of that gas.

For instance, near ordinary atmospheric conditions, dry air has a molar mass close to 28.97 g/mol. With density 1.225 kg/m³ at 15 °C, the ideal-gas calculation gives about 101.325 kPa. This is a consistency example, not a claim that air always has that density or pressure. Humidity and composition also affect air’s molar mass, while weather and altitude affect pressure and density.

Temperature must be on an absolute scale. Celsius is shifted relative to kelvin, so a temperature such as 20 °C cannot be inserted as “20” in a proportional gas-law calculation. Convert it to 293.15 K first. A temperature increase from 10 °C to 20 °C is not a doubling of absolute temperature: the ratio is 293.15/283.15, about 1.035, so pressure at fixed density rises by roughly 3.5%.

Limits and Common Mistakes

  • Using gauge pressure: The formula yields absolute pressure. Gauge pressure is measured relative to surrounding atmospheric pressure. To compare the two, use Pabsolute = Pgauge + Patmospheric, with consistent units.
  • Mixing units: Density must be kg/m³ and molar mass must be entered in g/mol as labeled. The formula explicitly converts molar mass to kg/mol. A density in g/L has the same numerical value as kg/m³, but other unit choices need conversion.
  • Using liquid density: This is an ideal-gas equation, not a formula for liquids or solids. Their pressure–density behaviour is different and usually requires material-specific information.
  • Assuming all gases are ideal: Real gases depart from the ideal model, particularly at high pressure and low temperature, and near condensation. Use a real-gas equation of state and appropriate substance-specific parameters when that accuracy matters.
  • Pairing unrelated measurements: Density must correspond to the gas’s current state. Combining a density measured at one pressure or temperature with another state produces a misleading answer.

Rounding also matters. The displayed pressure is rounded to whole pascals, while the kilopascal output is rounded to three decimal places. That formatting does not imply the inputs are accurate to those digits; measurement uncertainty and composition may dominate the final precision.

Frequently Asked Questions

Does pressure increase when density increases?
For the same ideal gas at the same absolute temperature, yes: pressure is directly proportional to density. If temperature or gas composition also changes, the comparison must account for those changes.

Does pressure increase when temperature increases?
At fixed density and composition, yes. The proportionality is to kelvins, not Celsius degrees. In a sealed rigid container, density remains fixed, so warming an ideal gas raises its pressure.

Can I calculate density from pressure and temperature?
Yes. Rearrange the ideal-gas relationship to ρ = PM/(RT), using absolute pressure in pascals, temperature in kelvins, molar mass in kg/mol, and R = 8.31446261815324 J/(mol·K).

Why is absolute pressure required?
The gas law measures pressure relative to a vacuum. Gauge pressure uses the local atmosphere as its zero point, so it must be converted to absolute pressure before applying the equation.

Is this equation accurate for every gas?
No. It is an approximation that works well for many gases at modest pressures and temperatures far from condensation. Real-gas effects can become important at high pressure or low temperature.

For laboratory or engineering use, verify that the density and temperature describe the same gas state and that the ideal-gas approximation is suitable. Follow your lab method, the safety data sheet (SDS) and your supervisor.

Related

Formula used
in rho | Gas density | kg/m^3 | 1.225 | 0
in t | Temperature | °C | 15 | -273.15
in mm | Molar mass | g/mol | 28.97 | 0
out p | Pressure | Pa | rho * 8.31446261815324 * (t + 273.15) / (mm / 1000) | 0
out pk | Pressure | kPa | p / 1000 | 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

The whole Moles & Molar Mass section →