About the Van der Waals Equation Calculator
This van der Waals equation calculator solves the most widely taught real-gas equation, (P + an²/V²)(V − nb) = nRT, for pressure, volume or temperature. Pick a gas from the built-in list — helium, nitrogen, carbon dioxide, water vapor, methane and more — or enter your own a and b constants, then supply the other three variables. The result is shown next to the ideal-gas answer, along with the compressibility factor Z, so you can see exactly how far the real gas departs from ideal behaviour.
It is meant for general and physical chemistry students, and for engineers making quick estimates of gas behaviour at high pressure or low temperature, where the ideal gas law can be off by 10% or more. Solving for volume means solving a cubic equation; the calculator does this exactly and reports the vapor-like root, plus the liquid-like root when three real roots exist below the critical temperature.
Built-in constants are the CRC Handbook values in L²·bar/mol² and L/mol. Pressures can be entered in atm, bar, kPa, psi or mmHg and temperatures in °C, K or °F; everything is converted internally using R = 0.08314462618 L·bar/(mol·K).
How to use the van der waals equation calculator
- 1Choose the gas, or select custom and enter a and b.
- 2Choose whether to solve for pressure, volume or temperature.
- 3Pick your pressure and temperature units.
- 4Enter the amount of gas and the two remaining known values.
- 5Compare the van der Waals answer with the ideal value and Z.
Formula and method
The van der Waals equation corrects the ideal gas law for two effects. The b term subtracts the volume occupied by the molecules themselves, so the free volume is V − nb. The a term accounts for attractions between molecules, which reduce the force of collisions with the walls; it adds an²/V² back to the measured pressure.
Pressure and temperature can be solved directly. Volume requires solving the cubic PV³ − (Pnb + nRT)V² + an²V − abn³ = 0; the calculator finds all real roots and reports the largest physical one (V > nb) as the gas volume. The compressibility factor Z = PV/nRT equals 1 for an ideal gas, so its distance from 1 measures non-ideality. R = 0.08314462618 L·bar/(mol·K).
- P
- Pressure (bar internally)
- V
- Volume (L)
- n
- Amount of gas (mol)
- T
- Absolute temperature (K)
- a
- Attraction constant (L²·bar/mol²)
- b
- Excluded volume per mole (L/mol)
Worked examples
1 mol CO₂ in 1 L at 27 °C
P = 0.083145 × 300.15 ÷ (1 − 0.04267) − 3.640 × 1² ÷ 1² = 26.07 − 3.64 = 22.43 bar = 22.13 atm. The ideal gas law predicts 24.63 atm, so CO₂’s strong attractions lower the pressure by about 10% (Z ≈ 0.90).
Volume of 1 mol N₂ at 100 atm and 0 °C
Solving the cubic at 101.325 bar and 273.15 K gives V ≈ 0.2104 L, about 6% less than the ideal 0.2241 L, because nitrogen’s attractions win over its molecular volume at this pressure.
Temperature of 2 mol O₂ in 5 L at 10 bar
T = (10 + 1.382 × 4 ÷ 25)(5 − 2 × 0.03186) ÷ (2 × 0.083145) = 10.221 × 4.936 ÷ 0.16629 ≈ 303.4 K, about 2.7 K higher than the ideal-gas estimate of 300.7 K.
Frequently asked questions
What do the van der Waals constants a and b mean?+
a measures how strongly the molecules attract one another — larger for polar or big molecules such as water and propane. b is the volume excluded by one mole of molecules, roughly four times their actual molecular volume.
When should I use the van der Waals equation instead of the ideal gas law?+
Use it at high pressures (above roughly 10 atm), at low temperatures near condensation, or for strongly interacting gases such as CO₂, NH₃ and water vapor. At room conditions most gases are within 1% of ideal.
Why can solving for volume give three answers?+
Below the critical temperature the van der Waals equation is a cubic with up to three real roots. The largest corresponds to the gas, the smallest to the liquid, and the middle one is unphysical.
What is the compressibility factor Z?+
Z = PV/nRT. It equals 1 for an ideal gas, is below 1 when attractive forces dominate, and is above 1 at very high pressure when molecular size dominates.
How accurate is the van der Waals equation?+
It captures the qualitative behaviour of real gases, including condensation and the critical point, but can be off by several percent at high density. Equations like Redlich–Kwong or Peng–Robinson are more accurate for engineering work.