The ideal gas law: PV=nRT and where it breaks
Four variables — pressure, volume, moles, temperature — bind by one equation:
R is 8.314 462 618 J K⁻¹ mol⁻¹ in SI units (CODATA 2018), or 0.082 057 L atm K⁻¹ mol⁻¹ in bench units. Every gas obeys this law at low pressure and moderate temperature, and every gas breaks it as the molecules get close enough to feel each other. This guide walks the derivation from kinetic theory, the four consequences (Boyle, Charles, Avogadro, and the combined-gas law), the two failure modes, and the van der Waals correction that patches most of the damage.
If you have not read stoichiometry: how to think in moles, the mole is the currency this whole equation trades in. The ideal gas calculator drills the arithmetic once you understand the pieces.
Where PV = nRT comes from
Kinetic theory makes three assumptions about a gas:
- Molecules are points — their volume is negligible compared to the container’s.
- They do not interact except in perfectly elastic collisions.
- Their speeds follow the Maxwell-Boltzmann distribution at temperature T.
From those three, the pressure on a wall is the momentum flux of molecular collisions:
where N/V is number density, m is molecule mass, and ⟨v²⟩ is mean-squared speed. The Maxwell-Boltzmann distribution gives ⟨v²⟩ = 3k_B T/m, and substitution collapses everything to PV = Nk_B T. Divide N by Avogadro’s number to get moles n, and Nk_B becomes nR:
The two “unknowns” in a gas problem are always among P, V, n, T. Any three fix the fourth.
Boyle, Charles, Avogadro — three special cases
Holding two of the four variables constant recovers three named laws that predate PV=nRT by two centuries:
Boyle’s law (1662). At constant T and n: PV = constant. Halve the volume, double the pressure. This is the isothermal slice of the equation.
Charles’s law (1787). At constant P and n: V/T = constant. Volume grows linearly with absolute temperature; extrapolating V to zero gives T = 0 K, one of the earliest hints at absolute zero.
Avogadro’s law (1811). At constant P and T: V/n = constant. Equal volumes of any gas at the same P and T contain equal numbers of molecules. At standard temperature and pressure (273.15 K, 100 kPa) this constant is 22.711 L/mol (IUPAC 1982 STP); at the older 1 atm STP definition it is 22.414 L/mol. Cite the STP definition you are using — the difference matters at the third significant figure.
Combining any two of the three gives the “combined gas law” P₁V₁/n₁T₁ = P₂V₂/n₂T₂, which is nothing more than PV=nRT applied twice with R canceling.
Worked example — filling a weather balloon
- Formula
- Substitute
- Note
At sea level the same 500 mol occupies nRT/P = 12.0 m³. At altitude the pressure drops by a factor of 8.4 and temperature by 25%, so volume grows by 8.4 × (220/293) = 6.3-fold to 76 m³ — a fact balloon designers plan around: fill the balloon only partly on the ground, so it can expand freely as it rises.
- Result
The result depends only on cruise conditions and n. That is the strength of the equation of state: pick any three of (P, V, n, T), and the fourth is fixed at any point along the trajectory.
Two ways to write R — pick the units first
Chemistry students lose more marks to R-unit mismatches than to any other single arithmetic slip. The two useful values are:
- R = 8.314 462 618 J K⁻¹ mol⁻¹ — use with P in pascals (Pa) and V in cubic metres (m³).
- R = 0.082 057 366 L atm K⁻¹ mol⁻¹ — use with P in atmospheres and V in litres.
- R = 62.363 6 L Torr K⁻¹ mol⁻¹ — use with P in torr and V in litres.
All three are the same constant expressed in different unit systems. If you set up PV=nRT with P in kPa and V in litres, R = 8.314 works numerically, because kPa · L = J. Write out the units under every substitution. If they do not cancel to give J, atm·L, or torr·L on both sides, the answer is wrong before the arithmetic runs.
The two failure modes
Real gases break PV=nRT in two directions, and the direction depends on which of the kinetic-theory assumptions gives way first:
Failure 1 — molecular volume matters (high pressure). Kinetic theory treats molecules as points. Compress a gas until each molecule’s exclusion volume is a non-trivial fraction of the container, and there is less free space than V suggests. Pressure at fixed n and T rises faster than the ideal law predicts. This is the dominant deviation above roughly 10 atm.
Failure 2 — molecules attract each other (low temperature). Real molecules have dispersion, dipole, and hydrogen-bond attractions. When these are comparable to kT, molecules linger near each other, slowing their approach to the wall and reducing the pressure they generate. Pressure at fixed n, V, T falls below the ideal prediction. This is the dominant deviation near the boiling point of the gas.
The compressibility factor Z = PV/nRT is the diagnostic:
- Z = 1 → ideal.
- Z > 1 → molecular volume dominates (high P, high T).
- Z < 1 → attractive forces dominate (low T, moderate P).
Every real gas passes through Z < 1 as it is cooled toward its boiling point, then back through Z = 1, and finally to Z > 1 as it is compressed hard enough. NIST WebBook tabulates Z(T,P) for every common gas.
The van der Waals correction
Johannes van der Waals (Nobel Prize 1910) patched both failures with two constants a and b:
- The a term subtracts the pressure reduction from intermolecular attractions. Larger a = stickier gas (H₂O has a = 5.54 L²·atm/mol², N₂ only 1.37).
- The b term subtracts the excluded volume from V. Larger b = bulkier molecule (CO₂ has b = 0.0429 L/mol, He only 0.0237).
For engineering pressures below ~50 atm and temperatures above 200 K, van der Waals gets Z correct to within a few percent for most small molecules. For higher pressures or near critical points, the more accurate Peng-Robinson or Redlich-Kwong equations of state come into play — but the interpretation is identical: two corrections to PV=nRT, one for volume, one for attraction.
The critical point — where the correction stops working
Every gas has a critical temperature T_c above which no amount of pressure will liquefy it (above T_c, molecular kinetic energy exceeds the attractive well). At the critical point, ∂P/∂V = 0 and ∂²P/∂V² = 0 simultaneously; the van der Waals equation yields:
Below T_c, condensation happens as P is raised. Above T_c, the gas simply compresses further. This is the reason CO₂ (T_c = 304 K, room temperature is 293 K) is easy to liquefy in a cylinder, but O₂ (T_c = 154 K) needs cryogenics.
Common pitfalls
Forgetting to convert Celsius. T in PV=nRT is always absolute (kelvin). A temperature written in °C substituted directly is the most common single error in gas calculations.
Mixing pressure units mid-problem. Convert everything to one unit (kPa, atm, torr) before starting.
Ignoring vapor pressure in gas-collection-over-water problems. When a gas is collected over water, the measured pressure is P_gas + P_water,vapor. At 25 °C the water partial pressure is 3.17 kPa (23.76 torr) — not negligible.
Using STP loosely. IUPAC 1982 STP is 273.15 K, 100 kPa (V_m = 22.711 L/mol). Older textbooks use 273.15 K, 1 atm (V_m = 22.414 L/mol). Always state which.
Assuming ideal behaviour near a boiling point. A gas whose T is close to its boiling temperature will show 10-20% deviation from PV=nRT. Water vapor at 100 °C, ammonia at −33 °C, CO₂ at −78 °C — none of these obey the ideal law well enough to use for a titration calculation.
Practice
Problem 1 Easy A 2.50 L rigid vessel contains 0.120 mol N₂ at 25 °C. What is the pressure in kPa?
Answer: 118.9 kPa. P = nRT/V = (0.120)(8.314)(298.15)/(2.50 × 10⁻³) Pa = 1.189 × 10⁵ Pa. Note the volume conversion to m³.
Problem 2 Intermediate A weather balloon holds 15.0 mol He at ground level (293 K, 101 kPa). It rises to an altitude where T = 240 K and P = 30 kPa. Assuming ideal behaviour, what is the new volume?
- Formula
- Substitute
- Note
Volume nearly triples: pressure drops 3.4× (which expands the gas) and temperature drops 18% (which contracts it), net a ~2.7× expansion.
- Result
Problem 3 Hard At 300 K and 100 atm, N₂ has an experimentally measured molar volume of 0.244 L/mol. What is the compressibility factor Z, and which failure mode dominates?
Answer: Z = PV/nRT = (100 atm)(0.244 L)/((1 mol)(0.08206 L atm K⁻¹mol⁻¹)(300 K)) = 0.991. Slightly below 1, so attractive forces still dominate at 100 atm and 300 K — N₂ is close to but just past the crossover. At 500 atm the same calculation gives Z > 1 as the excluded-volume term takes over.
Where this leads
The ideal gas law is a foundation, not a finish line. Three roads lead off from here:
- Kinetic theory of gases — deriving diffusion, effusion (Graham’s law), and thermal conductivity from the same collision picture.
- Phase behaviour — extending gas thermodynamics through condensation, using the phase diagrams guide as the entry point.
- Real-gas equations of state — van der Waals, Peng-Robinson, and the virial expansion, all patches on the same core equation.
Every one of them starts by writing PV=nRT and asking what has to change.
Sources
- Atkins & Jones, Chemical Principles, 7th ed. (2016), Ch. 4
- Silberberg, Chemistry: The Molecular Nature of Matter and Change, 8th ed. (2018), Ch. 5
- Zumdahl, Chemistry, 10th ed. (2017), Ch. 5
- NIST Chemistry WebBook (SRD 69) — real-gas P-V-T data for N₂, CO₂, H₂O
- CODATA 2018 recommended values — R = 8.314 462 618 J K⁻¹ mol⁻¹
- van der Waals (1873), Nobel lecture 1910 — equation of state derivation