Skip to main content

Molar Mass of Gas Calculator

Ready to calculate
Ideal Gas Law (PV=nRT).
10 Pressure × 4 Temp Units.
Auto-Identifies the Gas.
100% Free.
No Data Stored.

How it Works

01Pressure & Temperature

Pick from 10 pressure units & 4 temp scales

02Volume & Mass

Volume of gas + mass of the same sample

03Apply PV = nRT

Rearranged: M = mRT / PV (R = 8.314 J/mol·K)

04Identify the Gas

Closest match against 14 common gases

What is the Molar Mass of Gas Calculator?

The Molar Mass of Gas Calculator uses the rearranged ideal gas law (PV = nRT) to compute the molar mass of any gas from four directly measurable quantities: pressure, temperature, volume, and mass. The math: M = m·R·T / (P·V), where R = 8.314 J/(mol·K) is the universal gas constant. Plug in your lab measurements — 10 pressure units (Pa, kPa, atm, Torr, mmHg, etc.), 4 temperature scales (°C, °F, K, °R), 10 volume units, and 7 mass units — and the calculator returns molar mass in g/mol along with the closest matching common gas.

Why is this useful? In the lab, you can measure pressure with a manometer, temperature with a thermometer, volume with a graduated cylinder or burette, and mass with a balance. From these four routine measurements you can identify an unknown gas — its molar mass uniquely fingerprints small molecules. A reading of ~28 g/mol points to N₂, CO, or an isobaric mix; ~32 g/mol points to O₂; ~44 g/mol points to CO₂. The calculator highlights the closest match against 14 common gases.

Built for chemistry students, lab researchers, instructors writing problem sets, and analytical chemists doing gas characterization. Free, fast, mobile-friendly, fully client-side.

Pro Tip: The tool also reports gas density (kg/m³) — useful for cross-checking your identification or for buoyancy / compressibility calculations.

How to Use the Molar Mass of Gas Calculator?

Enter Pressure: Pick from 10 units (Pa, bar, psi, kPa default, atm, Torr, mmHg, etc.). Internally normalized to pascals.
Enter Temperature: °C (default), °F, K, or °R (Rankine). Internally normalized to kelvins — the only valid scale for the ideal gas law.
Enter Volume of the gas: The volume occupied by the gas sample. From mm³ to m³, ml to liters, US gallons, etc.
Enter Mass of the same gas: The mass of the same gas sample whose volume and conditions you measured. From μg up to stones.
Press Calculate: The tool returns molar mass (g/mol), number of moles, density, and identifies the closest common gas — strong match (< 5%), reasonable (< 15%), or different gas.

How is gas molar mass calculated?

The ideal gas law: PV = nRT. Substituting n = m/M (moles = mass ÷ molar mass) gives PV = (m/M)RT, which rearranges to M = mRT / PV. Provide P, T, V, m, and you compute M.

R is the universal gas constant. In SI units: R = 8.314462618 J/(mol·K). Other common units: 0.08206 L·atm/(mol·K), 62.36 L·Torr/(mol·K). The calculator uses SI throughout.

Calculation Math — Step by Step:

1. Normalize to SI

Convert all inputs to SI units:

  • Pressure → pascals (Pa)
  • Temperature → kelvins (K)
  • Volume → cubic meters (m³)
  • Mass → grams (g)

Mixing units (atm and L) requires the right R value. SI normalization avoids that.

2. Apply M = mRT / PV

With SI units:

  • m in grams
  • R = 8.314 J/(mol·K)
  • T in kelvins
  • P × V in joules (Pa × m³ = J)

Result M is in g/mol. Units cancel: g·J / J = g/mol.

3. Compute Moles

From mass and molar mass:

  • n = m / M
  • n is in moles
  • Useful for stoichiometry

Or directly: n = PV / (RT) — same answer, doesn't need M.

4. Compute Density

Mass per unit volume:

  • ρ = m / V
  • Convert m to kg, V to m³
  • Result in kg/m³

Air at STP ≈ 1.225 kg/m³. CO₂ ≈ 1.84. H₂ ≈ 0.0899.

Common Gas Molar Masses (Reference):

