Ideal Gas Law Calculator — PV = nRT for P, V, n, T
The ideal gas law, PV = nRT, is the single most-used equation in an intro physical-chemistry course. It relates the four macroscopic quantities that describe a gas — pressure, volume, amount, and temperature — through one universal constant, R. Given any three, the fourth follows.
Ideal Gas Law Calculator
Enter any three of P, V, n, T and pick which to solve for. Sig figs default to the lowest-precision input. Temperature is auto-checked against absolute zero.
Show the work
- Formula
- Substitute
- Result
Paste into Overleaf, a Jupyter Markdown cell, or Word's equation editor and it renders as an aligned three-line derivation.
Equations used
Base relation and each rearrangement:
R = 8.314 462 618 J mol⁻¹ K⁻¹ (CODATA, exact by SI). Intermediate arithmetic uses SI units (Pa, m³, mol, K); display units convert at the boundary.
The equation
where
- P is the pressure of the gas
- V is the volume it occupies
- n is the amount of substance (in moles)
- T is the absolute temperature (in kelvin)
- R is the molar gas constant, R = 8.314 462 618 J/(mol·K)
Rearranged for each variable:
- Pressure
- Volume
- Amount
- Temperature
Worked example
How much space does 1.00 mol of an ideal gas occupy at STP (0 °C, 1.00 atm)?
- n
- 1.00 mol (3 sig figs)
- T
- 0 °C = 273.15 K
- P
- 1.00 atm = 101 325 Pa (exact)
- Formula
- Substitute
- Note
The classical molar volume of an ideal gas at STP (0 °C, 1 atm) is 22.414 L/mol — matched to 4 sig figs. Post-1982 IUPAC STP (1 bar instead of 1 atm) gives 22.711 L/mol; watch which one your textbook uses.
- Result
Choosing the right R
R has the same physical value in every unit system; only the printed number changes. This calculator does its arithmetic in SI (P in Pa, V in m³, n in mol, T in K) and converts every input silently, so you never have to memorize which R to use. If you do the math by hand, keep the units consistent:
| Unit combination | R |
|---|---|
| Pa, m³, mol, K | 8.314 462 J/(mol·K) |
| kPa, L, mol, K | 8.314 L·kPa/(mol·K) |
| atm, L, mol, K | 0.082 057 L·atm/(mol·K) |
| torr, L, mol, K | 62.363 L·torr/(mol·K) |
When the ideal gas law fails
Real gases deviate from PV = nRT wherever the model’s two assumptions — negligible molecular volume and no intermolecular forces — stop holding:
- High pressure (≳ 10 atm at room temperature): molecules take up a non-trivial fraction of the container.
- Low temperature (near condensation): attractive forces pull molecules together, lowering the observed pressure below the ideal prediction.
- Highly polar or hydrogen-bonded gases (NH₃, H₂O vapor): significant intermolecular attraction even at moderate conditions.
For a first correction, use the van der Waals equation — a two-parameter fit that accounts for molecular volume (b) and attraction (a). For high-precision work, use a virial expansion or a tabulated equation of state (NIST WebBook). A real-gas calculator is on the Chemkit roadmap.
Common pitfalls
- Temperature must be in kelvin. Plugging T in °C is the single most common error. Convert first: K = °C + 273.15.
- Pressure and volume must share R’s units. The calculator normalizes internally, but doing the math by hand with
atmandmLandR = 8.314gives an answer 1000× off — the units don’t match. Pick a consistent set. - STP is ambiguous. Post-1982 IUPAC STP is 0 °C at 1 bar (22.711 L/mol); pre-1982 STP — still used in most US textbooks — is 0 °C at 1 atm (22.414 L/mol). NTP is 20 °C at 1 atm (24.06 L/mol). Read the problem carefully.
nis the amount in moles, not the number of molecules. Divide by Avogadro’s number if the problem gives you a particle count. The molar mass calculator is helpful when starting from a mass in grams.- Ideal ≠ real. For a fast sanity check, compute the compression factor Z = PV/(nRT) — if it drifts more than a few percent from 1 at your conditions, the ideal-gas approximation is stressed and you should reach for a real-gas equation.
Practice problems
Attempt each on paper, then expand the worked solution to check your arithmetic and sig-figs.
Problem 1 Easy How much space does 2.00 mol of an ideal gas occupy at STP (0 °C and 1.00 atm)?
Answer: 44.8 L
- n
- 2.00 mol
- T
- 0 °C = 273.15 K
- P
- 1.00 atm = 101 325 Pa
- Formula
- Substitute
- Note
The molar volume of an ideal gas at STP (0 °C, 1 atm) is 22.414 L/mol — so 2.00 mol occupies exactly twice that. Sig figs limited by the 3-sf inputs.
- Result
Problem 2 Easy A 3.00 L container holds gas at 300. K and 1.50 atm. How many moles are inside?
Answer: 0.183 mol
- P
- 1.50 atm = 151 988 Pa
- V
- 3.00 L = 3.00 × 10⁻³ m³
- T
- 300. K
- Formula
- Substitute
- Result
Problem 3 Intermediate 0.100 mol of O₂ is sealed in a 500. mL flask at 25 °C. What is the pressure inside, in atm?
Answer: 4.89 atm
- n
- 0.100 mol
- V
- 500. mL = 5.00 × 10⁻⁴ m³
- T
- 25 °C = 298.15 K
- Formula
- Substitute
- Note
Ideal gas is a fair approximation for O₂ at ~5 atm and room temperature — real O₂ deviates by less than 1% here. Above ~10 atm the van der Waals correction becomes non-trivial.
- Result
Problem 4 Intermediate A rigid 10.0 L tank holds 0.500 mol of gas at 2.50 atm. What is its temperature in °C?
Answer: 336 °C
- P
- 2.50 atm = 253 312.5 Pa
- V
- 10.0 L = 1.00 × 10⁻² m³
- n
- 0.500 mol
- Formula
- Substitute
- Note
Reminder: always convert the answer back to °C or °F if the question asks — but do the arithmetic in K. Plugging T in °C directly gives nonsense (and often a negative pressure).
- Result
Frequently asked questions
- What is the ideal gas law?
- The ideal gas law is PV = nRT, connecting pressure (P), volume (V), amount of substance (n, in moles), and absolute temperature (T, in kelvin) through the molar gas constant R. It is the combined form of Boyle's, Charles's, and Avogadro's laws, and it describes the behavior of gases whose particles have negligible volume and no intermolecular forces.
- When does the ideal gas law fail?
- Real gases deviate from PV = nRT at high pressure (where molecular volume matters) and low temperature near condensation (where intermolecular attractions matter). Below about 2 atm and above about 200 K the ideal-gas approximation is usually within a few percent for common gases; outside that window, use a real-gas equation of state such as van der Waals or the virial expansion.
- What is the value of R?
- The molar gas constant R = 8.314 462 618 J/(mol·K) is exact by the 2019 SI redefinition (R = N_A × k_B, both defining constants). In other unit systems it is 0.082 057 L·atm/(mol·K), 62.363 L·torr/(mol·K), or 8.314 L·kPa/(mol·K). This calculator does the arithmetic in SI (Pa, m³, mol, K) and converts your inputs internally, so you can mix units freely.
- What is STP, and how does it differ from NTP?
- STP (standard temperature and pressure) has two competing definitions. IUPAC's post-1982 STP is 273.15 K and 100 kPa (1 bar), giving a molar volume of 22.711 L/mol. The older IUPAC (pre-1982) and much of the textbook literature use 273.15 K and 1 atm (101.325 kPa), giving 22.414 L/mol. NTP (normal temperature and pressure) usually means 20 °C and 1 atm (24.06 L/mol). Always confirm which STP a problem or table intends.
Sources
- Zumdahl & Zumdahl, Chemistry, 9th ed. (2014), §5.3 — The Ideal Gas Law
- Atkins & de Paula, Physical Chemistry, 11th ed. (2018), §1B — The perfect gas
- CODATA 2018 recommended value for R, via NIST
- IUPAC Gold Book — standard conditions for gases
- NIST SP 811 (2008) — Guide for the Use of the International System of Units (pressure and temperature unit definitions)
Last updated: .