The ideal gas law states that the pressure of a gas multiplied by its volume equals the number of moles times the universal gas constant times the absolute temperature: PV = nRT. It ties four state variables together, so fixing any three fixes the fourth. Temperature must always be in kelvin, and pressure must be absolute.
Leave a bag of crisps in a car on a hot afternoon and it comes back looking ready to burst. Nothing was added. No one pumped it up. The sealed air inside simply got hotter, and hotter air pushes harder.
That puffed-up bag is the ideal gas law doing its work in a car park. The same equation sizes the airbag in your steering column, lifts a weather balloon fifteen times its ground volume, and tells a diver why holding your breath on the way up is the one thing you must never do.
What Is the Ideal Gas Law?
Picture a gas as a swarm of molecules rattling around inside a container. You cannot track any single one of them. But you can measure four things about the swarm as a whole: how hard it pushes (pressure), how much room it has (volume), how many molecules there are (moles), and how fast they are moving on average (temperature).
The ideal gas law is the statement that these four numbers are not independent. Lock three of them down and the fourth has no choice.
That is a remarkable claim. It means you do not need to know what the gas is — helium, nitrogen, carbon dioxide, the air in your lungs. At everyday pressures and temperatures they all obey the same equation, to within a percent or two.
An ideal gas is the idealisation that makes this work: molecules with no volume of their own, which do not attract one another, and which bounce off the walls and each other without losing energy. Real gases are not quite that. They are close enough that the law runs almost every calculation in engineering thermodynamics.
The Ideal Gas Law Formula: What Every Symbol Means
Each symbol carries a unit, and the units are where marks are lost. Here is the SI set:
- P — absolute pressure, in pascals (Pa). Not gauge pressure.
- V — volume of the container, in cubic metres (m³).
- n — amount of substance, in moles (mol). Not mass.
- R — the universal (molar) gas constant, 8.314 J/(mol·K).
- T — absolute temperature, in kelvin (K). Never Celsius.
The anatomy of the ideal gas law: four state variables and one universal constant.
Rearranging the ideal gas law
You will almost never be asked for the equation in the form it is written. Divide through for whichever variable the question wants:
If you have a mass rather than a mole count, convert first using the molar mass M in kg/mol:
You can also skip moles entirely and count molecules. Swap n and R for the molecule number N and the Boltzmann constant kB = 1.380649 × 10⁻²³ J/K:
The two forms are the same statement. The link is Avogadro’s number: R = NA · kB. One counts in moles, the other counts one molecule at a time.
If you would rather not push the algebra by hand, our Ideal Gas Law Calculator solves for any of the four variables and shows the working line by line.
The value of R depends on your units
R is universal in the sense that it is the same for every gas. Its number still changes with the units you feed it.
Since the 2019 revision of the SI, R has an exact value: it is defined as Avogadro’s number multiplied by the Boltzmann constant, and both of those are now exact by definition. You can look the figure up in NIST’s CODATA constants database.
Pick the row that matches your pressure and volume, and the conversion takes care of itself.
| Value of R | Units | Use it when |
|---|---|---|
| 8.314 | J/(mol·K) | P in pascals, V in m³. The always-safe SI choice. |
| 8.314 | kPa·L/(mol·K) | P in kilopascals, V in litres. Same number, because 1 J = 1 kPa·L. |
| 0.08206 | L·atm/(mol·K) | P in atmospheres, V in litres. Common in chemistry. |
| 0.08314 | L·bar/(mol·K) | P in bar, V in litres. |
| 62.36 | L·Torr/(mol·K) | P in Torr or mmHg, V in litres. Vacuum work. |
In practice: memorise only 8.314 J/(mol·K), then convert your pressure to pascals and your volume to cubic metres. One number, one habit, no lookup table.
Engineers often use a different constant again. Divide R by the molar mass of a specific gas and you get a specific gas constant — about 287 J/(kg·K) for dry air — which lets you work in kilograms instead of moles.
That version is not universal; it changes from gas to gas. NASA’s Glenn Research Center sets out both forms side by side.
How the Ideal Gas Law Works: Pressure Is a Storm of Collisions
Where does pressure actually come from? Not from the gas “pressing” in any deliberate way. It comes from molecules hitting the wall and bouncing off.
Each impact reverses a molecule’s momentum, and by Newton’s second law a change in momentum over a time interval is a force. One molecule delivers a force far too small to notice. A cubic centimetre of air contains around 2.4 × 10¹⁹ of them, each striking billions of times a second.
Average that hail of impacts over the wall area and you get something perfectly steady: pressure.
Now the three levers become obvious.
- Squeeze the volume. The same molecules have less distance to cover between walls, so they arrive more often. Collision rate doubles, pressure doubles.
- Raise the temperature. Temperature is the average kinetic energy of the molecules. Hotter means faster, so they hit more often and hit harder.
- Add more gas. More molecules, more impacts per second, more pressure. Linearly.
Why PV = nRT looks the way it does: pressure rises when molecules hit the wall more often, or harder.
Notice that the equation contains no property of the gas itself — no molecular mass, no size, no chemistry. Heavier molecules move more slowly at a given temperature, so they hit less often but each hit carries more punch.
The two effects cancel exactly. That cancellation is the whole reason a single R works for every gas.
Play with the three sliders below. Watch what happens to the pressure readout when you halve the volume, and then when you double the kelvin temperature.
The Four Gas Laws Hiding Inside PV = nRT
Long before anyone wrote PV = nRT, experimenters were pinning down one relationship at a time. Robert Boyle got there first, in 1660, by squeezing air in a J-shaped tube.
Every one of those historical laws is just PV = nRT with two variables held still. You do not need to memorise four equations. You need to memorise one, and know what is being held constant.
| Law | Held constant | Relationship | Everyday example |
|---|---|---|---|
| Boyle’s law | n, T | P ∝ 1/V P₁V₁ = P₂V₂ |
A diver’s bubble swelling as it rises |
| Charles’s law | n, P | V ∝ T V₁/T₁ = V₂/T₂ |
A balloon shrinking in the freezer |
| Gay-Lussac’s law | n, V | P ∝ T P₁/T₁ = P₂/T₂ |
Tyre pressure climbing on the motorway |
| Avogadro’s law | P, T | V ∝ n V₁/n₁ = V₂/n₂ |
Blowing up a party balloon |
| Combined gas law | n only | P₁V₁/T₁ = P₂V₂/T₂ | A weather balloon climbing through the atmosphere |
The combined gas law in that last row is the workhorse. Whenever a fixed amount of gas moves from one state to another, R and n cancel, and you never need to look up a constant at all.
Plot pressure against volume at three fixed temperatures and Boyle’s law draws itself: each curve is a hyperbola, PV = constant. Heat the gas and the whole curve is pushed outward.
Ideal gas law isotherms. Curves never cross, and none of them ever touches an axis.
Real-World Examples of the Ideal Gas Law
1. Tyre pressure on a long drive
Your tyres hold a fixed volume of a fixed amount of air. Drive for an hour and friction with the road heats that air by 30 °C or more.
Volume and moles are pinned, so pressure has nowhere to go but up — by roughly 5 to 6 psi. This is exactly why manufacturers tell you to check pressures cold. Problem 3 below runs the numbers.
2. Hot-air balloons
Rearrange the ideal gas law in terms of density, using molar mass M:
At constant pressure, density falls as temperature rises. Fire the burner, the air inside the envelope thins out, and the balloon floats on the denser cold air around it. No gas is added — the same air is simply spread thinner.
3. Weather balloons that swell as they climb
A radiosonde balloon leaves the ground perhaps only partly filled, looking limp. By 30 km up, the outside pressure has fallen to little more than 1% of its sea-level value.
The gas inside expands to match. Fifteen-fold growth is routine, and the balloon eventually bursts — which is the plan. Problem 5 works a case through.
4. Airbags
An airbag inflates in about 30 milliseconds. A chemical reaction dumps a known number of moles of nitrogen into a known volume, and PV = nRT is what tells the designer how much propellant produces the right pressure. Too little and the bag is slack; too much and the bag itself does the injuring.
5. Breathing
Your diaphragm pulls down and your chest cavity expands. Volume goes up, so at constant temperature the pressure inside your lungs drops below atmospheric — and air flows in.
Boyle’s law, roughly twenty thousand times a day, for free.
When the Ideal Gas Law Breaks Down
The ideal gas law is an approximation, and it is an unusually good one. Under ordinary conditions — room temperature, around one atmosphere — most gases obey it to better than 1%.
It fails in two situations, and both trace back to assumptions the model made.
- High pressure. We assumed molecules have no volume of their own. Squeeze a gas hard enough and the molecules themselves take up a real fraction of the container, so the free volume is smaller than V. Real pressure comes out higher than predicted.
- Low temperature. We assumed molecules ignore each other. Slow them down and weak intermolecular attractions start to matter, pulling molecules away from the walls. Real pressure comes out lower than predicted.
Near the point where a gas is about to condense, both effects bite at once and the law can be badly wrong. That is why steam tables exist, and why refrigerant engineers do not use PV = nRT.
The usual first repair is the van der Waals equation, which adds one term for molecular volume and one for attraction:
Here a and b are constants measured for each specific gas. Notice what that means: the universality is gone. You have traded the elegance of one equation for every gas in exchange for accuracy in one gas.
Common Misconceptions About the Ideal Gas Law
Misconception 1: “You can use Celsius if you’re consistent”
No. This is the single most common error, and it is not a rounding issue — it produces nonsense.
The law says pressure is proportional to temperature. At 0 °C a gas plainly has pressure, but plugging in T = 0 predicts zero pressure. Worse, a gas at −10 °C would have negative pressure.
Only an absolute scale, starting at absolute zero, makes the proportionality true. Always convert: T(K) = T(°C) + 273.15. The kelvin is defined for exactly this reason, and the distinction between what a thermometer reads and what the molecules are doing is worth keeping straight — see our guide to heat versus temperature.
Misconception 2: “P is whatever the gauge says”
A tyre gauge reading 220 kPa does not mean the air inside is at 220 kPa. Gauges read the difference from atmospheric pressure.
The true absolute pressure is about 220 + 101 = 321 kPa. Feed 220 into PV = nRT and every answer after that is wrong.
The rule: Pabsolute = Pgauge + Patmospheric.
Misconception 3: “n is the mass of the gas”
n counts particles, not kilograms. Two grams of hydrogen and two grams of oxygen contain wildly different numbers of molecules, and the gas law cares only about the count.
Convert with n = m / M. A student slip worth watching for: molar mass in the SI form of the equation must be in kg/mol, not g/mol. Nitrogen gas is 0.02802 kg/mol, not 28.02.
Misconception 4: “R is different for every gas”
R is the same for helium, argon, methane and air: 8.314 J/(mol·K). That is the whole point of the word “universal”.
What confuses people is the specific gas constant, Rspecific = R / M, which engineers use to work in kilograms. That one genuinely does change from gas to gas.
If a textbook writes “R = 287 J/(kg·K)”, look at the units — per kilogram, not per mole. It is a different constant wearing the same letter.
How the Ideal Gas Law Relates to Heat, Energy and Thermodynamics
PV = nRT is an equation of state. It describes where a gas is, not how it got there — a snapshot, not a film.
The film is supplied by the laws of thermodynamics. The first law tracks the energy bookkeeping as a gas is compressed or heated; the ideal gas law tells you what P, V and T are at each moment along the way. Together they let you compute the work done by an expanding gas, which is how every engine is analysed.
Kinetic theory supplies the bridge downward, to molecules. Combining it with the gas law gives one of the most quietly profound results in physics:
Temperature is not a substance and not a fluid. It is, up to a constant, the average kinetic energy of a molecule. A nitrogen molecule at 300 K is travelling at about 517 m/s — faster than a rifle bullet.
One thing PV = nRT cannot tell you is how much heat it takes to warm the gas. That depends on how the molecules store energy internally, which is the domain of specific heat capacity. The gas law fixes the state; the heat capacity fixes the price of changing it.