Thermodynamics

What Is the Ideal Gas Law (PV = nRT)?

Definition

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

PV = nRT

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.
PV=nRT P Pressure absolute pascals (Pa) V Volume of container n Amount not mass moles (mol) R Gas constant same for all gases 8.314 J/(mol·K) T Temperature absolute kelvin (K) Fix any three — the fourth is forced. The four boxed in navy you measure. R you look up. T you must convert.

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:

P = nRT / V · V = nRT / P · n = PV / RT · T = PV / nR

If you have a mass rather than a mole count, convert first using the molar mass M in kg/mol:

n = m / M

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:

PV = N k_B T

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.
Pressure is the time-average of molecular impacts on the wall Baseline n, V, T as given P original V Halve the volume shorter trips, twice the hits 2P Double the temperature (K) faster molecules, harder hits 2P

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.

Ideal Gas Law Lab

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.

Isotherms: P = nRT / V at three temperatures 2 5 10 1 2 Volume V (arbitrary units) Pressure P T₃ (hottest) T₂ T₁ (coldest) Along each curve, PV stays constant — that is Boyle’s law.

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:

ρ = PM / (RT)

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.

Hot-air balloon envelope heated by a burner, an everyday example of the ideal gas law lowering air density
Heating the air lowers its density at constant pressure — the ideal gas law made visible.

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:

(P + a n² / V²)(V − nb) = nRT

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:

Average kinetic energy per molecule = (3/2) k_B T

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.

Worked Problems

Problem 1
How much volume does 2.00 mol of an ideal gas occupy at 300 K and a pressure of 150 kPa?
Show Solution
Solution: Step 1: Use the ideal gas law, rearranged for volume: V = nRT / P Step 2: Convert pressure to SI. P = 150 kPa = 1.50 × 10⁵ Pa. Temperature is already in kelvin. Step 3: Substitute with units. V = (2.00 mol × 8.314 J/(mol·K) × 300 K) / (1.50 × 10⁵ Pa) V = 4988 J / 1.50 × 10⁵ Pa = 0.03326 m³ Step 4: Convert to litres. 1 m³ = 1000 L, so V = 33.3 L. Answer: V = 0.0333 m³ = 33.3 L
Problem 2
A diver at 20.0 m depth releases a bubble of volume 1.00 cm³. What is its volume at the surface? Take seawater density 1025 kg/m³, g = 9.81 m/s², atmospheric pressure 101325 Pa, and assume the temperature is unchanged.
Show Solution
Solution: Step 1: Temperature and amount are constant, so this is Boyle’s law: P₁V₁ = P₂V₂ Step 2: Find the absolute pressure at depth. Gauge pressure from the water must be added to atmospheric. P₁ = P_atm + ρgh = 101325 + (1025 × 9.81 × 20.0) P₁ = 101325 + 201105 = 302430 Pa Step 3: Solve for V₂ at the surface, where P₂ = 101325 Pa. V₂ = P₁V₁ / P₂ = (302430 Pa × 1.00 cm³) / 101325 Pa V₂ = 2.985 cm³ Answer: V₂ = 2.98 cm³ — the bubble triples in size This is why a diver must never hold their breath while ascending. Trapped lung air expands the same way.
Problem 3
A car tyre is inflated to a gauge pressure of 220 kPa at 20.0 °C. After a motorway drive the air inside reaches 55.0 °C. What is the new gauge pressure? Take atmospheric pressure as 101 kPa.
Show Solution
Solution: Step 1: Volume and moles are fixed, so P ∝ T (Gay-Lussac’s law): P₁ / T₁ = P₂ / T₂ Step 2: Convert to absolute pressure and absolute temperature. P₁ = 220 + 101 = 321 kPa (absolute) T₁ = 20.0 + 273.15 = 293.15 K T₂ = 55.0 + 273.15 = 328.15 K Step 3: Solve for P₂. P₂ = P₁ × T₂ / T₁ = 321 kPa × (328.15 / 293.15) P₂ = 321 × 1.1194 = 359.3 kPa (absolute) Step 4: Convert back to gauge pressure. P₂(gauge) = 359.3 − 101 = 258 kPa Answer: 258 kPa gauge, a rise of about 38 kPa (≈ 5.6 psi) Skip the two conversions in Step 2 and you would get 220 × (55/20) = 605 kPa — nearly triple the true rise.
Problem 4
What volume does 1.00 kg of nitrogen gas (N₂, molar mass 28.02 g/mol) occupy at 25.0 °C and 101.325 kPa?
Show Solution
Solution: Step 1: The gas law needs moles, not mass. Convert first: n = m / M Step 2: Substitute. n = 1000 g / 28.02 g/mol = 35.69 mol Step 3: Convert temperature. T = 25.0 + 273.15 = 298.15 K Step 4: Apply V = nRT / P. V = (35.69 mol × 8.314 J/(mol·K) × 298.15 K) / (101325 Pa) V = 88470 J / 101325 Pa = 0.8731 m³ Answer: V = 0.873 m³ = 873 L Sanity check: one mole of any gas occupies about 24.5 L under these conditions, and 35.69 × 24.5 ≈ 874 L. The answer holds.
Problem 5
A weather balloon holds 5.00 m³ of helium at ground level, where P = 101 kPa and T = 288 K. It rises to an altitude where P = 5.0 kPa and T = 220 K. What is its new volume?
Show Solution
Solution: Step 1: The amount of gas is fixed, so n and R cancel. Use the combined gas law: P₁V₁ / T₁ = P₂V₂ / T₂ Step 2: Rearrange for V₂. V₂ = V₁ × (P₁ / P₂) × (T₂ / T₁) Step 3: Substitute. Pressure units cancel, so kPa is fine here; temperature must still be kelvin. V₂ = 5.00 m³ × (101 / 5.0) × (220 / 288) V₂ = 5.00 × 20.2 × 0.7639 Step 4: Evaluate. V₂ = 77.15 m³ Answer: V₂ = 77.2 m³ — over 15 times its ground volume The pressure drop expands the balloon 20-fold; the temperature drop claws back about a quarter of that.
Problem 6
Calculate the density of air at 300 K and 100 kPa. Take the mean molar mass of air as 0.02896 kg/mol.
Show Solution
Solution: Step 1: Start from PV = nRT and substitute n = m / M. PV = (m / M) RT Step 2: Rearrange to isolate density ρ = m / V. ρ = PM / (RT) Step 3: Substitute in SI units. ρ = (1.00 × 10⁵ Pa × 0.02896 kg/mol) / (8.314 J/(mol·K) × 300 K) ρ = 2896 / 2494 = 1.161 kg/m³ Answer: ρ = 1.16 kg/m³ Sanity check: the standard sea-level value (288.15 K, 101.325 kPa) is 1.225 kg/m³. Our air is warmer and at slightly lower pressure, so a smaller density is exactly what we should expect.
Problem 7
A rigid 10.0 L cylinder at 300 K contains 0.50 mol of oxygen and 1.50 mol of nitrogen. Find the total pressure and the partial pressure of the oxygen.
Show Solution
Solution: Step 1: An ideal gas does not care what its molecules are. Only the total mole count matters. n_total = 0.50 + 1.50 = 2.00 mol Step 2: Convert volume to SI. V = 10.0 L = 0.0100 m³ Step 3: Apply P = nRT / V. P = (2.00 mol × 8.314 J/(mol·K) × 300 K) / 0.0100 m³ P = 4988 J / 0.0100 m³ = 4.988 × 10⁵ Pa = 499 kPa Step 4: Each gas contributes in proportion to its mole fraction (Dalton’s law). x(O₂) = 0.50 / 2.00 = 0.250 p(O₂) = 0.250 × 499 kPa = 125 kPa Answer: Total P = 499 kPa; partial pressure of O₂ = 125 kPa
Problem 8
How many molecules are in 1.00 cm³ of air at 300 K and 100 kPa? Use k_B = 1.380649 × 10⁻²³ J/K.
Show Solution
Solution: Step 1: Use the molecule-counting form of the ideal gas law: PV = N k_B T Step 2: Rearrange for N. N = PV / (k_B T) Step 3: Convert volume to SI. V = 1.00 cm³ = 1.00 × 10⁻⁶ m³ Step 4: Substitute. N = (1.00 × 10⁵ Pa × 1.00 × 10⁻⁶ m³) / (1.380649 × 10⁻²³ J/K × 300 K) N = 0.100 J / (4.142 × 10⁻²¹ J) N = 2.414 × 10¹⁹ Answer: N ≈ 2.41 × 10¹⁹ molecules Cross-check with moles: n = PV/RT = 4.01 × 10⁻⁵ mol, and multiplying by Avogadro’s number 6.022 × 10²³ gives 2.41 × 10¹⁹. The two routes agree, as they must, since R = N_A · k_B.