Light Gases
  • Hydrogen (H₂): 2.016 g/mol
  • Helium (He): 4.003 g/mol
  • Methane (CH₄): 16.04 g/mol
  • Ammonia (NH₃): 17.03 g/mol
  • Water vapor (H₂O): 18.02 g/mol
  • Neon (Ne): 20.18 g/mol
Heavier Gases
  • Nitrogen (N₂): 28.01 g/mol
  • Carbon monoxide (CO): 28.01 g/mol
  • Air (avg): 28.97 g/mol
  • Oxygen (O₂): 32.00 g/mol
  • Argon (Ar): 39.95 g/mol
  • Carbon dioxide (CO₂): 44.01 g/mol
  • Sulfur dioxide (SO₂): 64.07 g/mol
  • Chlorine (Cl₂): 70.90 g/mol

Standard Conditions:

STP — IUPAC (since 1982)

100 kPa, 0°C

1 mole of ideal gas = 22.71 L at IUPAC STP. The modern definition.

STP — Older Definition (still used)

1 atm (101.325 kPa), 0°C

1 mole of ideal gas = 22.414 L. Still common in many textbooks.

Lab Conditions (typical)

~101 kPa, 20–25°C

Real lab measurements happen at room temperature, not 0°C. Always use your actual measured T and P, not assumed STP.

When the Ideal Gas Law Breaks Down:

High Pressure (> 10 atm)

Molecular volume becomes non-negligible. Real gases compress less than ideal gases at high P. Use Z (compressibility factor): PV = ZnRT.

Low Temperature

Near the gas's boiling point, intermolecular attractions matter. Real gases liquefy; ideal gases never do. Use van der Waals: (P + a/V²)(V − b) = RT.

Real-World Example

Real Lab Scenarios

Sample calculations using the ideal gas law:

Scenario P T V m M (g/mol)
O₂ at STP101.325 kPa0°C22.414 L32.00 g32.00 (O₂ ✓)
CO₂ at room T101 kPa25°C1 L1.798 g44.0 (CO₂ ✓)
Air at STP1 atm0°C22.414 L28.97 g28.97 (Air ✓)
Helium balloon100 kPa20°C10 L1.643 g4.00 (He ✓)
Unknown low-MW gas98 kPa25°C500 ml0.81 g~40.6 (Ar?)
High-pressure tank10 bar25°C5 L14 g~6.93 (H₂ + non-ideal?)

The first 4 rows give clean matches against textbook gases. The last two need additional context — either an unfamiliar gas, an isotope, or non-ideal behavior at high pressure.

Who Should Use the Molar Mass of Gas Calculator?

1
🧪 Chemistry Students: Solve textbook ideal gas law problems instantly. Verify your manual calculations.
2
🔬 Lab Researchers: Identify unknown gases from simple bench measurements (P, T, V, m).
3
🎓 Chemistry Educators: Generate or verify problem sets. Demonstrate the connection between molar mass and gas density.
4
🧬 Biochem & Pharm: Volatile organic identification, headspace gas analysis, evaporation/sublimation studies.
5
🌫️ Environmental & Atmospheric Science: Average air-mixture molecular weight calculations, pollutant identification.
6
🏭 Industrial Process Chemistry: Process gas characterization, leak diagnosis, mixture analysis.

Technical Reference

Key Takeaways

Four routine bench measurements — pressure, temperature, volume, mass — uniquely identify a gas via the ideal gas law's M = mRT/PV. Use the ToolsACE Molar Mass of Gas Calculator to perform the calculation across any unit combination, then auto-match against 14 common gases for identification. For STP and near-STP conditions on small molecules, the ideal gas approximation is highly accurate. For unusual conditions (high pressure, near-condensation), apply real-gas corrections.

Frequently Asked Questions

What is the ideal gas law?
The ideal gas law is the foundational equation of state for gases: PV = nRT, where P is pressure, V is volume, n is moles, R is the universal gas constant (8.314 J/(mol·K)), and T is absolute temperature in kelvins. It assumes gas particles have negligible volume and don't interact — a good approximation for most gases at moderate temperature and pressure.
How do I calculate molar mass of a gas?
Use M = mRT / PV. The full procedure:

  1. Measure pressure (P), temperature (T), volume (V), and mass (m) of the gas sample

  2. Convert to SI units: P in Pa, V in m³, T in K, m in g

  3. Plug into M = m·R·T / (P·V) with R = 8.314 J/(mol·K)

  4. Result is M in g/mol


