Van der Waals Equation Calculator

Enter the amount of gas, volume, and temperature — plus the gas's Van der Waals constants a and b — to calculate real-gas pressure from (P + an²/V²)(V − nb) = nRT, compare it to the ideal gas law, and see the compressibility factor Z.

Quick Facts

Van der Waals Equation
(P + an²/V²)(V − nb) = nRT
Corrects the ideal gas law for intermolecular attraction (a) and the finite volume of molecules (b).
Constant a
Attraction correction
A larger a means stronger intermolecular attraction, which lowers pressure below the ideal-gas prediction.
Constant b
Excluded volume
b is the volume one mole of molecules occupies — the real gas volume can never be less than n × b.
Compressibility Factor
Z = PV / (nRT)
Z = 1 for an ideal gas; deviations from 1 measure how non-ideal the real gas is at these conditions.

Your Results

Calculated
Real Gas Pressure (Van der Waals)
-
P from (P + an²/V²)(V − nb) = nRT
Ideal Gas Pressure
-
P = nRT / V, for comparison
Compressibility Factor (Z)
-
Z = PV / nRT; Z = 1 is ideal
Deviation from Ideal
-
(P_real − P_ideal) / P_ideal × 100%

Ready

Choose a gas (or enter custom a and b), then enter the amount, volume, and temperature to calculate the real-gas pressure.

About the Van der Waals Equation

The ideal gas law, PV = nRT, assumes gas molecules are dimensionless points that never interact with each other. Real molecules attract one another at moderate distances and physically occupy space, so real gases deviate from ideal behavior — especially at high pressure or low temperature. In 1873, Johannes Diderik van der Waals proposed a correction: (P + an²/V²)(V − nb) = nRT, where a and b are constants specific to each gas. This calculator applies that equation directly to compute real-gas pressure, and compares it against the ideal gas law so you can see exactly how much — and in which direction — a real gas deviates.

The attraction and volume correction terms

The term an²/V² is added to the measured pressure P because intermolecular attraction pulls molecules toward each other and away from the container walls, so the pressure a real gas exerts is lower than it would be without attraction — the equation adds back that "missing" pressure before comparing to the ideal case. The constant a grows with how strongly a gas's molecules attract each other (polar molecules like water vapor and ammonia have large a values). The term nb is subtracted from the total volume V because gas molecules are not points — they have real physical size — so the space available for molecules to move through is V − nb, not the full container volume. The constant b is closely related to molecular size and is sometimes called the "excluded volume" or "co-volume."

How the calculation works

Enter the amount of gas n (moles), the container volume V with its unit, and the temperature T with its unit, plus the Van der Waals constants a and b — either by picking a preset gas, which fills in textbook values, or by entering your own. The calculator converts volume to liters and temperature to Kelvin, then solves directly for pressure: P = nRT/(V − nb) − an²/V², using R = 0.0820574 L·atm/(mol·K). It also computes the ideal-gas pressure P = nRT/V for the same n, V, and T, the compressibility factor Z = PV/(nRT), and the percent difference between the real and ideal pressures.

When the model breaks down

The Van der Waals equation is a major improvement over the ideal gas law, but it is still an approximation. It becomes least accurate near a gas's critical point, where attraction and volume effects are both large and the simple algebraic form cannot fully capture real molecular behavior; more advanced equations of state (such as Redlich-Kwong or Peng-Robinson) improve on it for engineering-grade accuracy. It also requires V to exceed nb — if a container is too small to physically hold the given amount of gas even in principle, the equation has no physical solution, and this calculator will flag that case rather than return a nonsensical pressure.

Frequently Asked Questions

What do the Van der Waals constants a and b represent?
a (in L²·atm/mol²) accounts for the attractive forces between gas molecules, which pull molecules together and lower the pressure a real gas exerts compared to an ideal gas. b (in L/mol) accounts for the finite volume the molecules themselves occupy, so the space available for movement is V − nb rather than the full container volume V. Both constants are measured experimentally and differ for every gas.
How is the Van der Waals equation different from the ideal gas law?
The ideal gas law, PV = nRT, treats molecules as point particles with no volume and no interactions. The Van der Waals equation, (P + an²/V²)(V − nb) = nRT, adds two correction terms: an²/V² accounts for intermolecular attraction, and nb accounts for the volume the molecules occupy. Setting a = b = 0 in the Van der Waals equation recovers the ideal gas law exactly.
What does the compressibility factor Z tell me?
Z = PV / (nRT) compares real-gas behavior to ideal-gas behavior. Z = 1 means the gas behaves ideally at those conditions. Z < 1 means attractive forces dominate, making the gas more compressible than an ideal gas — common at moderate pressure. Z > 1 means the molecules' finite size dominates, making the gas resist compression more than an ideal gas — common at very high pressure.
Can the Van der Waals equation predict when a gas will condense into a liquid?
Approximately, yes. Below the critical temperature the equation produces an S-shaped pressure-volume curve with a region where pressure appears to rise with volume, which is unphysical. That region signals liquid-vapor coexistence — one of the equation's most celebrated features, since the ideal gas law cannot predict condensation at all. The exact transition pressure in that region requires the Maxwell equal-area construction rather than reading the curve directly.