Ideal Gas Law Calculator: PV = nRT and the Combined Gas Law
By FindMySum · Last reviewed
An ideal gas law calculator solves PV = nRT for whichever of the four quantities you don't know. The equation describes how most gases behave at everyday conditions: squeeze a gas and its pressure rises, heat it and it expands, add more of it and it fills more space. This article explains each term, the units that trip people up, the difference between STP and SATP, and the combined gas law for a gas that changes state.
The equation
P × V = n × R × T
- P is the absolute pressure, in pascals in SI units.
- V is the volume, in cubic metres.
- n is the amount of gas in moles.
- T is the absolute temperature in kelvin.
- R is the molar gas constant, 8.314 462 618 153 24 J/(mol·K).
Since 2019 the Avogadro constant and the Boltzmann constant have exact defined values in the SI, and R is their product, so R is exact too. The calculator converts every input to pascals, cubic metres and kelvin, solves the equation for the unknown and converts the result back to your units.
Worked example: the calculator's defaults
One mole of gas at 0 °C and 100 kPa:
- Temperature in kelvin: 0 + 273.15 = 273.15 K.
- Pressure in pascals: 100 kPa = 100,000 Pa.
- V = nRT ÷ P = 1 × 8.314 462 618 × 273.15 ÷ 100,000 = 0.022 711 m³ = 22.711 L.
That is the molar volume of an ideal gas at IUPAC standard conditions, a value CODATA lists as 22.710 954 64 L/mol. At 1 atm instead of 100 kPa, the same calculation gives 22.414 L, the figure in older textbooks.
With the molar mass of dry air (28.9644 g/mol) the calculator also gives the mass, 28.96 g, and the density: ρ = PM ÷ RT = 1.275 kg/m³ at 0 °C and 100 kPa.
Units that cause mistakes
Absolute temperature. Celsius and Fahrenheit have arbitrary zeros, so the proportion doesn't hold on those scales. Always convert: K = °C + 273.15.
Absolute pressure. Tire and gas-cylinder gauges read pressure above the atmosphere. Add atmospheric pressure (about 101.3 kPa or 14.7 psi at sea level) to get absolute pressure.
Volume. One cubic metre is 1,000 litres and one litre is 1,000 cm³ (or mL). A tenfold slip here gives a tenfold wrong answer.
Matching R to units. If you work by hand in litres and atmospheres, use R = 0.082 057 L·atm/(mol·K). The calculator avoids the issue by working in SI.
STP and SATP
"Standard conditions" have changed over time. IUPAC's standard temperature and pressure (STP) has been 273.15 K and 100 kPa (1 bar) since 1982. Many textbooks and some industries still use 273.15 K and 1 atm (101.325 kPa). Standard ambient temperature and pressure (SATP) is 298.15 K and 100 kPa, closer to room conditions. The STP and SATP buttons fill in the IUPAC values in pascals and kelvin.
The combined gas law
When a fixed amount of gas changes from one state to another, n and R cancel and:
P₁V₁ ÷ T₁ = P₂V₂ ÷ T₂
Worked example. Gas at 100 kPa, 2 L and 300 K is compressed to 200 kPa while it warms to 400 K. V₂ = P₁V₁T₂ ÷ (T₁P₂) = 100 × 2 × 400 ÷ (300 × 200) = 1.333 L. Doubling the pressure alone would halve the volume to 1 L; the temperature rise of a third pushes it back up to 1.333 L.
Because pressure and volume appear on both sides, their units cancel: any pressure unit and any volume unit work, as long as both states use the same ones. Temperatures still have to be absolute.
The special cases have their own names. Hold T constant and you get Boyle's law, P₁V₁ = P₂V₂. Hold P constant and you get Charles's law, V₁ ÷ T₁ = V₂ ÷ T₂. Hold V constant and you get Gay-Lussac's law, P₁ ÷ T₁ = P₂ ÷ T₂.
When real gases differ
The ideal gas model treats molecules as points that don't attract each other. Real gases deviate when they are compressed hard or cooled close to condensing, because molecular size and attraction start to matter. Near room temperature and atmospheric pressure, air, nitrogen, oxygen, argon and helium follow the ideal law to within a fraction of a percent. Carbon dioxide in a pressurised cylinder, steam near its boiling point and refrigerants do not, and engineers use the van der Waals equation, a compressibility factor or property tables for them.
More questions
Why does a sealed bag of chips puff up on a mountain road?
The amount of gas in the bag and its temperature barely change, but the outside pressure drops with altitude. At 2,000 m the air pressure is roughly 80 kPa instead of 101 kPa. Boyle's law (P₁V₁ = P₂V₂ at constant temperature) says the gas expands until its pressure matches, so the volume grows by about a quarter, as far as the bag allows.
How much does tire pressure change with temperature?
At a fixed volume, absolute pressure is proportional to absolute temperature. A tire at 220 kPa gauge (about 321 kPa absolute) filled at 20 °C (293 K) drops to about 321 × 253 ÷ 293 = 277 kPa absolute at −20 °C, or 176 kPa gauge. That is why tire pressure warnings come on during the first cold snap in a Canadian autumn.
What is the universal gas constant in other units?
R = 8.314 462 618 J/(mol·K) = 8.314 L·kPa/(mol·K) = 0.082 057 L·atm/(mol·K) = 62.364 L·mmHg/(mol·K) = 1.987 cal/(mol·K). They are the same constant expressed in different units. Mixing a value of R with the wrong units is the most common error in hand calculations.
Does the ideal gas law work for a mixture like air?
Yes, as long as each component behaves ideally. Treat n as the total moles of all gases. Each gas then contributes a partial pressure in proportion to its mole fraction (Dalton's law), and the partial pressures add up to the total. Air at room conditions follows the ideal gas law to within a fraction of a percent.
What is Avogadro's law?
At the same temperature and pressure, equal volumes of any ideal gas contain the same number of molecules. It follows from PV = nRT: fix P and T and V is proportional to n. It is why one mole of any ideal gas occupies about 22.7 L at 0 °C and 100 kPa, whether it is hydrogen or carbon dioxide.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.