Find moles from measured gas conditions
The ideal-gas equation connects a gas sample's pressure, volume and temperature with its amount in moles. Once the amount is calculated, dividing the sample mass by that amount gives a molar-mass estimate. This workflow is useful when a problem supplies measurements instead of a chemical formula.
M = m ÷ n = mRT ÷ PV
The app converts pressure to Pa, volume to m³ and temperature to K. It uses R = 8.31446261815324 J/(mol·K), the SI product of the exact Avogadro and Boltzmann constants. Because Pa·m³ is a joule, the first result is in mol. Keeping sample mass in g then gives M in g/mol.
A worked sample, without guessing its identity
A gas-only mass of 1.25 g occupies 1 L at 100 kPa absolute and 26.85 °C. The temperature is 300 K and the volume is 0.001 m³. The amount is 100,000 × 0.001 ÷ (R × 300), about 0.0400908 mol. Dividing 1.25 g by that amount gives 31.1792 g/mol.
The measured density is 1.25 g/L. The molar volume at these particular conditions is 24.9434 L/mol. Neither result establishes the gas's chemical identity. A gas mixture can also have an average molar mass; several compositions can share that average.
Match the pressure to the mass
- Absolute versus gauge pressure: a gauge reading is relative to its reference pressure. Convert it using the actual reference before using this tool; a fixed atmospheric pressure is not inserted.
- Gas collected over liquid: a measured total pressure may include vapor. If your mass refers only to a dry component, its corresponding partial pressure is needed. This page does not look up vapor pressure or infer a correction.
- Gas-only mass: container mass and condensed material do not belong in the numerator. A mass difference is useful only when it actually isolates the measured gas sample.
What the ideal-gas assumption leaves out
This estimate uses PV = nRT with no real-gas correction. Intermolecular forces, finite molecular size and condensation can make real samples depart from that model. No universal pressure cutoff guarantees accuracy for every substance. Use a suitable real-gas model or measured property data when the approximation is not justified.
Volume and temperature must refer to the same measured state as pressure. Do not substitute a standard-volume report while keeping operating pressure and temperature. The tool rejects zero mass, pressure or volume and temperatures at or below absolute zero; it cannot detect a plausible-looking but mismatched measurement.
Use the result in a mass-to-moles calculation
If this estimate is suitable for your sample, the grams to moles calculator accepts a custom molar mass. When composition is known instead, the mole fraction calculator finds mixture composition from component masses and formulas. Displayed values use six significant figures, copied values eight; measurement uncertainty is not calculated.
Browse chemistry calculators →
Sources and corrections
OpenStax: ideal-gas law and temperature; OpenStax: gas density, molar mass and partial pressure; NIST CODATA constants. Reviewed September 20, 2026. Calculations stay in your browser and entries are not saved. Send corrections to contact@gramstomoles.org.