Frequently Asked Questions

Can I use Celsius in the ideal gas law?
No — temperature in PV = nRT must always be in kelvin. The law states that pressure is directly proportional to temperature, which is only true on an absolute scale starting at absolute zero. Using Celsius predicts zero pressure at 0 °C and negative pressure below it, which is meaningless. Convert with T(K) = T(°C) + 273.15.
What is R in the ideal gas law?
R is the universal gas constant, equal to 8.314 J/(mol·K). It is the same value for every gas, which is what makes the ideal gas law so powerful. Its numerical value changes with your choice of units — 0.08206 L·atm/(mol·K) is common in chemistry — but the physical constant is unchanged. R equals Avogadro’s number multiplied by the Boltzmann constant.
Is the molar volume of a gas always 22.4 litres?
No, and this trips up a lot of students. 22.4 L/mol applies only at 0 °C and 1 atm, an older definition of standard temperature and pressure. Using the modern IUPAC standard of 0 °C and 100 kPa, molar volume is 22.7 L/mol. At 25 °C and 1 atm it is about 24.5 L/mol. Always check which standard is meant.
What is the difference between PV = nRT and PV = NkT?
They are the same law counted two different ways. PV = nRT counts the gas in moles, n, using the molar gas constant R. PV = Nk_BT counts individual molecules, N, using the Boltzmann constant k_B. The two connect through Avogadro’s number: N = n × N_A, and R = N_A × k_B. Use moles for chemistry, molecules for statistical physics.
When does the ideal gas law fail?
The ideal gas law fails at high pressure and at low temperature, especially near the point where a gas condenses. At high pressure the molecules’ own volume is no longer negligible; at low temperature, intermolecular attractions become significant. Under ordinary conditions the error is under 1%. When accuracy matters, the van der Waals equation corrects for both effects.
Do I use gauge pressure or absolute pressure in PV = nRT?
Always absolute pressure. A pressure gauge reads the difference between the gas and the surrounding atmosphere, so a tyre showing 220 kPa actually holds air at roughly 321 kPa absolute. Convert first: P_absolute = P_gauge + P_atmospheric, taking atmospheric pressure as about 101 kPa at sea level. Forgetting this is one of the most common sources of wrong answers.
P

Written by PhysicsFundamentals Editorial Team

Articles on PhysicsFundamentalsinfo.com are researched, written, and fact-checked by our editorial team. Every piece is reviewed for accuracy before publishing, with formulas and worked examples checked against standard physics references.

View All Authors →