Ideal Gas Law Calculator (PV = nRT) | STP Calculator
Solves the ideal gas law PV = nRT for pressure, volume, temperature, or moles. Enter three known values to find the fourth, with STP conditions explained.
STP Calculator
Calculate pressure, volume, temperature or moles using the Ideal Gas Law.
P = nRT/V
P = (1 × 0.082057 × 273.15) ÷ 22.4
About the Ideal Gas Law
The ideal gas law is a fundamental equation in chemistry and physics that describes the behavior of gases under various conditions.
PV = nRT
- P is pressure (in atmospheres, atm)
- V is volume (in liters, L)
- n is the number of moles of gas
- R is the gas constant (0.082057 L·atm/(mol·K))
- T is temperature (in Kelvin, K)
Documentation
STP Calculator: Ideal Gas Law (PV = nRT)
An ideal gas law calculator finds the pressure, volume, temperature, or amount of a gas using the equation PV = nRT. A person enters any three of the four values, and the calculator solves for the one that is missing.
What is STP?
STP stands for Standard Temperature and Pressure. It is a fixed reference point used in chemistry so gas measurements from different experiments can be compared on equal terms. This calculator defines STP as 0°C (273.15 K) and 1 atmosphere (atm) of pressure. One atmosphere is 101 325 Pa. Some references instead use 0°C and 100 kPa (1 bar), so a stated STP value should always be checked against its definition.
The ideal gas law formula
The ideal gas law is:
PV = nRT
Each letter stands for one property of the gas:
- P is pressure, in atmospheres (atm)
- V is volume, in liters (L)
- n is the amount of gas, in moles (mol)
- T is temperature, in kelvin (K)
- R is the gas constant. This calculator uses R = 0.08206 L·atm/(mol·K), the molar gas constant of 8.314 462 618 J/(mol·K) expressed in liter-atmospheres and rounded
Temperature must be in kelvin for the equation to work. The calculator asks for temperature in Celsius and converts it internally by adding 273.15 (K = °C + 273.15).
How to calculate pressure, volume, temperature, or moles
The equation can be rearranged to solve for whichever value is unknown.
- Pressure: P = nRT / V
- Volume: V = nRT / P
- Temperature: T = PV / (nR), then the result in kelvin is converted back to Celsius
- Moles: n = PV / (RT)
To use the calculator, pick which value to find, then fill in the other three fields. Pressure, volume, and moles must each be greater than zero. Temperature must be above absolute zero, -273.15°C.
Example: finding pressure at STP
A gas sample has 1 mole (n = 1), a volume of 22.4 liters (V = 22.4 L), and a temperature of 0°C, which equals 273.15 K.
P = nRT / V P = (1 × 0.08206 × 273.15) / 22.4 P = 1.0007 atm
The result lands close to 1 atm, which is expected: one mole of an ideal gas occupies 22.414 liters at 273.15 K and 101.325 kPa. At 100 kPa the figure is 22.711 liters.
Example: finding volume
A gas sample has 1 mole (n = 1), a pressure of 1 atm, and a temperature of 25°C, which equals 298.15 K.
V = nRT / P V = (1 × 0.08206 × 298.15) / 1 V = 24.4662 L
The volume is larger than at STP because the temperature is higher.
Where the formula comes from
The ideal gas law combines older gas laws. Boyle's law describes how pressure and volume change together when temperature stays fixed. Charles's law describes how volume and temperature change together when pressure stays fixed. Avogadro's law describes how volume changes with the amount of gas when pressure and temperature stay fixed. Combining the three gives PV = nRT.
When the ideal gas law is accurate
The ideal gas law treats gas particles as points that do not pull on or push away from each other. Real gases only act this way under certain conditions. The formula works best at low pressure and high temperature, away from the point where a gas would turn into a liquid. At very high pressure or very low temperature, real gas behavior drifts from the formula, so the results become less exact.
Common uses
Chemistry students use the ideal gas law to check textbook and lab problems. Lab workers use it to relate the pressure, volume, and temperature of a gas sample during an experiment. Engineers use it for rough estimates in tasks such as sizing gas storage or predicting how a gas volume changes with temperature.
Frequently asked questions
What is the gas constant R?
R is 0.08206 L·atm/(mol·K) when pressure is measured in atmospheres and volume in liters.
Does the calculator take temperature in Celsius or kelvin?
It takes Celsius. The calculator converts the value to kelvin automatically before solving the equation.
Why must temperature be above -273.15°C?
-273.15°C, or 0 K, is absolute zero, the coldest temperature that can exist. The ideal gas law is not defined below it.
What is Standard Temperature and Pressure (STP)?
STP is 0°C (273.15 K) and 1 atm. It gives scientists a shared reference point for comparing gas measurements.
How many liters does one mole of gas occupy at STP?
About 22.4 liters at 0°C and 1 atm. With this calculator's R = 0.08206 L·atm/(mol·K), the result is 22.4147 L.
Can pressure, volume, or moles be zero or negative?
No. A gas sample cannot have zero or negative pressure, volume, or amount, so the calculator requires each of these three fields to be greater than zero.
References
- NIST. CODATA Value: standard atmosphere. Standard atmosphere — 1 atm = 101 325 Pa (exact).
- NIST. CODATA Value: molar gas constant. Molar gas constant — R = 8.314 462 618 J/(mol·K), exact.
- NIST. CODATA Value: molar volume of ideal gas (273.15 K, 101.325 kPa). Molar volume at 101.325 kPa — 22.413 969 54 × 10⁻³ m³/mol.
- NIST. CODATA Value: molar volume of ideal gas (273.15 K, 100 kPa). Molar volume at 100 kPa — 22.710 954 64 × 10⁻³ m³/mol.
- NASA Glenn Research Center. Equation of State. Equation of State — Boyle's law and Charles and Gay-Lussac's law combine into the ideal gas equation of state.