Gas Law Calculator
Solve PV = nRT for pressure, volume, moles, or temperature.
What it does
The ideal gas law ties the four measurable gas variables into one equation: pressure times volume equals moles times R times absolute temperature. Fix any three and the fourth follows by rearrangement.
The tool above solves for whichever variable you pick. Enter the other three in kPa, liters, moles, and kelvin; R runs fixed at 8.314 L·kPa per mol per K.
The default solves pressure for 1 mol in 22.71 L at 273.15 K: exactly 100 kPa, the modern STP definition point. The same inputs rearranged give 22.71 L, 1 mol, or 273.2 K in the other modes.
R follows the NIST CODATA exact value with the same classroom rearrangements in OpenStax Chemistry. Both use kelvin throughout, since Celsius offsets break the proportionality.
How to use
- Pick which variable to solve for first.
- Enter the other three values in the shown units.
- Convert any Celsius to kelvin before entering.
- Read the answer with the rearranged form beside it.
- Flip modes to cross check the same state.
Formula
- P / V
- Kilopascals and liters of the gas state.
- n / T
- Moles and absolute kelvin.
- R
- 8.314 L·kPa per mol per K, exact.
Ideal behavior assumed: point particles with no forces. High pressures and near condensation need van der Waals corrections outside this page.
Worked example
Example: 1 mol, 22.71 L, 273.15 K
Solve pressure with defaults.
- nRT: 1 x 8.314 x 273.15 = 2270.97.
- Divide: 2270.97 / 22.71 = 100.00.
- Result: 100 kPa, the STP definition pressure.
- Reverse: 100 x 22.71 / (8.314 x 273.15) = 1 mol back.
- Tool shows 100 kPa, P = nRT / V.
Reference table
| Units | R value | Use with |
|---|---|---|
| L·kPa / mol / K | 8.314 | This page |
| L·atm / mol / K | 0.08206 | Atmosphere work |
| L·torr / mol / K | 62.36 | Vacuum gauges |
| J / mol / K | 8.314 | Energy form |
Limits
- Ideal gas only; dense and cold gases deviate.
- Kelvin required; Celsius entries corrupt answers.
- Single pure gas assumed; mixes need partial pressures.
- Reactions changing moles need stoichiometry beside it.
Common mistakes
- Entering Celsius instead of kelvin.
- Mixing atm pressures with the 8.314 R.
- Using milliliters with liter based R.
- Solving for T and reporting Celsius directly.
- Applying ideal math inside condensation ranges.
Try it yourself
Quick checks. Answers sit tucked under each question.
V for 2 mol at 100 kPa, 273.15 K?
2 x 8.314 x 273.15 / 100 = 45.42 L.
n at 100 kPa, 22.71 L, 273.15 K?
100 x 22.71 / (8.314 x 273.15) = 1 mol.
T for 1 mol, 100 kPa, 22.71 L?
100 x 22.71 / 8.314 = 273.2 K.
Questions
What is PV = nRT?
The ideal gas law: pressure times volume equals moles times R times kelvin.
What is R?
8.314 L·kPa per mol per K (exact). Other unit pairs use 0.08206 or 62.36.
Why kelvin?
Gas laws scale with absolute temperature. 0 C is 273.15 K, and ratios need that base.
What is STP?
273.15 K and 100 kPa modern definition, where 1 mol fills 22.71 L.
When does it fail?
High pressure, low temperature, and polar gases deviate toward van der Waals behavior.
How do gas mixes work?
Each gas follows its partial pressure; sum them for the total (Dalton law).