Gas Compressibility Factor (Z) Calculator

Calculate the compressibility factor Z = PV/nRT for real gases using the van der Waals equation.
Compare real vs ideal gas behavior.

Compressibility Factor Z

The compressibility factor Z measures how much a real gas deviates from ideal gas behavior.

Definition:

Z = PV / (nRT) = PVm / RT

where Vm = molar volume (L/mol).

For an ideal gas: Z = 1 (always).

For real gases:

  • Z < 1: Intermolecular attractions dominate → gas is more compressed than ideal
  • Z > 1: Repulsive forces dominate (at high pressure) → gas occupies more volume than ideal

Van der Waals equation:

(P + a/Vm²)(Vm - b) = RT

Where:

  • a = intermolecular attraction parameter (L²·atm/mol²)
  • b = molecular volume (excluded volume) parameter (L/mol)

Van der Waals constants (a, b): these are properties of the gas itself, not of the conditions, so the same pair applies at every temperature.

Gas a (L²atm/mol²) b (L/mol)
He 0.0346 0.0238
H₂ 0.2476 0.0266
N₂ 1.370 0.0387
O₂ 1.382 0.0319
CO₂ 3.640 0.0427
H₂O 5.536 0.0305
NH₃ 4.225 0.0371
CH₄ 2.283 0.0428

Z at 1 atm, 25°C: nearly 1 for all gases (ideal behavior is a good approximation). At very high pressures (>100 atm) or low temperatures (near boiling point), Z deviates significantly.

The Boyle temperature: The temperature at which a real gas behaves most like an ideal gas (Z ≈ 1 over a range of P). For a van der Waals gas, T_Boyle = a/(Rb) in Kelvin. Nitrogen works out to about 431 K, which is why nitrogen at room temperature already deviates noticeably from ideal, while at 158 °C it barely does. (Do not confuse this with the critical temperature, T_c = 8a/(27Rb). The two differ by a factor of 27/8, and mixing them up is the usual source of a Boyle temperature that comes out in the thousands.)

The a and b values above are the CRC Handbook set in L²·atm/mol², and they match the ones on the van der Waals equation calculator exactly. Worth checking whenever you compare answers across sources: plenty of textbooks quote the same constants in L²·bar/mol², which is about 1.3% different, and a few older tables carry values that predate the current fits. Feed two different a values into the same conditions and you get two different Z, which is exactly the kind of discrepancy that sends people hunting for an arithmetic error that is not there.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.