🔬
🔬 Science & engineering

Compressibility Factor Calculator (Z = PV/nRT, real vs ideal gas)

Results update as you type.

Your numbers

Understanding the compressibility factor (Z) calculator — concept and principle

The compressibility factor Z tells you how far a real gas departs from ideal-gas behaviour. This calculator finds Z from measured pressure, volume, amount and temperature, and compares it with the van der Waals equation for a chosen gas.

CO₂ at 32.4 atm and 228.85 °CCO₂ at 32.4 atm and 228.85 °CCO₂ at 32.4 atm and 228.85 °Cideal gas33.536 atmvan der Waals32.364 atmmeasured32.4 atmZ = 32.4 ÷ 33.536 = 0.9661 · attraction wins
The gas presses 3.4% less than an ideal gas would, so Z < 1: attractions between molecules dominate.

How it is calculated

The principle

The ideal gas law assumes molecules have no size and do not attract each other. Real molecules do both. Attractions pull molecules together and lower the pressure on the walls, making Z less than 1. The molecules' own volume leaves less free space and raises the pressure, making Z greater than 1. Which effect wins depends on temperature and pressure. Van der Waals added two constants to capture these effects: a for attraction and b for size.

Worked example

Default inputs: 32.4 atm, 4.25 L, 3.46 mol, 228.85 °C (502.0 K), CO₂.

  1. Ideal pressure = 3.46 × 0.082057 × 502.0 ÷ 4.25 ≈ 33.536 atm.
  2. Z = 32.4 ÷ 33.536 ≈ 0.9661: attractive forces dominate; deviation −3.39%.
  3. Van der Waals: 142.53 ÷ (4.25 − 0.1477) − 3.59 × 3.46² ÷ 4.25² ≈ 34.744 − 2.379 ≈ 32.364 atm; van der Waals Z ≈ 0.9651.
  4. Molar volume = 4.25 ÷ 3.46 ≈ 1.2283 L/mol.
How Compressibility factor Z changes with Amount of gas (mol)How Compressibility factor Z changes wit…012340.8651.732.63.464.335.196.92Example: 0.9661Amount of gas (mol)
Each point is the calculator re-run with only “Amount of gas (mol)” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Amount of gas (mol)Compressibility factor Z
0.8653.8645
1.731.9323
2.61.2882
3.460.9661
4.330.7729
5.190.6441
6.920.4831

How to read the result

Z within a few per cent of 1 means the ideal gas law is a reasonable approximation. Larger deviations occur at high pressure and near the gas's condensation conditions. Here the van der Waals pressure agrees with the measurement to about 0.1%, showing that the model captures this case well.

Common mistakes

Keep in mind: The van der Waals equation is approximate, especially near the critical point. Engineering design needs accurate equations of state or measured data.

Frequently asked questions

What does Z less than 1 mean?

Attractions between molecules make the gas occupy less volume (or exert less pressure) than an ideal gas.

When is a gas close to ideal?

At low pressure and high temperature relative to its critical point.

What do a and b mean in van der Waals?

a corrects for attraction between molecules; b corrects for the volume the molecules occupy.

Sources: Atkins, P. & de Paula, J., Physical Chemistry (real gases, van der Waals equation) · CRC Handbook of Chemistry and Physics, van der Waals constants for gases

Checked 9 Nov 2026. OpenStax, Chemistry 2e (2019), §9.6 “Non-Ideal Gas Behavior” (compressibility factor Z = PVm/RT, van der Waals equation, Table 9.3 van der Waals constants, Example 9.24: 3.46 mol CO₂ in 4.25 L at 502 K, 33.5 atm ideal vs 32.4 atm van der Waals). R exact from kB × NA (2019 SI).

🔬 All science & engineering tools →🌍 Calculators by country →