Skip to content
Chemistry

The Ideal Gas Law and Kinetic Theory

Pressure and temperature feel fundamental — but they are only bookkeeping for trillions of molecules flying in straight lines and bouncing off the walls.

10 min read·July 10, 2026

f(v)v
On this page

A pressure gauge is a collision counter#

Push a bicycle pump and you feel the air push back. Warm a sealed can and the pressure climbs until it bursts. Pressure and temperature behave like solid, fundamental properties of a gas — things it simply has, the way it has a colour or a smell.

They are not. There is nothing in a gas but molecules, mostly empty space, and motion. A litre of air at room conditions holds about 2.5×10222.5 \times 10^{22} molecules, each one flying in a straight line until it slams into another molecule or into a wall, then flying off in a new straight line. Nothing is coordinated. Nothing is aimed. And yet out of that chaos comes a pressure gauge reading that holds steady to four decimal places.

The trick is that pressure and temperature are not new things at all. They are bookkeeping — averages over an unimaginable number of tiny mechanical events. Pressure is the summed patter of molecules drumming on a wall. Temperature is how fast, on average, those molecules are moving. Once you accept that, everything a gas does falls out of counting collisions. The famous ideal gas law PV=nRTPV = nRT is not a law handed down from above; it is the arithmetic of trillions of elastic bounces, and this article derives it from exactly that.

The rules of the game#

Kinetic theory earns its clean answers by making a short list of deliberately harsh assumptions. A gas is idealised as a swarm of molecules obeying just four rules:

  • They are points. The molecules are so small compared with the space between them that their own volume is negligible. At room conditions the average gap between air molecules is about ten times their diameter, so the gas is mostly vacuum.
  • They do not interact at a distance. Between collisions there are no attractive or repulsive forces. A molecule travels in a perfectly straight line, feeling nothing, until it makes contact.
  • All collisions are elastic. When two molecules hit, or a molecule strikes a wall, no kinetic energy is lost — it is only redirected. This is what lets the motion continue forever without the gas "running down".
  • They are numerous and random. There are enough molecules, moving in enough directions, that only statistical averages matter. No single molecule's fate changes the reading on a gauge.

Every one of these is a lie, but a productive one. Real molecules have size, do attract each other, and a gas does eventually reach thermal equilibrium with its surroundings. But over the enormous range of everyday pressures and temperatures the lies are almost true, and the reward for telling them is that the entire behaviour of a gas becomes calculable with nothing more than Newton's laws and some averaging. We will collect the debt owed to reality at the end, when we look at where real gases part company with the ideal.

This molecular picture is the same one that quietly underpins neighbouring subjects: it is what heats and stalls a thermometer during phase transitions, and it is the population of speeds that decides how many collisions clear the barrier in reaction kinetics. Get the gas right and both of those inherit it.

Watching pressure emerge from bounces#

The box on the left holds a fixed number of molecules — one species, so every mass is identical. They start with a spread of velocities and bounce elastically off all four walls, one of which is a movable piston that sets the volume. The panel on the right does the bookkeeping live: it counts every wall impact, adds up the momentum each one delivers, and turns that running total into a measured pressure. There are no forces and no fields in the simulation; the pressure bar is built purely from collisions.

Press play and watch the pressure reading settle. It jitters — of course it does, since each impact is a discrete little kick — but it hovers around a steady value. That steadiness out of randomness is the whole phenomenon: a macroscopic pressure is the time-average of a storm of microscopic bounces.

Now drag the temperature up. Every molecule speeds up (notice the fast ones turning gold), the impacts land harder and more often, and the pressure bar climbs. Temperature did nothing but make the molecules move faster, and pressure rose all by itself. Then drag the volume up — the piston slides out, the same molecules now have farther to travel between wall hits, the impacts on any given patch of wall thin out, and the pressure falls.

Keep your eye on the two numbers at the bottom of the panel: P·V (measured from the impacts) and N·k_BT (computed from how fast the molecules are moving). They track each other no matter how you push the sliders. That agreement, appearing on screen from two completely independent computations, is the ideal gas law — and the next section shows why it has to be there.

The math: from a single bounce to PV = nRT#

Pressure is momentum delivered per second#

Take one molecule of mass mm heading toward a wall with an xx-velocity vxv_x. It hits the wall and bounces back elastically, so its xx-velocity reverses to vx-v_x. The momentum it handed to the wall is the change in its own momentum:

Δp=mvx(mvx)=2mvx\Delta p = m v_x - (-m v_x) = 2 m v_x

How often does it come back for another hit? In a box of side length LL, it must travel across and back, a distance 2L2L, which takes a time 2L/vx2L / v_x. So this one molecule delivers momentum to that wall at an average rate

2mvx2L/vx=mvx2L\frac{2 m v_x}{2L / v_x} = \frac{m v_x^2}{L}

Force is momentum delivered per unit time, so that is the average force from a single molecule. Sum over all NN molecules and divide by the wall's area A=L2A = L^2 to get pressure. Writing vx2\overline{v_x^2} for the average of vx2v_x^2 over the whole population:

