Van der Waals Real Gas Calculator
How far this gas is from ideal, and which correction is doing it
The ideal gas equation assumes molecules have no size and no attraction for one another. Van der Waals put both back: b subtracts the volume the molecules themselves occupy, a subtracts the pressure their mutual attraction costs. The compressibility factor Z = PVm/RT says how far the result has moved from 1, and the useful question — which of the two corrections is winning at your pressure and temperature — is what this page is built to answer.
Compressibility factor of a real gas
carbon dioxide at 20 atm and 25 °C
Two corrections to PV = nRT, one for size and one for stickiness
- b
- the excluded volume per mole, in L mol−1: the space the molecules themselves occupy and into which other molecules cannot go. It is subtracted from the volume, because the free volume a molecule can move in is less than the container’s. Subtracting it makes the pressure larger, so this term pushes Z above 1
- a
- the attraction parameter, in L2 atm mol−2. A molecule about to hit the wall is pulled back by the ones behind it, so the measured pressure is less than it would otherwise be. The correction goes as 1/Vm2 because it depends on pairs of molecules meeting, and the chance of that goes as the square of the density. This term pushes Z below 1
- Z
- the compressibility factor, PVm/RT. Exactly 1 for an ideal gas at every pressure, so its departure from 1 is a direct measure of non-ideality and its sign says which correction is in charge. Z = 0.8 means the gas occupies 80% of the volume PV = nRT predicts
- Tc, Pc, Vc
- the critical constants, which fall straight out of a and b because the critical point is where the cubic has a triple root. That is the real achievement of this equation: two parameters fitted to gas behaviour predict the point at which the liquid and the gas become indistinguishable. Above Tc no pressure will liquefy the gas
- TB
- the Boyle temperature, a/Rb, at which the two corrections cancel over a wide range of low pressures and the gas obeys PV = nRT far better than it has any right to. For hydrogen it is about 112 K, which is below room temperature — and that is why hydrogen’s Z rises above 1 straight away at 25 °C instead of dipping first
Worked example
carbon dioxide at 20 atm and 25 °C
THE CONSTANTS. For CO2, a = 3.59 L2 atm mol−2 and b = 0.0427 L mol−1. T = 25 + 273.15 = 298.15 K, and RT = 0.082 057 366 × 298.15 = 24.4654 L atm mol−1.
WHAT IDEAL WOULD GIVE. Vm = RT/P = 24.4654 / 20 = 1.22327 L/mol. Hold on to that number; everything after this is the correction to it.
SOLVE THE REAL EQUATION. (P + a/Vm2)(Vm − b) = RT is a cubic in Vm, and this page solves it in closed form rather than by iterating, because iteration stalls near the critical point. The gas-branch root is Vm = 1.110 55 L/mol — 9.2% less than the ideal volume.
THE COMPRESSIBILITY FACTOR. Z = PVm/RT = 20 × 1.110 55 / 24.4654 = 0.907 86. Using PV = nRT here would overstate the volume by about 10%, which matters for a gas cylinder and not for a school laboratory at one atmosphere.
WHICH CORRECTION DID IT? Split Z − 1 into its two pieces. Repulsive: b/(Vm − b) = 0.0427/1.067 85 = +0.039 99. Attractive: −a/(RTVm) = −3.59/(24.4654 × 1.110 55) = −0.132 13. They sum to −0.092 14, and 1 − 0.092 14 = 0.907 86, which is Z. The attractive term is 3.3 times the repulsive one, so a is winning.
WHEN WOULD b WIN? Push the pressure up. At 500 atm the same gas has Vm = 0.058 49 L/mol, so b/(Vm − b) = +2.71 while −a/(RTVm) = −2.51, and Z = 1.195. The crossover happens because the repulsive term grows faster than the attractive one as the volume shrinks: one goes as roughly 1/(V − b) and the other only as 1/V.
Van der Waals constants, and what they predict
| Gas | a | b | Tc from 8a/27Rb | Pc from a/27b² | Boyle T, a/Rb | Z at 100 atm and 298 K |
|---|---|---|---|---|---|---|
| helium, He | 0.0341 | 0.02370 | 5.20 K | 2.25 atm | 17.5 K | 1.0921 |
| hydrogen, H2 | 0.244 | 0.0266 | 33.1 K | 12.8 atm | 111.8 K | 1.0746 |
| nitrogen, N2 | 1.39 | 0.0391 | 128.4 K | 33.7 atm | 433.2 K | 0.9578 |
| oxygen, O2 | 1.36 | 0.0318 | 154.4 K | 49.8 atm | 521.2 K | 0.9174 |
| methane, CH4 | 2.25 | 0.0428 | 189.8 K | 45.5 atm | 640.7 K | 0.8116 |
| carbon dioxide, CO2 | 3.59 | 0.0427 | 303.6 K | 72.9 atm | 1024.6 K | 0.3217 |
| ammonia, NH3 | 4.17 | 0.0371 | 405.8 K | 112.2 atm | 1369.8 K | 0.2125 |
| chlorine, Cl2 | 6.49 | 0.0562 | 417.0 K | 76.1 atm | 1407.3 K | 0.3122 |
Carbon dioxide at 25 °C, as the pressure is raised
| Pressure | Z | Molar volume | Ideal molar volume | Which correction is winning |
|---|---|---|---|---|
| 1 atm | 0.99573 | 24.3610 L/mol | 24.4654 L/mol | attraction, but barely — the gas is ideal to half a per cent |
| 10 atm | 0.95585 | 2.33853 L/mol | 2.44654 L/mol | attraction; Z is 4% below 1 |
| 20 atm | 0.90786 | 1.11055 L/mol | 1.22327 L/mol | attraction, three times the excluded-volume term |
| 100 atm | 0.32165 | 0.078693 L/mol | 0.244654 L/mol | attraction, overwhelmingly — but CO2 is below its critical temperature here and a real sample would be liquid |
| 500 atm | 1.19538 | 0.058491 L/mol | 0.048931 L/mol | excluded volume; the curve has crossed back through Z = 1 |
| 1000 atm | 2.18956 | 0.053568 L/mol | 0.024465 L/mol | excluded volume, by a wide margin |
What a and b actually represent, and how to read a Z curve
The ideal gas equation makes two assumptions, and van der Waals repaired them one at a time. The first is that molecules are points with no volume. They are not, so the space a molecule can actually move around in is the container’s volume minus the volume its companions occupy: Vm becomes Vm − b. The second is that molecules do not attract one another. They do, so a molecule on its way to the wall is pulled back by the ones behind it and hits with less momentum than it otherwise would. The measured pressure is therefore less than the ideal pressure, and the shortfall is added back as a/Vm2.
Why the square? Because the pull on a wall-bound molecule is proportional to how many molecules are nearby, and the number of such encounters per unit volume is proportional to the density as well. Two factors of density, hence 1/Vm2. That the correction is a pair effect is the physical content of the exponent, and it is a fair exam question.
The two corrections point opposite ways, and that is the whole story of a Z curve. Start at low pressure and Z is 1: the molecules are so far apart that neither their size nor their attraction matters. Raise the pressure and the attractive term bites first, because the gas is still dilute enough that b is negligible beside Vm while pairs of molecules are already close enough to feel one another. Z falls below 1 — the gas is easier to compress than an ideal gas. Keep going and the molecules are packed close enough that their own volume is a serious fraction of the container, the b term takes over, Z climbs back through 1 and keeps rising. Every gas does this; what differs is where the minimum sits and how deep it is.
Temperature decides the depth. The attractive term in Z carries a 1/T — the faster the molecules are going, the less a tug from a neighbour deflects them — while the excluded-volume term does not depend on temperature at all. So warming a gas flattens the dip and eventually removes it. At the Boyle temperature, a/Rb, the two cancel over a wide span of low pressures and the gas obeys PV = nRT unusually well. For nitrogen that is 433 K, comfortably above room temperature, which is why nitrogen dips at 25 °C. For hydrogen it is about 112 K, well below room temperature, which is why hydrogen’s Z climbs above 1 from the very start and never dips at all. The same fact shows up in refrigeration: a gas expanding through a throttle cools only if it starts below its inversion temperature, and hydrogen and helium famously warm instead, which is why they have to be pre-cooled before they can be liquefied.
The equation’s real triumph is the critical point. Set the first and second derivatives of P with respect to Vm to zero and the cubic acquires a triple root, giving Tc = 8a/27Rb, Pc = a/27b2 and Vc = 3b. Two parameters fitted to how a gas deviates from ideality then predict the temperature above which it cannot be liquefied by any pressure whatsoever — and they get it right to within a few per cent for most gases. The model is not perfect: it insists that Z at the critical point is 3/8 = 0.375 for every substance, where real gases cluster around 0.27. But a two-parameter equation that predicts a phase transition at all is a remarkable object, and it is why this equation is still taught.
Two honest limits on what this page does. First, below the critical temperature the cubic has three real roots, and this page takes the largest, which is the gas branch. Where the substance would really be a liquid, that root is a smooth mathematical continuation and not a state anything occupies; extracting the actual condensation pressure needs the Maxwell equal-area construction, which is beyond what a single number can report. Second, the ideal case itself is not rebuilt here: if what you want is PV = nRT, or Boyle’s and Charles’s laws, use the combined gas law and PV = nRT in the physics plugin. This page exists to say how far from that answer the truth lies.
Frequently asked questions
What does a compressibility factor of 0.9 mean in plain terms?
That the gas occupies 90% of the volume PV = nRT says it should, at that pressure and temperature. Equivalently, you would need 10% more gas than the ideal equation predicts to fill a cylinder to a given pressure. Z below 1 always means the gas is more compressible than ideal, which is the signature of attraction; Z above 1 means less compressible, the signature of the molecules’ own volume.
Why does a vary so much more between gases than b?
Because b is about size and a is about stickiness, and molecular sizes are all within a factor of two or three of each other while intermolecular attractions vary enormously. Helium is a small, spherical, barely polarisable atom with a = 0.034; chlorine is bigger and far more polarisable, with a = 6.49, nearly two hundred times larger. Their b values differ by only a factor of 2.4. That is also the order of liquefiability: a big a means a high critical temperature and a gas that condenses easily.
Is a gas with Z above 1 behaving badly?
No more badly than one with Z below 1 — it is simply on the other side of its own minimum. Every gas gets there if you push hard enough. Hydrogen and helium are above 1 at room temperature from the very start, because their attractions are so weak that the excluded-volume term wins immediately; their Boyle temperatures, 112 K and 17 K, are below room temperature. Cool hydrogen to 50 K and it dips below 1 like everything else.
Why does this page ask for pressure rather than volume?
Because pressure and temperature are what you actually know, and the classic plot is Z against P. The cost is that the van der Waals equation is cubic in volume, so finding Vm from P needs a root rather than a substitution. This page solves the cubic in closed form; the row labelled “pressure recomputed from the molar volume” puts the answer back into the equation and should return the pressure you typed to the last digit, which is there so you can see that the solver has not quietly failed.
Which gas is closest to ideal at room temperature and pressure?
Helium, and it is not close. At 1 atm and 298 K helium’s Z is 1.000 91 while carbon dioxide’s is 0.995 73 — both within half a per cent, which is why school laboratories never need any of this. Push to 100 atm and the ordering stays but the gap opens enormously: helium is at 1.09, carbon dioxide at 0.32. Non-ideality is a property of the conditions as much as of the gas.
Does van der Waals’ equation predict liquefaction?
Yes, and that is why it mattered. Below Tc the pressure-volume isotherm develops a wiggle with three roots, and the flat horizontal line of real condensation is recovered by drawing it where the two areas the wiggle encloses are equal — the Maxwell construction. The middle root, where pressure rises with volume, is mechanically unstable and never observed; the outer two correspond to the coexisting liquid and vapour. This page reports only the largest root and warns you when the conditions put you in that region.
Related calculators
References
- P. Atkins, J. de Paula and J. Keeler, Atkins’ Physical Chemistry, Oxford University Press. The standard undergraduate treatment of colligative properties, of the van der Waals equation and of the compressibility factor, including the derivation of the critical constants from a and b and the definition of the Boyle temperature. Cited from the printed text; no online copy was fetched.
- CODATA 2022 recommended values of the fundamental physical constants, NIST Standard Reference Database 121. R = 8.314 462 618 153 24 J mol−1 K−1 is exact in the 2019 SI, because the kelvin and the mole are defined through the Boltzmann and Avogadro constants. In litre-atmospheres, R = 8.314 462 618 153 24 / 101 325 = 0.082 057 366 08 L atm mol−1 K−1, and that division is exact too, because the standard atmosphere is defined as exactly 101 325 Pa. The NIST wallet-card PDF would not load when this page was written on 14 November 2026, so the value is quoted from the 2019 SI definitions rather than from a fetched copy of the table.
- Chemistry, Textbook for Class XI, Part II, Unit “States of Matter”, NCERT, New Delhi. The school-level treatment of real gases: the compressibility factor, the shape of the Z-against-P curve, the meaning of the a and b corrections and the critical constants. Cited from the printed syllabus text; the online copy was not fetched when this page was written on 14 November 2026, so the a and b values used here are the standard handbook set given in the table above rather than NCERT’s own, and they differ in the third figure for some gases.
- J. D. van der Waals, Over de Continuïteit van den Gas- en Vloeistoftoestand (On the continuity of the gaseous and liquid state), doctoral thesis, Leiden, 1873, and the Nobel Prize in Physics 1910 awarded “for his work on the equation of state for gases and liquids”. Cited for provenance; the original was not consulted in preparing this page.
