Thermodynamics · Clapeyron, 1834
Squeeze it, warm it, add more of it: the gas keeps the same bargain.
Ideal gas law calculator
\(PV = nRT\), with \(R = 8.314\,462\,618\ \mathrm{J\,mol^{-1}K^{-1}}\). Fill any three boxes and leave the one you want blank. Everything is converted to SI internally, so you can mix atmospheres with litres and degrees Celsius.
- Pressure P
- —
- Volume V
- —
- Amount n
- —
- Temperature T
- —
What is the ideal gas law?
A gas has no shape of its own. It fills whatever container you put it in, and while it is in there it pushes outwards on the walls. That push is the pressure.
Four things about a trapped gas turn out to be tied together. How hard it pushes, how much room it has, how much gas there is, and how hot it is. Change one and at least one of the others has to move.
Most of it matches what you have already noticed. Squash a balloon into half the space and the pressure inside doubles. Leave a football outside on a cold night and it goes soft, because cooling the air inside drops the pressure. Pump more air in and the pressure climbs, which is the whole business of a bicycle pump.
The ideal gas law is those observations written as one short equation, PV = nRT. The R in the middle is just a fixed number that makes the units agree. Give the calculator above any three of the four quantities and it works out the missing one.
How do you use PV = nRT?
The law combines three older ones. Boyle found that pressure and volume are inversely related at fixed temperature, \(PV = \text{constant}\). Charles found that volume rises in proportion to absolute temperature at fixed pressure. Avogadro added that equal volumes of any gas, at the same pressure and temperature, contain equal numbers of molecules. Put them together and you get
\[ PV = nRT, \]
with \(P\) in pascals, \(V\) in cubic metres, \(n\) in moles, \(T\) in kelvin, and the gas constant \(R = 8.314\ \mathrm{J\,mol^{-1}K^{-1}}\).
Two habits keep you out of trouble. Temperature must be absolute, in kelvin, because the law says volume goes to zero as \(T\) does, and that statement only makes sense from absolute zero. Using Celsius here is the single most common mistake in the whole topic. Second, the units of \(R\) must match the units of everything else, which is why this calculator converts your input to SI before touching the equation.
For a change of state with a fixed amount of gas, the constants cancel and you get the combined form
\[ \frac{P_1 V_1}{T_1} = \frac{P_2 V_2}{T_2}, \]
which is usually the fastest way to answer questions like what happens to the pressure in a car tyre as it heats up on a motorway. At standard temperature and pressure (273.15 K and 100 kPa) one mole of any ideal gas occupies 22.71 litres, a number worth remembering as a sanity check on an answer.
Kinetic theory, real gases and the limits of ideality
Where the equation comes from
Kinetic theory derives it rather than fitting it. Treat the gas as point particles in random motion with no interactions except elastic collisions, count the momentum delivered to a wall per unit time, and you get \(PV = \tfrac{1}{3}Nm\langle v^2\rangle\). Comparing that with \(PV = Nk_BT\) identifies temperature with mean kinetic energy, \(\tfrac{1}{2}m\langle v^2\rangle = \tfrac{3}{2}k_BT\), which is the equipartition result for three translational degrees of freedom. The macroscopic gas constant and the microscopic Boltzmann constant are then the same thing at different scales, \(R = N_A k_B\), and since the 2019 SI redefinition both are exact by definition rather than measured.
The assumptions, and what breaks them
Ideality assumes molecules occupy no volume and do not attract each other. Both fail as a gas is compressed or cooled towards condensation. Van der Waals patched the equation in 1873 with two parameters, \(\left(P + \frac{an^2}{V^2}\right)(V - nb) = nRT\), where \(b\) is the excluded volume of the molecules themselves and \(a\) accounts for the attraction that reduces the pressure felt at the wall. The correction is enough to produce a critical point and a liquid-vapour transition, which the ideal law can never do, and it won van der Waals the 1910 Nobel Prize. More accurate work uses the virial expansion, \(\frac{PV}{nRT} = 1 + B(T)/V_m + C(T)/V_m^2 + \dots\), where the compressibility factor \(Z\) measures the departure from ideality directly.
How good is the approximation
Better than its reputation suggests. For air at room temperature and atmospheric pressure, \(Z\) sits within a fraction of a percent of 1, because the mean spacing between molecules is roughly ten times their diameter and the intermolecular potential is negligible at that range. It degrades where you would expect: near condensation, at high pressure, and for polar molecules like water vapour whose attractions are strong. The Boyle temperature, where the first virial coefficient vanishes, marks the point at which a real gas mimics an ideal one most closely over an extended pressure range.
Why it matters beyond the lab
The same relation underpins the barometric formula for how atmospheric pressure falls with altitude, the adiabatic lapse rate that governs whether air parcels rise or sink, and the efficiency analysis of every heat engine that runs on a gas. It also sets the scale for stellar structure calculations: the interior of the Sun, despite densities above that of water, is well described as an ideal gas because it is fully ionised and hot enough that thermal energy swamps the electrostatic interactions.
Related: Entropy · The Periodic Table · or go back to all topics.