P=Nmvx2LA=Nmvx2VP = \frac{N m \overline{v_x^2}}{L \cdot A} = \frac{N m \overline{v_x^2}}{V}

since LA=L3=VL \cdot A = L^3 = V. Motion is random and has no preferred direction, so the three axes share the speed equally: vx2=vy2=vz2\overline{v_x^2} = \overline{v_y^2} = \overline{v_z^2}, and because v2=vx2+vy2+vz2\overline{v^2} = \overline{v_x^2} + \overline{v_y^2} + \overline{v_z^2}, each one equals 13v2\tfrac{1}{3}\overline{v^2}. Substituting gives the central result of kinetic theory:

P=13NVmv2P = \frac{1}{3}\frac{N}{V}\,m\,\overline{v^2}

Pressure is set by three things and nothing else: how many molecules you have, how much room they have, and how fast they are moving. No forces, no chemistry — just counting momentum transfer, exactly what the widget was doing.

The profound step: temperature is kinetic energy#

Rearrange that result so the molecular kinetic energy appears explicitly:

PV=13Nmv2=23N(12mv2)PV = \frac{1}{3}N m \overline{v^2} = \frac{2}{3}N\left(\tfrac{1}{2}m\overline{v^2}\right)

The quantity 12mv2\tfrac{1}{2}m\overline{v^2} is the average translational kinetic energy of a molecule. Now lay this beside the experimental ideal gas law, written per molecule with Boltzmann's constant kBk_B (where nR=NkBnR = N k_B):

PV=NkBTPV = N k_B T

Two expressions for the same PVPV can only agree if

12mv2=32kBT\tfrac{1}{2}m\overline{v^2} = \tfrac{3}{2}k_B T

This is one of the most important sentences in physical science, so read it slowly. The left side is pure mechanics — the average kinetic energy of a molecule. The right side is temperature. They are equal. Temperature is not a substance a gas contains, not an abstract label on a dial. Temperature is, to a constant factor, the average kinetic energy of molecular motion. A hot gas is a fast gas; a cold gas is a slow gas; and absolute zero is the temperature at which molecular motion would cease entirely. The factor 32\tfrac{3}{2} counts the three directions a molecule can move, each contributing 12kBT\tfrac{1}{2}k_B T — the equipartition of energy.

Assembling the law#

With that identification the ideal gas law is no longer an empirical fit; it is assembled from parts we have already justified. Start from the kinetic pressure, insert the temperature identity, and collect molecules into moles:

P=13NVmv2      12mv2=32kBT      PV=NkBT=nRTP = \frac{1}{3}\frac{N}{V}m\overline{v^2} \;\;\xrightarrow{\;\frac{1}{2}m\overline{v^2}=\frac{3}{2}k_BT\;}\;\; PV = N k_B T = n R T

The gas constant R=NAkB=8.314 Jmol1K1R = N_A k_B = 8.314\ \mathrm{J\,mol^{-1}K^{-1}} is just Boltzmann's constant scaled up from one molecule to a mole. Every historical gas law is now a special case read off a single equation: hold TT fixed and P1/VP \propto 1/V (Boyle); hold PP fixed and VTV \propto T (Charles); hold VV fixed and PTP \propto T (Gay-Lussac). They were discovered separately over a century and a half. Kinetic theory shows they were always the same statement about bouncing molecules, seen from three angles.

A gas is not one speed — it is a distribution#

The identity 12mv2=32kBT\tfrac{1}{2}m\overline{v^2} = \tfrac{3}{2}k_B T pins down the average kinetic energy, but it says nothing about how the speeds are spread around that average — and they are spread widely. A tempting mistake is to imagine that at a given temperature every molecule trundles along at the same speed. It could not possibly work that way: molecules are constantly colliding and trading energy, so one moment's fast molecule is the next moment's slow one. What survives all that shuffling is not a single speed but a stable statistical shape, the Maxwell–Boltzmann distribution:

f(v)=4π(m2πkBT)3/2v2emv2/2kBTf(v) = 4\pi \left(\frac{m}{2\pi k_B T}\right)^{3/2} v^2\, e^{-m v^2 / 2 k_B T}

It rises from zero (no molecule is truly motionless for long), peaks at a typical speed, and trails off in a long high-speed tail. Three different "average" speeds fall out of it, and they are genuinely different numbers:

vp=2kBTm  <  vˉ=8kBTπm  <  vrms=3kBTmv_p = \sqrt{\frac{2 k_B T}{m}} \;<\; \bar{v} = \sqrt{\frac{8 k_B T}{\pi m}} \;<\; v_\mathrm{rms} = \sqrt{\frac{3 k_B T}{m}}

The most probable speed vpv_p marks the peak; the mean speed vˉ\bar v is a little higher because the tail drags the average right; and the root-mean-square speed vrmsv_\mathrm{rms} is higher still, because squaring weights the fast molecules most. It is vrmsv_\mathrm{rms} that connects back to energy, since 12mvrms2=32kBT\tfrac{1}{2}m v_\mathrm{rms}^2 = \tfrac{3}{2}k_B T exactly.

