molecalculator

Moles & Molar Mass

Molar Mass From Density: Formula and Calculator

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

This calculator estimates a gas’s molar mass from its density, pressure, and temperature using the ideal-gas relationship. Enter the gas density, pressure, and absolute temperature to get molar mass in g/mol; the result is valid only when the gas behaves approximately ideally and the units are converted consistently.

Formula

For an ideal gas, density is related to molar mass by M = ρRT/P. The calculator’s units are chosen so this expression returns g/mol: M (g/mol) = ρ (g/L) × R × T (K) ÷ P (kPa), where R = 8.31446261815324 kPa·L/(mol·K). The numerical value of this gas constant is the same as 8.31446261815324 J/(mol·K), because 1 kPa·L equals 1 J.

  • M is molar mass in grams per mole (g/mol).
  • ρ (rho) is gas density in grams per liter (g/L).
  • R is the ideal gas constant, 8.31446261815324 kPa·L/(mol·K).
  • T is absolute temperature in kelvin (K). Convert Celsius using T = t + 273.15.
  • P is absolute pressure in kilopascals (kPa).

Density alone is not enough to determine a gas’s molar mass. Pressure and temperature are also required because gas volume changes with both. For a liquid or solid, this gas equation does not apply; use the substance’s chemical formula and standard atomic weights, or another suitable measurement method.

Worked Example

The defaults represent a gas density of 1.25 g/L at 101.325 kPa and 0 °C. Convert temperature first:

T = 0 + 273.15 = 273.15 K

Substitute the defaults into the formula:

M = 1.25 × 8.31446261815324 × 273.15 ÷ 101.325

M ≈ 28.013 g/mol

The calculator reports 28.013 g/mol, rounded to three decimal places. Do not infer that the gas must be a particular substance from this value alone: measurement uncertainty, mixtures, and non-ideal behavior can all affect the result.

Assumptions

  • The gas is treated as an ideal gas, or close enough for the estimate required.
  • Pressure is absolute pressure, not gauge pressure.
  • Density, pressure, and temperature refer to the same gas sample and conditions.
  • Temperature is entered in °C and converted to kelvin by adding 273.15.
  • The gas is a pure substance for interpreting the result as one molar mass. A mixture gives an effective average molar mass.

What You’ll Need

  • A gas density value and its unit, preferably measured or specified for known conditions.
  • The gas’s absolute pressure and temperature when that density applies.
  • A calculator, or the calculator above. If converting units yourself, keep track of every conversion factor.

Step-by-Step

  1. Check that the sample is a gas. This method is based on the ideal gas law. It is not a general way to convert the density of a liquid or solid into molar mass.
  2. Find the density and its conditions. Use density in g/L for the calculator. If your value is in kg/m³, its numerical value is the same in g/L (for example, 1 kg/m³ = 1 g/L). If it is in g/mL, multiply by 1000 to convert to g/L.
  3. Record absolute pressure. Enter pressure in kPa. Convert bar to kPa by multiplying by 100; convert atm to kPa by multiplying by 101.325. If your reading is gauge pressure, add the local atmospheric pressure to obtain absolute pressure before using the formula. Never enter zero or negative absolute pressure.
  4. Record temperature. Enter the temperature in °C. The calculator adds 273.15 to convert it to kelvin. Kelvin must be above zero; temperatures below −273.15 °C are physically impossible.
  5. Calculate using M = ρRT/P. The calculator applies R = 8.31446261815324 kPa·L/(mol·K), with density in g/L, temperature in K, and pressure in kPa. If calculating by hand, write units beside the numbers to catch mismatches.
  6. Interpret and report the result. Read the output in g/mol. Include the pressure and temperature alongside the result, and retain sensible significant figures based on the input measurements. Compare with a reference value only if the conditions and gas identity are appropriate.

Common Mistakes

  • Using density without its conditions: gas density depends strongly on pressure and temperature. A density quoted at standard conditions cannot be paired with unrelated pressure and temperature values.
  • Using gauge pressure as absolute pressure: a gauge reads relative to the surrounding atmosphere. Add atmospheric pressure first; otherwise the calculated molar mass will be wrong.
  • Mixing units: the displayed formula requires g/L, kPa, and kelvin. For example, entering pressure in atm as though it were kPa makes the answer about 101 times too large.
  • Using Celsius directly: the gas equation requires kelvin. At 0 °C, use 273.15 K, not zero.
  • Applying the result to a mixture as if it were pure: the calculation gives an average molar mass for a gas mixture, not the identity or individual molar masses of its components.
  • Over-rounding: rounding intermediate values can shift the final result. Keep full calculator precision until the last step.

Tips

  • Use density measured at the same pressure and temperature you enter. If conditions are missing, look them up or obtain a measurement rather than guessing.
  • Check conversions before substituting: 1 bar = 100 kPa; 1 atm = 101.325 kPa; 1 kg/m³ = 1 g/L.
  • For gases at high pressure or near condensation, the ideal-gas approximation may be poor. A suitable compressibility-factor or real-gas equation may be needed, with substance-specific data.
  • Use the formula in reverse as a consistency check: ρ = MP/(RT), provided all variables use the same unit convention.
  • For bench work, follow your lab method, the safety data sheet (SDS) and your supervisor.

Troubleshooting

The result is far too high or low: check whether density is in g/L, pressure is in kPa absolute, and temperature is in °C in the input. Pay special attention to g/mL and atm values, which need conversion.

The calculator rejects a temperature: temperatures below −273.15 °C cannot be converted to a positive absolute temperature. Check for a sign or unit error.

You only know density: find the pressure and temperature for which it was reported. There is no unique molar mass from density alone, because different conditions can produce different densities for the same gas.

Your result does not match a reference value: verify the sample’s purity and conditions, check whether pressure is gauge or absolute, and consider non-ideal behavior. If the gas is a mixture, compare against an average molar mass rather than a pure-gas value.

Frequently Asked Questions

Can I find molar mass from density alone?
No. For a gas, you also need its pressure and temperature. For liquids and solids, this ideal-gas method does not apply.

Why does the formula use kelvin?
The ideal gas law uses absolute temperature, measured from absolute zero. Convert Celsius to kelvin by adding 273.15.

Can I use this for a liquid?
No. Liquid density does not determine molar mass through the ideal gas equation. Use the compound’s formula and atomic weights, or an appropriate experimental method.

What if I have a gas mixture?
The calculation estimates the mixture’s effective average molar mass at the stated conditions. It does not identify each component.

Does higher pressure change the molar mass?
A pure gas’s molar mass does not change with pressure, but its density does. Pressure is included so density can be interpreted at the conditions where it was measured.

How accurate is the answer?
Accuracy depends on density and condition measurements, sample purity, and how closely the gas follows ideal behavior. Report appropriate significant figures rather than treating all displayed digits as exact.

Related

Formula used
in rho | Gas density | g/L | 1.25 | 0
in p | Pressure | kPa | 101.325 | 0
in t | Temperature | °C | 0 | -273.15
out mm | Molar mass | g/mol | rho * 8.31446261815324 * (t + 273.15) / p | 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 →