Ideal Gas Moles Calculator
The ideal gas law relates the pressure, volume, temperature, and amount of a gas through PV = nRT. Solving for n gives the moles of gas present, which you can then convert to mass or molecules. This calculator takes pressure in atmospheres, volume in litres, and temperature in kelvin, and returns the number of moles using the gas constant R = 0.082057 litre atmospheres per mole kelvin. Keep your inputs in these units to match the constant.
Ideal gas law formula
PV = nRT
n = (P * V) / (R * T)
Molecules = n * 6.02214076e23 (Avogadro)
The gas constant R is editable in case you work in a different unit system. The number of molecules uses the Avogadro constant, an SI defined value.
Worked example
At standard conditions of 1 atm, 22.414 litres, and 273.15 K: n = (1 * 22.414) / (0.082057 * 273.15) = 22.414 / 22.414 = 1.00 mole. That is one mole of gas, the molar volume at STP. Molecules = 1 * 6.022e23 = 6.02 x 10^23.
Ideal gas moles: frequently asked questions
How do you find moles from the ideal gas law?
Rearrange PV = nRT to n = PV divided by RT. Pressure in atmospheres times volume in litres, divided by the gas constant times the absolute temperature in kelvin, gives the moles of gas.
What value of the gas constant does this use?
This calculator uses R = 0.082057 litre atmospheres per mole kelvin, the value consistent with pressure in atmospheres and volume in litres. Other unit systems use 8.314 joules per mole kelvin; keep your units matched to the constant.
Why must temperature be in kelvin?
The ideal gas law is built on absolute temperature, where zero means no thermal motion. Celsius and Fahrenheit have arbitrary zero points, so they would give wrong results. Convert by adding 273.15 to a Celsius temperature to get kelvin.
Sources
- NIST: CODATA value of the molar gas constant R.
- NIST: Avogadro constant.
Reviewed by the CalculatorHub team, edited by James Graham, 19 June 2026. See our methodology.