---
title: "George Li's guide to the ideal gas law"
url: "https://georgelitutoring.com/learn/ideal-gas-law-and-when-real-gases-deviate.md"
canonical_url: "https://georgelitutoring.com/learn/ideal-gas-law-and-when-real-gases-deviate"
last_updated: "2026-12-04"
type: "guide"
summary: "What each variable in PV = nRT means, which value of R goes with which units, the assumptions behind the model and original worked problems."
related: ["https://georgelitutoring.com/courses/general-chemistry.md", "https://georgelitutoring.com/tutoring/ap-and-high-school.md"]
---

# George Li's guide to the ideal gas law

> **For AI agents:** the complete index of George Li Tutoring pages is [llms.txt](https://georgelitutoring.com/llms.txt). Every page is also served as markdown at its URL plus .md.

What each variable in PV = nRT means, which value of R goes with which units, the assumptions behind the model and original worked problems.

PV = nRT links the pressure (P), volume (V), amount in moles (n) and absolute temperature in kelvin (T) of a gas, with R as the constant that makes the units agree. If you know any four of the five quantities you can solve for the fifth. The only real trap is choosing the value of R that matches your pressure and volume units.

A sealed container holds 5.00 L of gas. Its pressure is 2.00 atm and its temperature is 300. K. Find the amount of gas in moles.

1. Pick R to match the units. Atmospheres for pressure and liters for volume call for R = 0.08206 L atm per mol per K.
2. Rearrange PV = nRT for n: n = PV / (RT).
3. Substitute: n = (2.00 atm x 5.00 L) / (0.08206 x 300. K) = 10.00 / 24.618.
4. Divide: n = 0.4062 mol.

Answer: About 0.406 mol of gas.

## What does each variable in PV = nRT mean?

P is the pressure the gas pushes on its container, V is the volume of that container, n is how many moles of gas are inside, and T is the temperature on the kelvin scale. R is the same number for every ideal gas, and it carries the units that tie the other four together.

Temperature must be in kelvin. Add 273.15 to a Celsius reading. A gas at 0 degrees Celsius is at 273.15 K, and using 0 in the formula would give a nonsense answer of zero moles or zero pressure.

The equation merges four older, simpler relationships: volume against pressure at fixed temperature, pressure against temperature at fixed volume, volume against temperature at fixed pressure, and volume against amount. One equation, the ideal gas law, holds all four at once.

## Which value of R matches which units?

Match R to the units of your pressure and volume, and keep amount in moles and temperature in kelvin. The value of R in joules per mole per kelvin is exact in the current CODATA values: NIST lists 8.314 462 618... J mol^-1 K^-1, from the 2022 edition. The other common forms are that same number rewritten in different units.

| Pressure unit | Volume unit | R to use |
| --- | --- | --- |
| atm | L | 0.08206 L atm per mol per K |
| kPa | L | 8.314 kPa L per mol per K |
| Pa | m^3 | 8.314 J per mol per K |

The first row follows from the third: one atmosphere is 101.325 kPa, and 8.314 462 618 divided by 101.325 is about 0.08206. If you keep the pressure in kPa and accidentally use 0.08206, your answer is off by a factor of about 100. When a gas law answer looks wildly too large or too small, check the units of R first.

## What does the ideal gas model assume?

The ideal gas is a model, and PV = nRT holds exactly only inside it. The model treats gas molecules as points that take up no volume of their own, assumes they exert no pulls or pushes on each other between collisions, and has them bounce off one another and the walls without losing energy. Pressure then comes from those collisions with the walls, and temperature measures the average energy of motion of the molecules: each molecule's average energy of straight-line motion is 3/2 times k times T, where k is the Boltzmann constant. NIST lists that constant as 1.380 649 times 10 to the minus 23 joule per kelvin, an exact value in the current CODATA values.

Because that energy depends only on temperature, molecules of different masses have the same average energy at the same temperature, and the lighter ones move faster. Counting molecules instead of moles gives a second form of the law, PV = NkT, where N is the number of molecules. The two forms agree because R is Avogadro's number times k.

## How do the older gas laws fit inside it?

Each classic law is the ideal gas law with one or two quantities held fixed. Boyle's law holds the amount and the temperature fixed, so pressure and volume trade off, and PV stays constant. Charles's law holds the amount and the pressure fixed, so volume is proportional to temperature. Hold the amount and the volume fixed and you have Gay-Lussac's law: pressure is proportional to temperature. Avogadro's idea holds temperature and pressure fixed, so equal volumes contain equal numbers of molecules. When the amount is fixed but pressure, volume and temperature all change, divide the law for the two states and R and n cancel, which gives the combined form: P1 V1 over T1 equals P2 V2 over T2.

**Worked example: A sealed 2.00 L sample at 1.00 atm and 300. K is heated to 450. K and compressed to 2.00 atm. What is the new volume?**

Because the sample is sealed, its amount stays constant, so use the combined form and keep temperatures in kelvin.

1. Write P1 V1 / T1 = P2 V2 / T2 and solve for V2: V2 = V1 x (P1 / P2) x (T2 / T1).
2. Substitute: V2 = 2.00 L x (1.00 / 2.00) x (450. / 300.).
3. Multiply: 2.00 x 0.500 x 1.50 = 1.50.

Answer: The new volume is 1.50 L. The heating alone would raise the volume, and the doubled pressure halves it, so the net change is a decrease from 2.00 L.

Source: Original problem by George Li Tutoring; the algebra was checked in code.

## What do worked problems look like in practice?

Most problems solve for a different variable each time. The worked example above solves for n. Here are two more, both original.

Volume of a gas: how much room do 0.250 mol of gas take up at 101.3 kPa and 273.15 K? Use R = 8.314 kPa L per mol per K because the pressure is in kPa. V = nRT / P = (0.250 x 8.314 x 273.15) / 101.3, which is 567.7 / 101.3, or about 5.60 L. As a check, a mole of any ideal gas at 273.15 K and 1 atm fills about 22.4 L, and a quarter of that is 5.6 L.

Molar mass from a measurement: a 1.50 g sample of an unknown gas fills 1.00 L at 0.950 atm and 300. K. First find the moles: n = PV / RT = (0.950 x 1.00) / (0.08206 x 300.) = 0.0386 mol. Then molar mass is mass divided by moles: 1.50 g / 0.0386 mol is about 38.9 g/mol. That is the pattern for most "identify the gas" questions: get n from the gas law, then divide.

Density is one more use. Write n as mass over molar mass in PV = nRT and rearrange, and you get d = PM / (RT), where d is the density and M is the molar mass. For nitrogen, with M = 28.01 g/mol, at 273.15 K and a pressure of 1.00 atm, d = (1.00 x 28.01) / (0.08206 x 273.15), which is about 1.25 g/L. A heavier gas at the same conditions is denser, and a warmer gas at the same pressure is less dense, which is why a heated balloon rises.

A note on standard conditions. Many textbooks, including OpenStax, use 273.15 K and 1 atm, where one mole takes up about 22.4 L. IUPAC changed its definition of standard pressure from 1 atm to 1 bar in 1982, so a source that uses 1 bar will give a slightly larger molar volume. Read which definition your course uses before you plug in.

## When do real gases deviate?

Real gases stray from PV = nRT at high pressure and at low temperature. The ideal gas model treats molecules as points that never attract one another. At high pressure the molecules are crowded and their own size takes up a real share of the container, and at low temperature they move slowly enough for attractions to matter.

You can see both effects in the compressibility factor Z, which is PV divided by nRT. An ideal gas keeps Z at exactly 1 for every pressure. For a real gas it moves away from 1: attractions pull Z below 1, and molecular size pushes it above 1 at high pressure. The farther from 1, the less you should trust the ideal answer.

The usual fix is an equation named for van der Waals, which adds a pair of constants for each gas, the first for attractions and the second for the size of the molecules. In a typical general chemistry course you are asked to know why a gas deviates and in which direction, not to memorize the constants. Rules of thumb that tend to hold: a gas behaves most ideally when it is hot, at low pressure, and made of small, nonpolar molecules.

Written out, it reads (P + a n^2 / V^2) times (V - n b) = nRT. The term with a corrects the pressure for attractions: molecules pulled toward their neighbors hit the wall more softly, so the measured pressure is lower than an ideal gas would give, and a bigger a means stronger attractions. The term with b corrects the volume for the room the molecules occupy themselves, so the room left for motion is the container volume minus n times b. Each gas has its own a and b, and they are tabulated.

You can reason about direction before you calculate anything. Squeeze one mole of gas into a small container, and the b effect makes the real pressure higher than PV = nRT predicts. Cool a gas near the temperature where it condenses, and the attractions win, so the real pressure is lower. Gases with strong attractions, such as polar molecules and large molecules with many electrons, deviate sooner than small nonpolar ones such as helium. At the extreme, attractions overcome motion and the gas condenses to a liquid, which the ideal model can never do. Above a gas's critical temperature, no pressure will liquefy it, which is another place the simple picture of a gas stops being enough.

## What does the ideal gas law say about entropy?

For a course in thermodynamics, the ideal gas model also gives closed formulas for entropy. Entropy is a state function, so the change depends only on the start and the end states, and for an ideal gas with constant heat capacity the change is n times C_V times the natural log of T2 over T1, plus n times R times the natural log of V2 over V1. At constant temperature only the second term remains. Doubling the volume of 1.00 mol of ideal gas at constant temperature gives 1.00 x 8.314 x ln 2, which is about 5.76 J/K. A larger volume gives the molecules more positions to occupy, which is why the entropy rises, and compressing the gas lowers it.

If you are working through this in AP® chemistry or a high school course, the habit that saves the most points is writing the unit of R next to the number, every time. See [high school and exam prep tutoring](https://georgelitutoring.com/tutoring/ap-and-high-school.md) for how sessions are run and the [study planner](https://georgelitutoring.com/tools/study-planner.md) to place gas laws in a unit schedule. We teach the method and do not complete graded work.

### Why must temperature be in kelvin in the ideal gas law?
Because the law is built on an absolute scale where zero means no thermal motion. Celsius and Fahrenheit zeros are arbitrary, so using them gives wrong answers, including zero or negative amounts of gas.

### What is the value of R?
It depends on the units. With pressure in atmospheres and volume in liters, R is 0.08206 in liter-atmospheres per mole per kelvin; with SI units it is 8.314 joules per mole per kelvin. NIST gives the SI value as exact in the current CODATA values.

### Is the ideal gas law accurate for real gases?
It is a good approximation at low pressure and moderate to high temperature. It becomes less accurate when pressure is high or temperature is low, because molecular size and attractions start to matter.

### Why do heavier gases and polar gases deviate sooner?

Heavier molecules and polar molecules attract their neighbors more strongly, and large molecules take up more room. Both effects pull the real gas away from the model, so the deviation shows up at a lower pressure and a higher temperature than for a small nonpolar gas.

### How does the ideal gas law differ from the combined gas law?
The combined gas law compares one fixed amount of gas under two sets of conditions, so R and n cancel. The ideal gas law describes one set of conditions and includes R and n, so it can give you the amount of gas.

AP® is a trademark registered by the College Board, which is not affiliated with, and does not endorse, this site.

## Related

- [College general chemistry tutor](https://georgelitutoring.com/courses/general-chemistry.md)
- [Online AP® exam and course tutor](https://georgelitutoring.com/tutoring/ap-and-high-school.md)
