The van der Waals calculator above solves the equation of state itself. You give it two of the three state variables and the two substance constants, and it returns the third exactly as the equation defines it: pressure and temperature by direct rearrangement, and molar volume by solving the cubic that the equation becomes when volume is the unknown. That cubic is the interesting part, because for some inputs it has one real root and for others it has three, and the middle one of those three is not a state any real fluid ever occupies.
Arb Digital publishes this alongside a page that starts from the other end. The compressibility factor calculator takes the same two constants a and b as inputs, plus a pressure and a temperature, and its job is to produce Z — how far the gas has departed from ideal behaviour. It uses the van der Waals relation as a route to that one number. This page treats the equation as the object of interest: it gives you pressure or temperature as well as volume, reports every real root rather than one, and derives the critical constants the two coefficients imply. If the number you want is Z, that page is shorter. If the gas is dilute enough that the corrections do not matter, the ideal gas law calculator is the right starting point.
What This Van der Waals Calculator Does
Johannes Diderik van der Waals published his equation in 1873 as a correction to the ideal gas law with exactly two physical ideas in it. The first is that molecules occupy space, so the volume available for motion is the container volume less the volume the molecules themselves take up. The second is that molecules attract one another, so a molecule about to strike the wall is pulled back by its neighbours and hits with less momentum, which lowers the measured pressure. Each idea gets one constant. The equation is
(P + a ÷ Vm²) × (Vm − b) = R T
with a carrying the attraction and b the excluded volume per mole. Setting both to zero returns the ideal gas law exactly, which is the sanity check every implementation should pass.
The calculator solves this for whichever variable you leave out, shows the ideal gas answer beside it, computes the compressibility factor, and derives the critical temperature, pressure and molar volume that follow from a and b alone. Reduced temperature and reduced pressure tell you at a glance whether the corrections are small or dominant.
How to Use It
- Pick what you are solving for. Pressure and temperature are closed-form. Volume is a cubic and gets the fuller treatment, including a written note when three real roots exist.
- Choose a gas or enter your own constants. The presets are published litre-bar values. If your source tabulates a in Pa·m⁶/mol² or atm·L²/mol², convert before entering, because a units mismatch here produces an answer that looks plausible and is wrong.
- Enter the two state variables you know. Pressure must be absolute, temperature must be in kelvin, and molar volume is the volume per mole, not the container volume.
- Read the ideal answer next to the real one. The gap between them is the whole point of the exercise. If it is under a per cent, you did not need this equation.
- Check the reduced coordinates. Below a reduced temperature of one you are under the critical temperature and the cubic can have three roots, which is where the physics gets interesting.
The Formula and the Cubic
Rearranged for pressure the equation is direct:
P = R T ÷ (Vm − b) − a ÷ Vm²
and for temperature it is equally direct:
T = (P + a ÷ Vm²)(Vm − b) ÷ R
Volume is different. Multiplying out and collecting powers gives a genuine cubic:
P Vm³ − (P b + R T) Vm² + a Vm − a b = 0
This tool solves that cubic analytically rather than by iterating from an ideal-gas guess: it reduces the polynomial to depressed form, then uses the trigonometric solution when the discriminant is negative — the case that produces three distinct real roots — and the Cardano form when it is positive. Roots at or below b are discarded as unphysical. The gas constant used throughout is R = 0.083145 L·bar mol⁻¹ K⁻¹, which is the CODATA value expressed in these units; the underlying constant is published in the NIST reference on fundamental physical constants.
Work the default through by hand. Carbon dioxide has a = 3.640 L²·bar/mol² and b = 0.04267 L/mol. At T = 300 K and Vm = 0.5 L/mol, the repulsive term is RT ÷ (0.5 − 0.04267) = 24.9435 ÷ 0.45733 = 54.542 bar and the attractive term is 3.640 ÷ 0.25 = 14.560 bar, so P = 39.98 bar. The ideal gas law would say RT ÷ Vm = 49.89 bar, about 25 per cent higher. The compressibility factor is P Vm ÷ RT = 19.99 ÷ 24.94 = 0.801. The critical constants follow from the constants alone: Tc = 8a ÷ 27Rb = 29.12 ÷ 0.09579 = 304.0 K and Pc = a ÷ 27b² = 3.640 ÷ 0.04916 = 74.0 bar. Those are within a fraction of a per cent of the measured critical point of carbon dioxide, 304.1 K and 73.8 bar, which is a striking result for a two-parameter model from 1873.
One Root, Three Roots, and What the Middle One Means
When you solve for volume, the number of real roots is not a numerical artefact. It is telling you something about the state of the fluid.
Above the critical temperature the cubic always has exactly one real root: a single volume consistent with your pressure and temperature, with no liquid-gas distinction. This is the ordinary case, and most engineering use of the equation lives here.
Below the critical temperature, and at pressures near the saturation pressure, the cubic can have three distinct real roots larger than b. The tool reports all of them. The smallest is the liquid-like branch: a small molar volume where the repulsive term dominates. The largest is the vapour-like branch. The middle root is the one people misread. On that branch, increasing the pressure would increase the volume — the isotherm slopes the wrong way, so the compressibility is negative. A fluid in that state would amplify any tiny density fluctuation instead of damping it, so it is mechanically unstable and no real substance ever sits there. The middle root is a mathematical consequence of forcing a smooth cubic through a region where the true behaviour is a flat two-phase plateau. It has no physical interpretation and should never be quoted as an answer.
The parts of the outer branches that lie inside the two-phase region are a subtler case. They are metastable rather than unstable, and they describe genuinely observable states: superheated liquid that has not yet boiled, and supersaturated vapour that has not yet condensed. Both are fragile and both collapse the moment a nucleation site appears, which is why a cup of water heated in a microwave can sit above its boiling point and then erupt when disturbed.
Where the Two Constants Come From
Tabulated values of a and b are almost never fitted to a whole surface of pressure-volume-temperature data. They are usually back-calculated from the measured critical point, because the equation makes a clean prediction there. At the critical point the first and second derivatives of pressure with respect to volume both vanish, and solving those two conditions together gives Vc = 3b, Tc = 8a ÷ 27Rb and Pc = a ÷ 27b². Invert them and you get a and b from a critical temperature and pressure you can look up.
That anchoring has a consequence: the equation is most accurate near the critical point and gets steadily worse away from it, and the model predicts a fixed critical compressibility factor of 3 ÷ 8 = 0.375 for every substance, whereas real fluids cluster between about 0.23 and 0.31. That single number is the clearest statement of the equation's limitation — it captures the shape of real gas behaviour beautifully and its magnitude only approximately. For accurate property data, reference formulations such as those behind the NIST Chemistry WebBook thermophysical properties of fluid systems use equations with dozens of fitted terms rather than two.
When You Actually Need It, and When You Do Not
The honest answer is that most of the time you do not. At ambient pressure and ordinary temperatures the corrections are a fraction of a per cent for common gases, and the ideal gas law is correct to within the accuracy of your inputs. Three situations change that.
High pressure is the obvious one: compressed gas in a cylinder at 200 bar does not have the mass the ideal gas law predicts, and the gap matters for inventory and for stored energy. Low temperature relative to the critical point is the second, because attraction becomes a bigger fraction of the total as reduced temperature falls toward one. Third, and most often overlooked, are gases with strong intermolecular forces: water vapour and ammonia have large a values because their molecules are polar, and they depart from ideality at pressures where nitrogen is still behaving perfectly.
Compute the reduced coordinates before deciding. If reduced temperature is above about two and reduced pressure well below one, the gas is effectively ideal. Mixtures need their own treatment, since the constants for a mixture are not a simple average of the components; where you only need partial pressures, the partial pressure calculator handles the ideal case.
Units Are Where This Goes Wrong
More van der Waals calculations are wrecked by units than by physics. The constant a has dimensions of pressure times volume squared per mole squared, so every choice of unit gives a different number. The same carbon dioxide appears as 3.640 L²·bar/mol², as 3.592 L²·atm/mol² and as 0.3640 Pa·m⁶/mol² depending on the source. Mixing one of them with a gas constant in different units gives a pressure that is out by a factor nobody notices, because the answer still looks like a pressure.
This page works entirely in litres, bar, moles and kelvin, and R is fixed to match. If your constants came from a source using atmospheres, multiply a by 1.01325 to convert to bar units; b is a pure volume and needs no pressure conversion. If they came in SI with cubic metres, multiply a by 10 and b by 1000 to reach litre-bar units. Pressure conversions in general are handled by the gauge to absolute pressure converter, and if you need to move between kelvin, Celsius and Fahrenheit the temperature converter does it. A published table of constants in the units used here appears in OpenStax's chapter on non-ideal gas behavior in Chemistry 2e.
Arb Digital builds free tools like this one because genuinely useful pages earn attention. If you want calculators, tools or technical content built for your own audience, we can help.
Browse All Free Tools Talk to Arb DigitalCommon Mistakes to Avoid
- Quoting the middle root — when the cubic gives three real volumes, the middle one has negative compressibility and describes no physical state. Take the smallest for liquid and the largest for vapour.
- Mixing unit systems in a and b — the constants only mean anything alongside a gas constant in the same units, and the resulting error looks like a perfectly reasonable pressure.
- Using container volume instead of molar volume — every term in the equation is per mole. Divide the total volume by the number of moles first.
- Entering gauge pressure — the equation is written in absolute pressure, and at low pressures the difference is most of the answer.
- Expecting quantitative accuracy near the critical point — the model gets the qualitative shape right and the critical compressibility factor badly wrong, so treat results there as illustrative rather than as property data.
Related Free Tools From Arb Digital
For the departure from ideality expressed as a single number, use the compressibility factor calculator. For the dilute limit, the ideal gas law calculator and the combined gas law calculator cover the standard classroom cases, with Boyle's law and Charles's law for the single-variable versions. The molar mass calculator turns a formula into the grams per mole you need to go from mass to moles, the density calculator handles the mass-per-volume step, and the partial pressure calculator splits a mixture. Everything Arb Digital publishes is listed on the free online tools hub.
Frequently Asked Questions
That page takes the same two constants plus a pressure and a temperature and produces the compressibility factor Z, using the van der Waals relation as a route to that one number. This page treats the equation as the object itself: it solves for pressure, molar volume or temperature, reports every real root of the cubic when volume is the unknown, and derives the critical constants implied by a and b. If you want Z, that page is more direct. If you want the equation solved, use this one.
Because the equation becomes a cubic polynomial in molar volume, and a cubic can have one or three real roots. Above the critical temperature there is always exactly one, and it is the answer. Below the critical temperature and near the saturation pressure there can be three, and they correspond to a liquid-like branch, an unstable branch and a vapour-like branch.
Nothing that any real fluid does. On the middle branch the volume increases as the pressure increases, so the compressibility is negative and any small density fluctuation grows instead of decaying. That state is mechanically unstable. The middle root is an artefact of forcing a smooth cubic through a region where the true isotherm is a flat two-phase plateau, and it should never be quoted as a result.
The constant a measures the strength of attraction between molecules and appears as a correction that reduces the pressure a gas exerts on its container. The constant b is the excluded volume per mole, the space the molecules themselves occupy, which is subtracted from the volume available for motion. Setting both to zero recovers the ideal gas law exactly.
Usually from the measured critical point rather than from fitting a full surface of data. The equation predicts a critical volume of 3b, a critical temperature of 8a divided by 27Rb, and a critical pressure of a divided by 27b squared. Inverting those relations gives a and b from a critical temperature and pressure, which is why the equation is most accurate near the critical point.
Good qualitatively, moderate quantitatively. It reproduces the shape of real isotherms, the existence of a critical point and the liquid-vapour transition with only two parameters, which is remarkable. But it predicts the same critical compressibility factor of 0.375 for every substance, while real fluids fall between roughly 0.23 and 0.31. For accurate property data, reference formulations with many more fitted terms are used instead.
Whenever the corrections are smaller than the uncertainty in your inputs, which covers most work at ambient pressure. A quick test is to compute the reduced coordinates: if the temperature is more than about twice the critical temperature and the pressure is well below the critical pressure, the two answers agree closely and the extra constants buy nothing.
This page implements a two-parameter model published in 1873. It is a teaching and estimation tool, not a source of certified property data, and process or pressure-vessel work should rest on reference-quality property formulations and the judgement of a qualified engineer.