molecalculator

Moles & Molar Mass

Pressure Density Temperature Equation Calculator

Calculator No. 01-2088 · 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.

The pressure–density–temperature equation for an ideal gas is p = ρRT/M, where pressure depends on density, absolute temperature, the gas constant, and the gas’s molar mass. This calculator uses pressure in pascals, density in kilograms per cubic metre, temperature in kelvins, and molar mass in grams per mole, and returns pressure in pascals and kilopascals.

Formula

For an ideal gas, the mass-density form of the equation is:

p = ρRT / M

  • p is absolute pressure in pascals (Pa).
  • ρ (rho) is gas 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). This calculator accepts degrees Celsius and converts using T = t + 273.15.
  • M is molar mass in kilograms per mole (kg/mol). The input is in g/mol, so the expression converts it using M = mm / 1000.

The unit conversions matter: one joule is one Pa·m³, making the result pascals when the other quantities use the units above. The calculator’s second result converts pressure from pascals to kilopascals by dividing by 1000.

Worked Example

Using the calculator’s default inputs—density 1.2 kg/m³, temperature 20 °C, and molar mass 28.97 g/mol—first convert the temperature and molar mass:

T = 20 + 273.15 = 293.15 K

M = 28.97 / 1000 = 0.02897 kg/mol

Substitute into the pressure equation:

p = 1.2 × 8.31446261815324 × 293.15 / 0.02897

p ≈ 100843.89 Pa, which rounds to 100843.89 Pa at two decimal places. In kilopascals, p = 100843.89 / 1000 = 100.844 kPa at three decimal places. Intermediate values are rounded for display; the calculator evaluates the expression using the entered values.

Assumptions

  • The gas is treated as ideal: its molecules’ volume and intermolecular attractions are negligible for the calculation.
  • Temperature is uniform, and density, temperature, and molar mass describe the same gas sample and state.
  • Pressure means absolute pressure, not gauge pressure.
  • The molar mass is a user-supplied property of the gas or mixture; 28.97 g/mol is a conventional approximate value for dry air, not a universal gas value.

How the Equation Works

The starting point is the ideal gas law, pV = nRT, which relates pressure p, volume V, amount of substance n, temperature T, and R. For a sample with mass m, the amount in moles is n = m/M, while density is ρ = m/V. Substituting these relationships gives pV = (m/M)RT, then dividing by volume gives p = ρRT/M.

This form is useful when density is known or measured rather than the number of moles. At a fixed temperature and molar mass, pressure increases in direct proportion to density. At fixed density and molar mass, it also increases in direct proportion to absolute temperature. A gas with a higher molar mass has lower pressure at the same density and temperature under this model.

Do not confuse density with mass concentration of a substance dissolved in a liquid. This equation concerns the bulk density of a gas. For a gas mixture, the molar mass should represent the mixture’s average molar mass; the equation does not calculate that composition for you.

When to Use It and How to Read the Result

Use this equation to estimate a gas’s absolute pressure when its density, temperature, and molar mass are available. It can also be rearranged to solve for another variable if the others are known:

  • Density: ρ = pM/(RT)
  • Absolute temperature: T = pM/(ρR)
  • Molar mass: M = ρRT/p

This calculator specifically computes pressure; use the rearranged forms only when you are doing a separate calculation for a different unknown. Ensure each input refers to the same state. For example, density measured at one temperature and pressure cannot automatically be paired with a different temperature and treated as a consistent state.

The output is absolute pressure measured from a vacuum. If a pressure instrument reports gauge pressure, convert it before comparing: absolute pressure equals gauge pressure plus local atmospheric pressure. Atmospheric pressure is not always exactly 101.325 kPa, so use the applicable local value when accuracy matters. Negative absolute pressure is not physically meaningful.

Ideal Gas Versus Real Gas

The ideal gas equation is an approximation. It is often useful at relatively low pressures and sufficiently high temperatures, where molecules are far enough apart that their attractions and finite sizes have limited effect. Real gases can depart noticeably from the ideal prediction at high pressure, near condensation, or at low temperatures.

A common refinement is the compressibility-factor relation, pV = ZnRT, where Z describes deviation from ideal behavior. In density form, that becomes p = ZρRT/M. For an ideal gas Z = 1; for a real gas, Z depends on the gas and its conditions and may require reliable property data. This calculator does not estimate Z, so it should not be treated as a high-accuracy real-gas model outside suitable conditions.

Common Mistakes and Limits

  • Using Celsius directly: the gas law requires kelvins. Convert by adding 273.15; 0 °C is 273.15 K, not 0 K.
  • Mixing units: this calculator expects kg/m³ and g/mol. Entering density in g/L happens to have the same numerical value as kg/m³, but other units require conversion.
  • Using molar mass in the wrong scale: enter 28.97 g/mol, not 0.02897, because the expression converts g/mol to kg/mol.
  • Confusing gauge and absolute pressure: the formula returns absolute pressure. A gauge reading omits atmospheric pressure.
  • Assuming air has one exact molar mass: air composition and humidity vary, so 28.97 g/mol is an approximation for dry air.
  • Reporting too many significant figures: the displayed decimal places are rounding settings, not a claim that the inputs are equally precise.

The equation also assumes a meaningful bulk temperature and density. It does not describe pressure gradients, changing composition, chemical reactions, or a gas in a strongly non-equilibrium state. For laboratory work, follow your lab method, the safety data sheet (SDS), and your supervisor.

Frequently Asked Questions

What is the pressure–density–temperature equation?
For an ideal gas, p = ρRT/M. Pressure is proportional to density and absolute temperature, and inversely proportional to molar mass when the other quantities are held constant.

How do I calculate pressure from density and temperature?
Convert temperature to kelvins and molar mass to kg/mol, then calculate p = ρRT/M using R = 8.31446261815324 J/(mol·K). The result is in pascals when density is in kg/m³.

Can I use Celsius in the equation?
Not directly. Add 273.15 to a Celsius temperature to obtain kelvins before using the ideal gas equation. This calculator performs that conversion from its Celsius input.

Does the equation work for liquids?
No. It is an ideal-gas relationship. Liquids are not described by this equation because their density and pressure behavior do not follow the ideal gas model.

Is pressure in the equation gauge or absolute?
It is absolute pressure. To use a gauge-pressure reading, add the relevant atmospheric pressure to obtain absolute pressure first.

Why might a measured gas pressure differ from the result?
The gas may not behave ideally, the inputs may use mismatched units or conditions, or measurements may have uncertainty. Non-ideal behavior is especially important at high pressure or near condensation.

Related

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