This calculator handles all unit conversions automatically.
Why must temperature be in kelvins?
Because the ideal gas law assumes a linear relationship between pressure (or volume) and temperature, with PV = 0 at T = 0. Only the Kelvin scale starts at absolute zero (0 K); Celsius starts at the melting point of water, Fahrenheit at an arbitrary mixture freezing point. Using °C or °F directly would give wrong answers — the calculator converts automatically.
What is R, the gas constant?
R = 8.314462618 J/(mol·K) in SI units — the universal gas constant. It can also be expressed in other unit systems: 0.08206 L·atm/(mol·K), 62.36 L·Torr/(mol·K), 1.987 cal/(mol·K). All these are the same constant; just different units. The calculator uses SI internally.
How accurate is the ideal gas law?
Highly accurate for most gases at temperatures well above their boiling point and pressures below ~10 atm. Errors stay within ~1% under normal lab conditions. The ideal gas law breaks down when:
  • Pressure is very high (molecular volume becomes significant)
  • Temperature is near liquefaction (intermolecular attractions matter)
  • Gas has strong dipole interactions (water vapor, ammonia at low T)
In these cases, use the van der Waals equation or a compressibility factor.
What if my answer doesn't match a known gas?
Possibilities:

  1. Mixture: the sample is a mixture of multiple gases (calculator gives weighted-average molar mass)

  2. Measurement error: P, T, V, or m measured imprecisely

  3. Non-ideal conditions: high P or low T — use real gas corrections

  4. Unusual gas: outside the 14-common-gas reference (e.g., noble gas mixture, specialty industrial gas)

Can I use it to find moles instead?
Yes — moles are computed alongside molar mass: n = m / M, or directly from n = PV / (RT). The result panel shows the moles value. If you know your gas's molar mass and want to find moles, use the formula directly with R = 8.314 J/(mol·K), P in Pa, V in m³, T in K.
How is gas density related?
Density (ρ) = mass / volume = PM / (RT) from the ideal gas law. The calculator reports density in kg/m³. At STP, air = 1.225 kg/m³, helium = 0.179, CO₂ = 1.977. Density is useful for buoyancy calculations, ventilation engineering, and confirming gas identity.
What is STP?
Standard Temperature and Pressure — historically defined as 1 atm (101.325 kPa) and 0°C (273.15 K), giving 1 mole of ideal gas = 22.414 L. IUPAC redefined STP in 1982 to 100 kPa and 0°C, where 1 mole = 22.711 L. Many textbooks still use the old definition. Always confirm which STP a problem uses.
Is air's molar mass really 28.97?
Yes — the weighted average of major air components: ~78% N₂ (28.01), ~21% O₂ (32.00), ~1% Ar (39.95), trace CO₂ and water vapor. The exact value depends on humidity (water vapor lowers it) and altitude (composition shifts very slightly). 28.97 g/mol is the standard dry-air value.
Can I use this for liquid solutions or solid compounds?
No — this is specifically for the gas phase. The ideal gas law assumes negligible particle interactions, which fails dramatically in liquids and solids. For non-gas molar mass, use the molecular formula and atomic weights from a periodic table.
Does this work for water vapor?
Yes, with caveats. Pure water vapor at temperatures well above 100°C and atmospheric pressure behaves nearly ideally — molar mass calculation gives 18.02 g/mol accurately. Below 100°C at 1 atm, water condenses (liquefies), so you can't have pure water vapor. Mixtures (humid air) require partial-pressure analysis.
Is my data private?
All calculations happen locally in your browser. Nothing is sent to a server, saved, or logged. The tool is free and requires no sign-up.

Author Spotlight

The ToolsACE Team - ToolsACE.io Team

The ToolsACE Team

Our chemistry tools team implements the rearranged ideal gas law M = mRT/PV using the modern SI value R = 8.314462618 J/(mol·K). The tool normalizes any unit combination to SI internally before computing molar mass, then matches the result against 14 common gases for identification.

Ideal Gas LawMolecular Weight DeterminationSoftware Engineering Team

Disclaimer

The ideal gas law assumes negligible particle interactions and zero molecular volume — accurate for most gases at standard conditions but breaks down at high pressure or temperatures near liquefaction. For real-gas conditions, apply a compressibility factor (Z) or use the van der Waals equation.