Ideal Gas Law Calculator
Enter any four of pressure, volume, moles, or temperature to solve for the fifth using PV = nRT. Two 3D diagrams compare gas at low and high temperature, and charts show how pressure and volume respond to changing conditions.
Reviewed by the ToolNestr Editorial Team — July 2026
Enter any four values to solve for the fifth.
Gas particles at low vs high temperature
1. Gas at low temperature
Particles move slower and stay closer together in the same container — lower pressure at the same volume.
2. Gas at high temperature
Particles move faster and collide with the container walls more forcefully — higher pressure at the same volume.
Ideal gas law graphs
How it works
The core idea in one line: the ideal gas law unifies Boyle's, Charles's, Avogadro's, and Gay-Lussac's laws into one equation, treating a gas as though its molecules take up negligible volume and never interact — an excellent approximation for most gases at ordinary pressures and temperatures.
PV = nRT
the ideal gas law — R = 0.08206 L·atm/(mol·K)
V = nRT / P
rearranged to solve for volume
T = PV / (nR)
rearranged to solve for temperature (must be in kelvin)
PV=nRT combines four separate historical gas laws that were each discovered by holding different variables fixed: Boyle's law (PV=constant at fixed T,n), Charles's law (V∝T at fixed P,n), Gay-Lussac's law (P∝T at fixed V,n), and Avogadro's law (V∝n at fixed P,T). R, the universal gas constant, is the proportionality factor that ties all four relationships together into a single equation valid across changing conditions.
Worked example 1 — gas volume at room temperature
Given: What volume does 2.0 moles of an ideal gas occupy at 25°C and 1.5 atm?
Converting Celsius to kelvin before substituting is essential — using 25 directly instead of 298.15 would give a badly wrong answer.
Worked example 2 — pressure inside a sealed container
Given: A rigid 10 L container holds 0.5 mol of gas at 350 K. Find the pressure.
This is exactly the kind of calculation engineers use to predict pressure buildup in a sealed vessel as temperature rises.
Molar volume at different standard conditions
The volume one mole of ideal gas occupies depends on the exact pressure/temperature reference chosen — a common source of confusion between older and IUPAC-current STP definitions.
| Condition | T | P | Molar volume |
|---|---|---|---|
| Traditional STP ★ | 273.15 K | 1 atm | 22.414 L |
| IUPAC STP (post-1982) | 273.15 K | 1 bar | 22.711 L |
| Room temperature (25°C) | 298.15 K | 1 atm | 24.465 L |
★ The traditional definition (0°C, 1 atm) is still the one most commonly used in introductory chemistry courses and this calculator's STP preset.
Where the ideal gas law actually matters
🏭 Chemical process engineering
Chemical engineers use the ideal gas law as a first approximation to design reactors, pipelines, and storage tanks, calculating gas volumes under a range of pressures and temperatures.
💨 Atmospheric science and meteorology
Understanding how pressure and temperature change with altitude — key to weather forecasting and cloud formation — relies directly on gas law relationships.
🎈 Scuba diving and pressure vessels
Divers and engineers designing pressurized tanks must account for how gas volume and pressure trade off as depth (and therefore pressure) changes, following the same PV=nRT relationship.
🧪 Stoichiometry with gaseous products
Chemistry students and researchers use the ideal gas law to convert between moles of a gaseous reactant or product and its volume under specific lab conditions.
Common misconceptions
"The ideal gas law works perfectly for any gas under any condition."
It is an approximation that breaks down at high pressure and low temperature, where intermolecular forces and the actual volume of gas molecules become significant — the van der Waals equation adds correction terms for these effects.
"You can use Celsius directly in PV=nRT."
Temperature must always be converted to kelvin first — using Celsius directly (which can be negative or zero at physically normal conditions) breaks the proportional relationship the ideal gas law depends on.
"STP always means the same fixed pressure and temperature."
STP has actually changed definition over time — older textbooks use 0°C and 1 atm (22.414 L/mol), while the modern IUPAC definition uses 0°C and 1 bar (22.711 L/mol), a small but real difference.
"Doubling pressure always doubles temperature for a fixed gas sample."
Only if volume is held constant — PV=nRT shows that pressure, volume, and temperature are all interrelated, so how one change affects another depends on which variable is actually being held fixed.
Formula sources & further reading
The formulas here are standard, traceable to:
- • OpenStax, Chemistry 2e — Chapter 9, "Gases" (free, peer-reviewed). openstax.org
- • Brown, LeMay & Bursten, Chemistry: The Central Science — Chapter 10, Gases.
- • Zumdahl & Zumdahl, Chemistry — The ideal gas law.
PV=nRT, R=0.082057 L·atm/(mol·K). Temperature must be in kelvin. Results are rounded for display.
How to use this calculator
Enter four values
Fill in any four of P, V, n, T, or use the STP/room-temperature preset buttons.
Read the fifth value
The unknown variable solves instantly using PV=nRT.
Check your units
Confirm temperature is in kelvin — a common source of calculation errors.
Related tools
Frequently asked questions
What is the ideal gas law?
The ideal gas law is PV = nRT, where P is pressure, V is volume, n is the number of moles, R is the gas constant, and T is temperature in kelvin.
What value of R should I use?
R = 0.082057 L·atm/(mol·K) when using litres, atmospheres, moles, and kelvin. R = 8.3145 J/(mol·K) applies when using SI units (m³, Pa, mol, K) instead.
When does the ideal gas law break down?
At high pressures and low temperatures, real gases deviate from ideal behavior because intermolecular forces and molecular volume become significant — the van der Waals equation provides corrections for these effects.
What is STP?
STP (Standard Temperature and Pressure) is traditionally 0°C (273.15 K) and 1 atm. At STP, one mole of an ideal gas occupies 22.414 litres — a useful reference volume in stoichiometry problems.
Why must temperature be in kelvin?
The ideal gas law requires an absolute temperature scale where zero truly means zero volume/pressure for an ideal gas — kelvin satisfies this, while Celsius (which allows negative values) does not. Convert from Celsius by adding 273.15.