molecalculator

Moles & Molar Mass

Density to Molar Mass Formula and Worked Example

Calculator No. 01-4779 · 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 density–molar mass formula is M = ρRT/P for an ideal gas, where M is molar mass, ρ is gas density, T is absolute temperature, and P is pressure. Entering density, temperature, and pressure lets this calculator estimate molar mass in g/mol; the result is meaningful only when the gas behaves sufficiently like an ideal gas and the units match the formula.

Formula

For an ideal gas, density is related to molar mass by:

ρ = PM/(RT), rearranged to M = ρRT/P.

  • M is molar mass in g/mol.
  • ρ is gas density in g/L.
  • R is the gas constant, 0.0820574 L·atm/(mol·K).
  • T is absolute temperature in kelvins (K).
  • P is absolute pressure in atmospheres (atm).

The units cancel to give g/mol: (g/L)(L·atm/(mol·K))(K)/atm = g/mol. The calculator uses the conventional rounded value of R specified above. If your measurements use other units, convert them first: density in g/mL must be multiplied by 1000 to obtain g/L; pressure in kPa must be divided by 101.325 to obtain atm; and temperature in degrees Celsius must have 273.15 added to obtain kelvins. Do not enter gauge pressure: the equation requires pressure relative to vacuum.

Worked Example

Using the exact default inputs from the calculator:

  • ρ = 1.250 g/L
  • T = 273.15 K
  • P = 1 atm

Substitute the values:

M = (1.250 g/L)(0.0820574 L·atm/(mol·K))(273.15 K)/(1 atm)

M = 28.0135 g/mol ≈ 28.01 g/mol

The displayed value is rounded to two decimal places. This is close to the molar mass of nitrogen gas, N2, about 28.014 g/mol. The example illustrates the calculation, not a claim that the entered gas is nitrogen; density depends on the gas and the stated conditions.

Assumptions

  • The gas is treated as ideal, so its compressibility factor is taken as 1.
  • Pressure is absolute and temperature is in kelvins.
  • Density refers to the gas at the same temperature and pressure used in the equation.
  • The gas sample is sufficiently pure for a single molar mass to describe it.

When This Formula Applies

This relationship is useful when a gas’s density can be measured or obtained at a stated temperature and pressure, and its molar mass is unknown. It also helps check whether a reported gas density is consistent with a proposed molecular identity. The formula comes from the ideal gas law, PV = nRT, together with density ρ = mass/volume and molar mass M = mass/amount of substance. Combining these definitions gives the density form directly.

For a mixture, the calculated value is generally an apparent or average molar mass, not the molar mass of each component. In ideal-gas conditions, the mixture’s mean molar mass is connected to the component proportions. If composition changes, the mean can change too. A sample containing moisture or another contaminant may therefore give a different answer from a dry, pure gas.

How to Use and Interpret the Result

Use density at the actual measurement conditions, not a value copied from a reference that applies at a different temperature or pressure. Then enter absolute temperature and pressure in the listed units. The output is an inferred molar mass, which can be compared with candidate chemical formulas or a reference value measured under comparable conditions.

A small measurement error can affect the answer. In the equation, molar mass changes in direct proportion to density and temperature and in inverse proportion to pressure. For example, holding the other inputs fixed, a density 2% too high makes the calculated molar mass 2% too high; a pressure 2% too high makes it about 2% too low. This sensitivity is one reason to report the conditions and reasonable measurement uncertainty along with a result.

Unit Choices and Common Mistakes

  • Using Celsius directly: The gas equation uses kelvins. Convert with T(K) = T(°C) + 273.15.
  • Mixing pressure units: This calculator expects atm. Convert kPa using 1 atm = 101.325 kPa, or convert bar using 1 atm = 1.01325 bar.
  • Using an incompatible density unit: The input is g/L. Since 1 g/mL = 1000 g/L, forgetting this conversion changes the result by a factor of 1000.
  • Entering gauge pressure: Add local atmospheric pressure to gauge pressure to obtain absolute pressure; the pressure in the formula cannot be zero or negative.
  • Overinterpreting rounded values: The output is rounded to two decimals. Keep extra precision during intermediate calculations and do not infer more certainty than the measurements support.

Limits and Comparisons

The formula is an ideal-gas estimate, not a universal density-to-molar-mass conversion. Real gases can depart from ideal behavior, particularly at high pressure or near condensation. A more general gas relation includes the compressibility factor Z: ρ = PM/(ZRT), giving M = ρZRT/P. The calculator does not include Z, because it depends on the gas and conditions; a value must come from appropriate data when non-ideality matters.

For liquids and solids, density alone cannot determine molar mass. Many substances can have the same density but different molecular masses, because density also reflects molecular packing and structure. In those cases, use an appropriate chemical identification or molecular-mass method rather than applying the ideal-gas equation. For a gas, the result also depends on having the correct phase and composition: condensation, impurities, or a changing mixture can undermine the estimate.

If the result is being used in a laboratory context, follow your lab method, the safety data sheet (SDS) and your supervisor.

Frequently Asked Questions

How do I calculate molar mass from gas density?
For an ideal gas, multiply density by the gas constant and absolute temperature, then divide by absolute pressure: M = ρRT/P. Make sure the units are consistent; this calculator uses g/L, K, and atm.

Can I find molar mass from the density of a liquid?
Not from density alone. The gas formula relies on the ideal gas law; a liquid’s density does not uniquely specify its molar mass.

Why must temperature be in kelvins?
The gas law uses absolute temperature, whose zero corresponds to the limit of zero thermal temperature. Celsius has an arbitrary zero offset, so using Celsius directly produces an incorrect result.

Does pressure mean gauge or absolute pressure?
It means absolute pressure, measured relative to a vacuum. Gauge pressure is measured relative to the surrounding atmosphere and must be converted before use.

Can this formula identify an unknown gas?
It can provide an estimated molar mass to compare with candidate gases, but it does not prove identity. Measurement uncertainty, mixtures, impurities, and non-ideal behavior can affect the result; other evidence may be needed.

What is the density-to-molar-mass relationship for a real gas?
When non-ideality matters, use M = ρZRT/P, where Z is the gas compressibility factor. Z must be known for the gas and conditions; assuming Z = 1 is the ideal-gas approximation used here.

Related

Formula used
in rho | Gas density | g/L | 1.250 | 0
in t | Temperature | K | 273.15 | 0
in p | Pressure | atm | 1 | 0
out m | Molar mass | g/mol | rho * 0.0820574 * t / p | 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 →