Van der Waals Equation Calculator
Find the pressure of a real gas with the van der Waals equation, using published a and b constants for common gases.
What it does
The ideal gas law treats molecules as points that never attract one another. That works well at low pressure, but it breaks down when a gas is squeezed or cooled. The van der Waals equation adds two correction terms that account for the behaviour of real molecules, and it remains one of the simplest equations of state that captures the difference.
The first correction concerns attraction. Molecules pull on their neighbours, and a molecule about to strike the wall is pulled back by the others. The measured pressure is therefore lower than the ideal value. The constant a has units of pressure times volume squared per mole squared, and a larger value means stronger attraction. Water vapour and ammonia have large a values, while helium and hydrogen have small ones.
The second correction concerns size. Every molecule excludes a certain volume from its neighbours, so the space available for motion is less than the volume of the container. The constant b is the excluded volume per mole, with units of volume per mole. Subtracting nb from the container volume raises the predicted pressure, which partly cancels the attraction term.
The equation was proposed by Johannes Diderik van der Waals in 1873 and earned him the 1910 Nobel Prize in Physics. The University of Calgary chemistry textbook writes it as (P + a n squared over V squared)(V - nb) = nRT, then solves for pressure as P = nRT over (V - nb) minus a n squared over V squared. That is the form this page evaluates.
Use the result as an improvement on the ideal gas law, not as a final answer for dense fluids. Near the critical point or at very high pressure, more elaborate equations of state give better values. The tool also reports the compressibility factor Z, which tells you at a glance how far the gas is from ideal behaviour.
How to use
- Pick metric units for litres and bar, or imperial units for cubic feet and psi.
- Choose a gas from the list, or choose your own constants and type in a and b from a data table.
- Enter the amount of gas in moles.
- Enter the absolute temperature in kelvins.
- Enter the volume of the container in the selected unit system.
- Read the van der Waals pressure, the ideal gas pressure, the difference between them, and the compressibility factor.
Formula
- P
- Pressure of the real gas, in bar or psi.
- n
- Amount of gas, in moles.
- R
- Gas constant, 0.083145 L bar per mol K.
- T
- Absolute temperature, in kelvins.
- V
- Container volume, in litres or cubic feet.
- a
- Attraction constant, in L2 bar per mol2.
- b
- Excluded volume constant, in L per mol.
Setting a = 0 and b = 0 reduces the equation to PV = nRT, so an ideal gas is the special case with both corrections switched off. The container volume must be larger than nb, otherwise the free volume term is not physical and the tool returns an error. Some tables quote a in kPa L squared per mole squared or in Pa m sixth per mole squared, so check the units before entering a value. The constants used here come from standard chemistry data tables and pair with R in litres and bar.
Worked example
Example: 3.46 mol of carbon dioxide at 502 K in 4.25 L
Defaults: metric units, carbon dioxide with a = 3.59 L2 bar per mol2 and b = 0.0427 L per mol, n = 3.46 mol, T = 502 K, V = 4.25 L.
- The University of Calgary worked example uses R = 0.083145 L bar per mol K for these units.
- nRT = 3.46 x 0.083145 x 502 = 144.416 L bar.
- Free volume: V - nb = 4.25 - 3.46 x 0.0427 = 4.1023 L.
- Volume correction: 144.416 / 4.1023 = 35.204 bar.
- Attraction correction: 3.59 x 3.46^2 / 4.25^2 = 3.59 x 11.9716 / 18.0625 = 2.379 bar.
- Real pressure = 35.204 - 2.379 = 32.8 bar. The ideal gas law gives 144.416 / 4.25 = 34.0 bar, a difference of 1.2 bar.
- Compressibility factor Z = 32.825 x 4.25 / 144.416 = 0.966. The tool shows 32.8 bar, 34.0 bar, 1.2 bar below ideal and 0.966.
Reference table
| Gas | a (L2 bar / mol2) | b (L / mol) | What drives the value |
|---|---|---|---|
| Carbon dioxide | 3.59 | 0.0427 | Large, polarizable molecule with sizeable attraction |
| Nitrogen | 1.43 | 0.03913 | Small nonpolar molecule with modest attraction |
| Water vapor | 5.536 | 0.03049 | Strong hydrogen bonding dominates |
| Methane | 2.283 | 0.04278 | Dispersion forces in a compact molecule |
Limits
- Accuracy falls near the critical point, where the van der Waals model predicts a critical compressibility of 0.375 while real gases sit closer to 0.27.
- The constants are fitted over limited ranges, so do not use them far outside the temperatures where they were measured.
- The equation does not describe a phase change, and it can show unphysical loops below the critical temperature.
- Mixtures need mixing rules for a and b. This page handles one pure gas at a time.
Common mistakes
- Entering Celsius or Fahrenheit instead of kelvins, which makes the pressure badly wrong.
- Mixing a table that uses bar with a gas constant written for atmospheres or pascals.
- Using a volume smaller than nb, which gives a negative free volume and no physical answer.
- Copying a from a table in Pa m sixth per mol squared into a box that expects L2 bar per mol2.
- Assuming attraction always lowers the pressure. At high density the b term can dominate and the real pressure can exceed the ideal one.
Try it yourself
Quick checks. Answers sit tucked under each question.
One mole of carbon dioxide at 273.15 K fills 0.500 L. Using a = 3.658 and b = 0.04284, what pressure does the model give?
nRT = 22.711 L bar. Free volume is 0.45716 L, so the volume term is 49.680 bar and the attraction term is 14.632 bar. Pressure is 35.0 bar, against 45.4 bar for an ideal gas, with Z = 0.772.
3.46 mol of nitrogen at 502 K in 4.25 L uses a = 1.43 and b = 0.03913. How does the result compare with ideal?
Free volume is 4.1146 L and the volume term is 35.10 bar. The attraction term is only 0.95 bar, so pressure is 34.2 bar, slightly above the ideal 34.0 bar, with Z = 1.005. Here the excluded volume wins.
An imperial reader uses 0.150087 ft3 for the same carbon dioxide example. What pressure appears?
That volume is 4.25 L, so the answer is the same state expressed in psi: 476.1 psi, against 492.8 psi ideal, with Z still 0.966.
Questions
What do the constants a and b mean?
a measure the strength of attraction between molecules, and b measures the volume excluded by the molecules themselves. Both are determined from experiment and are unique to each gas.
Why is the answer different from the ideal gas law?
The ideal gas law assumes point particles that do not interact. Real molecules attract one another and take up space, which changes the pressure at a given temperature and volume.
Can the van der Waals pressure be higher than ideal?
Yes. At high density the excluded volume correction can outweigh the attraction term, pushing the real pressure above the ideal prediction.
Which gas constant does this page use?
R = 0.083145 L bar per mol K. It pairs with volume in litres and a and b in the bar based units shown on the page.
What is the compressibility factor Z?
It is PV divided by nRT. An ideal gas has Z = 1. Values below 1 mean attraction dominates, and values above 1 mean excluded volume dominates.
Does the tool work for liquids?
No. The van der Waals equation is a rough model for dense fluids, but this page is set up for gas states with a positive free volume and does not handle liquid phases.
Sources
- University of Calgary Chemistry Textbook: The van der Waals Equation, with worked CO2 example
- Chemistry LibreTexts: Van der Waals equation and table of a and b constants