A real gas is any actual gas, as opposed to the idealized one in PV = nRT. It departs from the ideal gas law because its molecules take up space and pull on each other. The departure is small at room temperature and atmospheric pressure. It gets large at high pressure and low temperature, which is exactly where gases get compressed, liquefied and stored.
Contents
- Real gas vs ideal gas at a glance
- Why real gases deviate from ideal behavior
- The van der Waals equation
- The compressibility factor Z
- Worked example: CO2 in a half-liter container
- Where real gas behavior shows up
- FAQ
- Summary
Real gas vs ideal gas at a glance

The ideal gas is a model built on two assumptions: the molecules are points with no volume, and they never interact except in perfectly elastic collisions. No gas satisfies both. Here is how the two pictures compare.
| Property | Ideal gas | Real gas |
|---|---|---|
| Molecular volume | Zero | Finite |
| Intermolecular forces | None | Attractive at moderate distances, repulsive at close range |
| Obeys PV = nRT | At all conditions | Only at low pressure and high temperature |
| Can be liquefied | No | Yes, below its critical temperature |
| Compressibility factor Z | Exactly 1 | Varies with pressure and temperature |
| Joule-Thomson effect | None | Cools or heats on expansion |
An ideal gas could never become a liquid, because liquids exist only because molecules attract each other. The fact that you can buy liquid nitrogen is a standing refutation of the ideal model.
Why real gases deviate from ideal behavior
Two effects, and they pull in opposite directions.
Molecules have volume. Squeeze a gas hard enough and the molecules stop being a sparse cloud in empty space. The container is no longer all free room: part of it is occupied by the molecules themselves. The space each molecule can actually move in is smaller than the container volume, so the gas pushes on the walls harder than the ideal law predicts.
Molecules attract each other. Even neutral, nonpolar molecules feel weak London dispersion forces, the most common kind of van der Waals force. A molecule about to hit the wall gets tugged backward by its neighbors, so it hits with less force. Pressure comes out lower than the ideal prediction. This effect grows when molecules are slow and close together, which means low temperature and high density.
Which effect wins depends on conditions. At moderate pressure, attraction usually dominates and the gas is more compressible than ideal. At very high pressure, molecular volume dominates and the gas resists compression more than ideal. Helium and hydrogen, with very weak attractions, are dominated by the volume effect almost everywhere at ordinary temperatures.
The van der Waals equation
In 1873 Johannes van der Waals proposed a fix that earned him the 1910 Nobel Prize in Physics. He added one correction for each effect:
(P + a n²/V²)(V − nb) = nRT
Or, solved for pressure:
P = nRT/(V − nb) − a n²/V²
- b is the excluded volume per mole. Subtracting nb from V shrinks the free space the molecules move in, which raises the pressure.
- a measures the strength of attraction. The term a n²/V² is subtracted from the pressure. It scales with n²/V² because it depends on how often two molecules are near each other, which goes with the square of the concentration.
The constants are fitted per gas. Here are standard values:
| Gas | a (L²·bar/mol²) | b (L/mol) |
|---|---|---|
| Helium (He) | 0.0346 | 0.0238 |
| Nitrogen (N2) | 1.370 | 0.0387 |
| Carbon dioxide (CO2) | 3.640 | 0.0427 |
| Water vapor (H2O) | 5.536 | 0.0305 |
Read the table for what it says about the molecules. Helium’s a is tiny because helium atoms barely attract each other, which is why helium stays a gas to within 4.2 K of absolute zero. Water’s a is the largest here because of hydrogen bonding. CO2 has a bigger b than N2 because it is a larger molecule.
The equation is not exact. It misses accuracy near the critical point, and modern engineering uses more elaborate equations of state. But it captures the physics in two parameters, and it predicts that a gas can condense, which the ideal law cannot.
The compressibility factor Z
The simplest way to measure how far a gas strays from ideal is the compressibility factor:
Z = PV / nRT
For an ideal gas, Z is exactly 1 at every pressure and temperature. For a real gas, Z is the ratio of the actual PV to the ideal value, and the direction of the deviation is readable at a glance:
- Z < 1: attraction dominates. The gas is more compressible than ideal, with a molar volume smaller than the ideal law predicts.
- Z > 1: molecular volume dominates. The gas is harder to compress than ideal.
Plot Z against pressure at a fixed temperature and a common shape appears. At low pressure Z starts at 1, since every gas looks ideal when the molecules are far apart. For a gas below its Boyle temperature, Z then dips below 1 as attraction takes over, bottoms out, and climbs back through 1 and well above it as pressure rises and molecular volume wins.
The Boyle temperature is where the dip disappears. Above it, Z rises from 1 immediately and never dips. For nitrogen it is about 327 K, so at room temperature nitrogen is close to ideal across a wide pressure range. For hydrogen and helium the Boyle temperature is far below room temperature, so they show Z > 1 at once.
The practical rule: Z near 1 means you can use PV = nRT. Z far from 1 means you need something better.
Worked example: CO2 in a half-liter container
Take 1.00 mol of CO2 at 300 K in a 0.500 L container. What is the pressure according to the ideal gas law and according to van der Waals? Use R = 0.08314 L·bar/(mol·K).
Ideal gas law
P = nRT / V = (1.00 × 0.08314 × 300) / 0.500 = 49.9 bar
Van der Waals
With a = 3.640 L²·bar/mol² and b = 0.04267 L/mol:
- Repulsion term: nRT / (V − nb) = 24.94 / (0.500 − 0.04267) = 24.94 / 0.45733 = 54.5 bar
- Attraction term: a n² / V² = 3.640 / 0.250 = 14.56 bar
- P = 54.5 − 14.56 = 40.0 bar
The ideal law overshoots by almost 10 bar, about 25%. Attraction removes 14.6 bar, and the finite molecular volume adds back 4.6 bar, so attraction wins.
The compressibility factor, using the van der Waals pressure:
Z = PV / nRT = (40.0 × 0.500) / 24.94 = 0.80
Z is well below 1, which matches the diagnosis: at this density and temperature, CO2 is dominated by attraction. CO2 is also not far above its critical temperature of 304.1 K, so it is behaving like a gas on the verge of condensing.
Run the same numbers for helium and the two pressures differ by well under 1 bar’s worth of correction. Same container, same temperature, nearly ideal. That contrast is the point of the a column in the constants table.
Where real gas behavior shows up

