Gas Mass from PV Calculator
How much does the gas in a container weigh? The ideal gas law gives the answer in two steps: it converts pressure, volume, and temperature into a number of moles, and then the gas's molar mass turns those moles into mass. While any ideal gas has the same moles under the same conditions, the mass depends on which gas it is, so the molar mass is essential. This calculator takes pressure, volume, temperature, and molar mass and returns the amount in moles along with the mass in grams and kilograms.
Gas mass formula
n = P * V / (R * T)
mass (g) = n * M
mass (kg) = mass (g) / 1000
The ideal gas law PV = nRT gives the moles n. Multiplying by the molar mass M converts moles to mass. With consistent units (atm, L, K, and the matching gas constant), the mass is in grams when M is in grams per mole.
Gas mass facts
- One mole of an ideal gas occupies about 22.414 liters at 273.15 K and 1 atmosphere.
- Dry air has an average molar mass of about 28.97 grams per mole.
- Moles depend only on pressure, volume, and temperature, not on the gas identity.
- Mass depends on the molar mass, which differs from one gas to another.
- The gas constant is user-editable to match your chosen unit system.
Gas mass: frequently asked questions
How do you find the mass of a gas from pressure and volume?
First find the moles with the ideal gas law n = PV / (RT), then multiply by the gas's molar mass to get the mass: mass = n * M = PVM / (RT). You need the pressure, volume, temperature, and the molar mass of the specific gas, since mass (unlike moles) depends on which gas it is.
What is the formula this calculator uses?
Moles n = PV / (RT) and mass = n * M, where P is pressure, V is volume, R is the gas constant, T is the absolute temperature in kelvin, and M is the molar mass. With P in atmospheres, V in liters, R as 0.082057 liter-atmospheres per mole-kelvin, and M in grams per mole, the mass comes out in grams.
Why do I need the molar mass?
The ideal gas law gives the number of moles, which is the same for any gas at the same pressure, volume, and temperature. To convert moles into mass you must know the molar mass, which differs between gases (for example 28.0 grams per mole for nitrogen and 44.0 for carbon dioxide).
What molar mass should I enter for air?
Dry air has an average molar mass of about 28.97 grams per mole, reflecting its mixture of roughly 78 percent nitrogen, 21 percent oxygen, and trace gases. For a pure gas, use that gas's molar mass: 2.016 for hydrogen, 32.00 for oxygen, 18.02 for water vapor, and so on.
What units does this calculator use?
Enter pressure in atmospheres, volume in liters, temperature in kelvin, and molar mass in grams per mole. The gas constant is a user-editable input preset to 0.082057 liter-atmospheres per mole-kelvin. The calculator returns the amount in moles and the mass in grams and kilograms.
Official sources
- NIST: CODATA value of the molar gas constant.
- NIST Chemistry WebBook: Gas property data.
Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.