Solve the real-gas equation of state (P + a(n/V)²)(V − nb) = nRT:
find pressure, volume, moles, or temperature, compare against the ideal gas law, and get the
compressibility factor Z. Built-in a/b constants for 8 common gases.
1. Choose gas & constants
CO2: a = 3.658 L²·bar/mol², b = 0.0429 L/mol (Reid, Prausnitz & Poling, 4th ed.)
2. Choose what to solve
Below the critical temperature this equation can have up to three real volumes — all physical roots are reported honestly.
Worked example
1 mol of CO2 (a = 3.658 L²·bar/mol², b = 0.0429 L/mol) in V = 1.00 L at T = 300 K:
P = nRT/(V − nb) − a(n/V)² = (1)(0.0831446)(300)/(1 − 0.0429) − 3.658 = 22.40 bar
The ideal gas law gives P = nRT/V = 24.94 bar, so the real pressure is about 10.2% lower.
Compressibility factor Z = PV/nRT = 0.898 (attraction-dominated).
Van der Waals constants table
Gas
Formula
a (L²·bar/mol²)
b (L/mol)
Source: Reid, Prausnitz & Poling, The Properties of Gases and Liquids, 4th ed.
Custom values: a = 27R²Tc²/(64Pc), b = RTc/(8Pc) from critical constants.
Method & formulas
(P + a(n/V)²)(V − nb) = nRT
Pressure: P = nRT/(V − nb) − a(n/V)²
Volume: cubic PV³ − (Pnb + nRT)V² + an²V − abn³ = 0, solved analytically (Cardano); every root with V > nb is kept and round-trip verified.
R = 0.08314462618 L·bar/(mol·K) = 8.31446261815324 J/(mol·K). Temperature is always converted to Kelvin internally.
Scope boundary
This tool solves the van der Waals equation for real gases. For the pure ideal-gas law
PV = nRT (no a/b corrections), use the ideal gas law calculator.
Unlike a generalized compressibility chart lookup, every Z value here is computed directly from the van der Waals equation.
Frequently asked questions
What is the van der Waals equation of state?
The van der Waals equation is (P + a(n/V)^2)(V - nb) = nRT. It corrects the ideal gas law with two constants: a accounts for attractive forces between molecules (reducing pressure), and b accounts for the finite volume occupied by the molecules themselves (reducing the free volume). When a and b approach zero, the equation reduces exactly to the ideal gas law PV = nRT.
What do the constants a and b mean physically?
Constant a (in L^2·bar/mol^2) measures the strength of intermolecular attraction: water vapor has a = 5.537 while helium has only a = 0.0346, about 160 times smaller, which is why helium behaves almost ideally. Constant b (in L/mol) is the excluded volume per mole, roughly four times the actual molecular volume: helium b = 0.0238 L/mol, water b = 0.0305 L/mol.
Worked example: pressure of CO2 from the van der Waals equation?
Take 1 mol of CO2 (a = 3.658 L^2·bar/mol^2, b = 0.0429 L/mol) in V = 1.00 L at T = 300 K. P = nRT/(V - nb) - a(n/V)^2 = (1)(0.0831446)(300)/(1 - 0.0429) - 3.658 = 22.40 bar. The ideal gas law gives P = nRT/V = 24.94 bar, so the real pressure is about 10.2% lower, with compressibility factor Z = PV/nRT = 0.898.
Why can solving for volume give three answers?
Rearranging the van der Waals equation for V produces a cubic equation, which can have one or three real roots. For example, 1 mol of CO2 at T = 260 K and P = 25 bar yields three physical volumes: 0.0745 L, 0.1178 L, and 0.7153 L. The largest root is the gas-like volume, the smallest is the liquid-like volume, and the middle root is thermodynamically unstable. This tool reports all physical roots honestly instead of hiding them.
What units must a and b use?
The units of a and b must be consistent with your pressure and volume units. This tool stores a in L^2·bar/mol^2 and b in L/mol, matching pressure in bar and volume in liters. If you enter pressure in atm, multiply a by 0.98692 to convert L^2·bar/mol^2 to L^2·atm/mol^2. Mixing units is the most common source of wrong answers, so the tool converts all inputs to one internal unit system automatically.
Must temperature be in Kelvin?
Yes. The van der Waals equation, like the ideal gas law, requires absolute temperature. Entering 300 C instead of 300 K silently gives a wrong answer: 1 mol of CO2 in 1 L at 573.15 K (which is 300 C) has P = 46.13 bar, not the 22.40 bar you get at 300 K. This tool accepts C and F inputs but always converts them to Kelvin before computing.
What is the compressibility factor Z?
Z = PV/nRT measures how far a gas deviates from ideal behavior: Z = 1 is ideal. For 1 mol of CO2 at 1 L and 300 K, Z = 0.898, meaning attractive forces dominate and the gas is about 10% more compressible than an ideal gas. Z < 1 means attraction dominates; Z > 1 means molecular-size repulsion dominates, which happens at very high pressures.
When does the van der Waals equation fail?
It is a two-parameter model, so it is approximate: errors of several percent are normal near the critical point or at liquid-like densities, and it cannot capture hydrogen bonding or quantum effects (helium below ~10 K). For engineering-grade accuracy near saturation, use a multiparameter equation of state such as Peng-Robinson. For ordinary gases at moderate pressure it is typically within a few percent.
Can I enter my own a and b values?
Yes. Select "Custom gas" and enter a in L^2·bar/mol^2 and b in L/mol. Values for hundreds of substances are tabulated in Reid, Prausnitz and Poling, "The Properties of Gases and Liquids" (4th ed.). You can also derive them from critical constants: a = 27R^2Tc^2/(64Pc) and b = RTc/(8Pc).
How is this different from the ideal gas law calculator?
The ideal gas law PV = nRT treats molecules as point particles with no interactions, which works well for dilute gases at ordinary conditions. The van der Waals equation adds the two molecular corrections (attraction a, excluded volume b), so it stays useful at higher pressures and lower temperatures where the ideal law can be off by 10% or more, as in the CO2 example above.
We use cookies and third-party services (including Google AdSense) to personalize content, analyze traffic, and serve relevant ads. By clicking "Accept", you consent to our use of cookies as described in our Privacy Policy.
Report an issue
2 taps, no typing needed — diagnostics are sent automatically.