Gas cylinders. A full industrial cylinder holds gas at roughly 150 to 200 bar. At those pressures nitrogen and oxygen have Z values slightly above or near 1, but not exactly 1, and calculating how much gas is inside from pressure alone requires a real-gas correction. Hydrogen is more extreme: in vehicle tanks at 700 bar, Z is about 1.4, so a tank holds roughly 30% less hydrogen than the ideal law would suggest.
Liquefaction. A gas can only be liquefied by pressure alone below its critical temperature. CO2’s critical point is 304.1 K (about 31 °C) and 73.8 bar, which is why a fire extinguisher or a soda syrup tank holds liquid CO2 at room temperature, while no amount of pressure will liquefy nitrogen at room temperature. Nitrogen’s critical temperature is about 126 K. NIST’s fluid property database lists critical constants and full property tables for these and other fluids.
The Joule-Thomson effect. Let a real gas expand through a valve or porous plug without exchanging heat, and its temperature changes. For most gases at room temperature it drops, because the molecules do work against their mutual attraction as they spread apart. An ideal gas would not change temperature at all. This effect is the basis of the Linde process used to liquefy air, and of household refrigeration cycles. There is a catch: above a gas’s inversion temperature, expansion heats it instead. Nitrogen’s inversion temperature is about 621 K, so it cools at room temperature. Hydrogen’s is about 200 K and helium’s is about 40 K, so both warm when expanded from room temperature. This is why hydrogen leaking from a high-pressure line can heat up rather than cool down.
The critical point. Past the critical temperature and pressure, the distinction between liquid and gas disappears. The result is a supercritical fluid, which dissolves things like a liquid and flows like a gas. Supercritical CO2 is what strips caffeine from coffee beans.
FAQ
What is the difference between a real gas and an ideal gas? An ideal gas has point-sized molecules with no attraction between them and obeys PV = nRT exactly. A real gas has molecules with finite size that attract each other, so it follows the ideal law only approximately.
When does a real gas behave like an ideal gas? At low pressure and high temperature. Under those conditions molecules are far apart and moving fast, so volume and attraction both matter little.
Why do real gases deviate more at low temperature? Slower molecules spend more time near each other, so the attractive forces have more effect on the pressure.
What does Z > 1 mean? The gas is harder to compress than an ideal gas. Molecular volume dominates over attraction, which typically happens at very high pressure or for weakly attracting gases such as hydrogen and helium.
What do a and b mean in the van der Waals equation? a measures how strongly the molecules attract each other. b is the volume that a mole of molecules excludes from the container.
Which gas is closest to ideal? Helium, followed by hydrogen. They have the weakest intermolecular attractions and the smallest molecules, so they hold to PV = nRT over the widest range.
Summary
Real gases differ from ideal gases for two reasons: their molecules have volume, and they attract each other. The ideal gas law is a good approximation at low pressure and high temperature and fails as gases get dense and cold. The van der Waals equation corrects for both effects with the constants a and b, and the compressibility factor Z tells you at a glance which effect dominates. In the CO2 example, the ideal law predicted 49.9 bar and van der Waals predicted 40.0 bar, with Z = 0.80. The same non-ideal behavior explains why gases liquefy, why expanding gases cool, and why a 700 bar hydrogen tank holds less than the ideal law promises.