The curve shows the distribution for the selected gas, with all five gases drawn faintly behind it and the three characteristic speeds marked in gold, blue, and violet.

Press Heat and watch the curve as the temperature sweeps up. It does two things at once: it slides to the right (molecules get faster) and it flattens and spreads (the range of speeds widens). Area is conserved — there are always the same number of molecules — so a taller, narrower cold curve trades for a shorter, broader hot one. The high-speed tail, in particular, fattens dramatically, which is exactly the population that drives chemical reactions.

Now hold the temperature fixed and click through the gases, from H₂ up to CO₂. Every one of these is at the same temperature, so every one has the same average kinetic energy — yet the distributions sit in wildly different places. Hydrogen's curve is far to the right and sprawling; carbon dioxide's is a tall spike jammed against the axis. The reason is the temperature identity read backwards: equal kinetic energy 12mv2\tfrac{1}{2}m\overline{v^2} with a larger mass mm forces a smaller v2\overline{v^2}. Quantitatively vrms1/mv_\mathrm{rms} \propto 1/\sqrt{m}, so the lightest molecule, H₂, moves about 44/24.7\sqrt{44/2} \approx 4.7 times faster than the heaviest, CO₂, at the very same temperature.

Why hydrogen leaves and where the ideal law breaks#

That 1/m1/\sqrt{m} scaling has a spectacular consequence written across the sky. To escape Earth's gravity a molecule needs about 11 kms111\ \mathrm{km\,s^{-1}}. No molecule in the upper atmosphere is typically that fast — but the Maxwell–Boltzmann tail never quite reaches zero, so there is always a tiny fraction out past escape velocity, and they leak away into space. Because light molecules sit so much farther to the right, that fraction is vastly larger for them. Hydrogen and helium are light enough that Earth cannot hold onto them over geological time; they trickle out of the top of the atmosphere and are lost, which is why the air you breathe is almost entirely the heavier nitrogen and oxygen, and why helium for balloons has to be mined from underground rather than gathered from the air. The Moon, with weaker gravity and a lower escape speed, lost essentially everything. Jupiter, massive and cold, kept even its hydrogen. A planet's atmosphere is, in the end, a filter set by the tail of a speed distribution.

The other place the ideal picture frays is closer to home: squeeze a gas hard, or cool it toward its condensation point, and PV=nRTPV = nRT starts to lie. Both of our founding assumptions are to blame. Molecules are not really points — at high pressure the space they themselves occupy becomes a noticeable fraction of the container, so the free volume is smaller than VV. And molecules do attract each other — as they crowd together those attractions pull them inward, softening the impacts on the wall and lowering the pressure below the ideal value. Johannes van der Waals patched both leaks in 1873 with two correction terms:

(P+an2V2)(Vnb)=nRT\left(P + \frac{a n^2}{V^2}\right)(V - n b) = n R T

Here bb is the volume actually taken up by a mole of molecules (fixing the point-particle lie), and aa measures the strength of their mutual attraction (fixing the no-interactions lie). Set aa and bb to zero — pretend molecules are sizeless and aloof — and the equation collapses straight back to PV=nRTPV = nRT. The corrections are exactly the reintroduced debts we deferred at the start, and they do more than tidy up decimals: the same attractions encoded in aa are what let a gas condense into a liquid at all, which is where the story hands off to phase transitions.

Key takeaways
  • Pressure and temperature are not primitive properties — they are averages over molecular motion. Pressure is momentum delivered to the walls per second, giving P=13NVmv2P = \tfrac{1}{3}\tfrac{N}{V}m\overline{v^2} straight from counting elastic bounces.
  • Temperature is motion: 12mv2=32kBT\tfrac{1}{2}m\overline{v^2} = \tfrac{3}{2}k_B T. Combined with the pressure result, this assembles the ideal gas law PV=nRTPV = nRT from mechanics alone, and makes Boyle's, Charles's, and Gay-Lussac's laws three views of one equation.
  • A gas at a fixed temperature does not share one speed. The Maxwell–Boltzmann distribution gives a broad spread with distinct most-probable, mean, and rms speeds; temperature sets the shape of that whole curve, not a single value.
  • At equal temperature all gases have equal average kinetic energy, so lighter molecules must move faster (vrms1/mv_\mathrm{rms} \propto 1/\sqrt{m}). The high-speed tail of the light gases is why Earth loses its hydrogen and helium to space.
  • Real gases deviate at high pressure and low temperature because the ideal model ignores molecular volume and attraction; the van der Waals equation adds those two terms back, and the attraction term is what ultimately lets a gas condense.
Check your understanding
1. Two flasks at the same temperature hold hydrogen and carbon dioxide respectively. How do the average kinetic energies and the average speeds of the molecules compare?
2. A common misconception is that the molecules in a gas at a given temperature all move at the same speed. What does kinetic theory actually say?
3. Real gases deviate from PV = nRT most strongly at high pressure and low temperature. Which pair of neglected effects does the van der Waals equation reintroduce to correct this?
0 / 3 answered

Share this article

Share on X