How the ideal gas law calculator works
The ideal gas law links the pressure, volume, temperature and amount of a gas. It describes most gases well at everyday temperatures and pressures.
R = 0.082057 L·atm/(mol·K)
T (K) = T (°C) + 273.15
Temperature must be absolute, so Celsius is converted to kelvin. With pressure in atmospheres and volume in liters, R is 0.082057. Multiplying moles by Avogadro's number (6.022 × 10²³) gives the number of molecules, and by molar mass gives grams. Real gases deviate at high pressure or low temperature, where the van der Waals equation is more accurate.
Worked example
At 0 °C (273.15 K) and 1 atm, 22.4 L of gas contains n = 1 × 22.4 ÷ (0.082057 × 273.15) = 0.9994 mol, the classic "one mole occupies 22.4 L at STP". If the gas is oxygen (32.00 g/mol), its mass is 31.98 g. At 25 °C the same volume holds about 0.916 mol.
Frequently asked questions
What is R in PV = nRT?
The gas constant: 0.082057 L·atm/(mol·K), or 8.314 J/(mol·K) in SI units.
Why must temperature be in kelvin?
The law is proportional to absolute temperature; Celsius has an arbitrary zero.
What volume does one mole of gas occupy?
22.414 L at 0 °C and 1 atm, and about 24.47 L at 25 °C and 1 atm.
When does the ideal gas law fail?
At high pressures and low temperatures, when molecular size and attractions matter.
Updated October 2026. Results are estimates for education, not financial or medical advice. All math runs in your browser; nothing you type is sent anywhere.