molecalculator

Moles & Molar Mass

Density From Pressure and RT: Ideal Gas Formula

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

Ideal-gas density 1.2498 kg/m^3
Specific gas constant
296.80 J/(kg·K)
= 8.31446261815324 ÷ (Gas molar mass ÷ 1000)
Absolute pressure
101.325 kPa
Set in the form below
Gas molar mass
28.0134 g/mol
Set in the form below
You enter
Absolute pressure (kPa), Gas molar mass (g/mol), Absolute temperature (K)
You get
Ideal-gas density (kg/m^3), Specific gas constant (J/(kg·K))
Rounding
4 dp · 2 dp

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.

Yes— for an ideal gas, density equals pressure divided by the product of its specific gas constant and absolute temperature: ρ = P/(RsT). If you know the gas’s molar mass instead, the equivalent formula is ρ = PM/(RT); this calculator uses that form and returns density in kg/m³.

Formula

The ideal-gas density formula is:

ρ = PM/(RT)

  • ρ is gas density in kilograms per cubic metre (kg/m³).
  • P is absolute pressure in pascals (Pa). The calculator accepts kilopascals and converts them using 1 kPa = 1,000 Pa.
  • M is molar mass in kilograms per mole (kg/mol). The calculator accepts grams per mole and converts using 1 g/mol = 0.001 kg/mol.
  • R is the molar gas constant, exactly 8.31446261815324 J/(mol·K).
  • T is absolute temperature in kelvins (K).

In the form “density equals pressure over RT,” R must be the specific gas constant for the particular gas, not the universal molar gas constant. The specific constant is Rs = R/M, in J/(kg·K), so ρ = P/(RsT). The calculator derives Rs from the entered molar mass and displays it as a helper result.

Worked Example

Using the calculator’s defaults—pressure 101.325 kPa, molar mass 28.0134 g/mol, and temperature 273.15 K—the result is the ideal-gas density of nitrogen near standard atmospheric pressure and the freezing point of water.

  1. Convert pressure: 101.325 kPa × 1,000 = 101,325 Pa.
  2. Convert molar mass: 28.0134 g/mol × 0.001 = 0.0280134 kg/mol.
  3. Substitute into the formula: ρ = (101,325 Pa × 0.0280134 kg/mol) / (8.31446261815324 J/(mol·K) × 273.15 K).
  4. Calculate: ρ ≈ 1.2496 kg/m³ (rounded to four decimal places).

The specific gas constant for these defaults is 8.31446261815324 / 0.0280134 ≈ 296.80 J/(kg·K). Substituting it into ρ = P/(RsT) gives the same density, subject to rounding.

Assumptions

  • The gas follows the ideal-gas equation at the stated pressure and temperature.
  • Pressure is absolute, not gauge pressure.
  • Temperature is already expressed in kelvins.
  • The entered molar mass represents the gas or gas mixture whose density is sought.

What “RT” Means

The letters “RT” alone do not identify one universal number. In the molar form of the ideal-gas law, R is the universal gas constant and T is absolute temperature; pressure divided by RT gives a molar concentration, in mol/m³—not mass density. To turn that into mass per volume, multiply by molar mass: ρ = M(P/RT) = PM/(RT).

Alternatively, divide the universal gas constant by molar mass first. That gives the gas-specific constant Rs, allowing the compact mass-density expression ρ = P/(RsT). This distinction explains why a formula written as “pressure over RT” may be incomplete unless its R is explicitly defined.

When This Calculation Is Useful

The relation estimates the density of a gas when its pressure, temperature, and composition are known. Density is useful for comparing gases under specified conditions, converting between mass and volume, and checking ideal-gas calculations in science and engineering. For mixtures, use an appropriate mixture molar mass; for a mixture specified by mole fractions, its ideal-gas mean molar mass is the sum of each component’s mole fraction multiplied by its molar mass.

For example, the default result is about 1.25 kg/m³. Raising pressure while holding temperature and composition constant raises the ideal-gas density in direct proportion. Raising temperature at constant pressure lowers it in inverse proportion. These comparisons only hold when the other quantities remain fixed and ideal-gas behavior is a suitable approximation.

Pressure, Temperature, and Common Errors

  • Using gauge pressure: The formula requires absolute pressure. Gauge pressure is measured relative to local atmospheric pressure, so convert it to absolute pressure before using the relation. A pressure below atmospheric can have a negative gauge reading while its absolute pressure remains positive.
  • Using Celsius directly: Convert Celsius to kelvins by adding 273.15. For instance, 0 °C is 273.15 K, not zero kelvins.
  • Mixing forms of R: The universal R pairs with molar mass in the PM/(RT) formula. The specific Rs pairs directly with mass density in P/(RsT). Their units differ.
  • Mixing units: Pressure, molar mass, and temperature must match the units used in the calculation. This calculator explicitly converts kPa to Pa and g/mol to kg/mol.
  • Confusing molar concentration with density: P/(RT) is amount per volume. Multiplication by molar mass is needed to obtain mass per volume.

Ideal Gas Versus Real Gas

The equation assumes gas particles occupy negligible volume and interact negligibly, approximations that tend to work best at relatively low pressure and sufficiently high temperature. Real gases can depart noticeably from the ideal-gas prediction, particularly at high pressures or near condensation. For greater accuracy, use a real-gas equation of state or reliable property data for the specific gas and conditions.

For a common real-gas correction, the compressibility factor Z is defined through PV = ZnRT. If Z is known, the corresponding density relation is ρ = PM/(ZRT). Z is condition-dependent and is not generally equal to one; it must come from suitable data or a model rather than being guessed. The calculator deliberately reports the ideal-gas estimate and does not apply this correction.

Frequently Asked Questions

Is density equal to pressure divided by RT?
Only when R means the gas-specific constant Rs in J/(kg·K), and T is in kelvins and P is absolute pressure. With the universal molar gas constant, the mass-density equation is ρ = PM/(RT).

What units should I use for R?
For ρ = PM/(RT), use R = 8.31446261815324 J/(mol·K), M in kg/mol, P in Pa, and T in K. For ρ = P/(RsT), use a gas-specific Rs in J/(kg·K).

Can I use Celsius in the equation?
No. Use kelvins. Convert a Celsius temperature by adding 273.15; the absolute zero of the Kelvin scale is 0 K.

Do I use gauge or absolute pressure?
Use absolute pressure. Gauge pressure must first be adjusted by adding the local atmospheric pressure, expressed in the same units.

Does this formula work for every gas?
It is an ideal-gas approximation, not an exact rule for all conditions. Real-gas effects matter more in some high-pressure or near-condensation conditions, where a compressibility correction or gas-property data may be needed.

Related

Formula used
in p | Absolute pressure | kPa | 101.325 | 0
in mm | Gas molar mass | g/mol | 28.0134 | 0
in t | Absolute temperature | K | 273.15 | 0
out d | Ideal-gas density | kg/m^3 | p * 1000 * (mm / 1000) / (8.31446261815324 * t) | 4
out r | Specific gas constant | J/(kg·K) | 8.31446261815324 / (mm / 1000) | 2

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 →