The Compressibility Factor

Fill a steel cylinder with nitrogen at 800 atm and the ideal gas law fails badly. Predicted and measured pressures can differ by more than 20%. Chemists needed one clean number to track that failure. That number is the compressibility factor, ZZ. ZZ compares the actual molar volume of a real gas to the volume predicted by the ideal gas law. It equals exactly 1 for an ideal gas at every pressure and temperature. Deviations from 1 tell you whether attractive or repulsive intermolecular forces dominate under given conditions. This matters directly for industrial gas storage, natural gas pipelines, cryogenics, and any calculation where "close enough" to ideal is not good enough. This article defines ZZ rigorously. It builds the virial connection to intermolecular forces. It walks through two fully worked numerical examples. Finally, it previews how ZZ sets up the van der Waals equation and the law of corresponding states.

Key takeaways
  • Z=pVm/RTZ = pV_m / RT measures the ratio of real to ideal molar volume at fixed pp, TT.
  • Z=1Z = 1 for an ideal gas; Z<1Z < 1 signals net attractive forces; Z>1Z > 1 signals net repulsive (excluded-volume) forces.
  • At low pressure Z→1Z \to 1 for every real gas; at very high pressure Z>1Z > 1 always, because molecules have finite size.
  • The Boyle temperature is where ZZ has zero initial slope in pp, and attraction/repulsion balance.
  • ZZ is the first-order diagnostic behind the virial equation, the van der Waals equation, and corresponding states.
  • Key idea: ZZ is a single dimensionless number that converts "how ideal is this gas right now" into a measurable, plottable quantity.
The core insight

The compressibility factor Z=pVm/RTZ = pV_m/RT packages all the messy physics of intermolecular attraction and molecular size into one ratio that equals 1 exactly when a gas behaves ideally, so its deviation from unity — and how that deviation changes with pressure and temperature — is a direct, measurable fingerprint of real intermolecular forces.

The physical picture

For one mole of an ideal gas, pVm=RTpV_m = RT holds at every pressure. Real molecules occupy space and attract or repel one another, so real gases disobey this law except in the low-density limit. Rather than abandon the simple law, chemists keep its form and absorb all the non-ideality into a correction factor:

Z=pVmRTZ = \frac{pV_m}{RT}

Two competing effects control ZZ. At moderate pressures, intermolecular attractions pull molecules together, letting the gas occupy less volume than ideal behavior predicts. This makes VmV_m smaller than the ideal value, so Z<1Z < 1. At high pressures, molecules are forced close enough that their finite size — repulsive core — becomes dominant, pushing the real volume above the ideal value, so Z>1Z > 1. Every real gas shows this same qualitative shape: a dip below 1 followed by a rise above 1 as pressure increases, though the depth of the dip and the pressure at which ZZ crosses back through 1 depend strongly on temperature and on which gas you study. At a special temperature called the Boyle temperature TBT_B, the initial low-pressure slope of ZZ against pp is exactly zero. Attractive and repulsive contributions cancel to first order, and the gas behaves ideally over an unusually wide pressure range. Above TBT_B, thermal energy overwhelms attractions and ZZ rises monotonically from 1. Below TBT_B, the characteristic dip appears.

Figure
Compressibility factor Z versus pressure for N₂ at three temperatures
p / atm Z = pV_m / RT Z = 1 (ideal) 1.0 0 1.4 200 K (below T_B) 327 K (≈ T_B) 700 K (above T_B) Z(p) for N₂: dip, minimum, rise

The second useful picture is a molecular one: split the real gas's non-ideal molar volume into what attraction removes and what molecular size adds back.

Figure
Two competing contributions to Z
Attraction pulls molecules in Z less than 1 Excluded volume molecules repel Z greater than 1 increasing p Net Z(p) = sum of both effects, temperature-dependent balance

The core relations

Z=pVmRTZ = \frac{pV_m}{RT}

where VmV_m is the actual molar volume, pp the pressure, TT the temperature, and RR the gas constant.

Z=VmVm∘Z = \frac{V_m}{V_m^{\circ}}

where Vm∘=RT/pV_m^{\circ} = RT/p is the molar volume an ideal gas would have at that same pp and TT.

Z=1+B(T) p+C(T) p2+⋯Z = 1 + B(T)\,p + C(T)\,p^2 + \cdots

where B(T)B(T) and C(T)C(T) are the pressure-series virial coefficients, with B(T)B(T) controlling the initial slope.

Z=1+B2(T)Vm+B3(T)Vm2+⋯Z = 1 + \frac{B_2(T)}{V_m} + \frac{B_3(T)}{V_m^2} + \cdots

where B2(T)B_2(T), B3(T)B_3(T) are the volume-series (molar-volume) virial coefficients; B2B_2 is often just written BB.

TB:(∂Z∂p)p→0, T=TB=0  ⟺  B(TB)=0T_B: \quad \left(\frac{\partial Z}{\partial p}\right)_{p \to 0, \, T = T_B} = 0 \iff B(T_B) = 0

where TBT_B is the Boyle temperature, the unique temperature at which the second virial coefficient vanishes.

Derivation AFrom the virial equation to the physical meaning of Z

Goal. Show how ZZ's definition connects directly to the virial expansion, and extract the physical meaning of the first deviation term.

Step 1. Start from the exact experimental fact. For any real gas, a plot of pVmpV_m against pp at fixed TT is smooth and can be fit by a power series in pp, since real equations of state are analytic away from phase transitions:

pVm=RT(1+B′p+C′p2+⋯ )pV_m = RT\left(1 + B'p + C'p^2 + \cdots \right)

Step 2. Divide both sides by RTRT. By definition Z=pVm/RTZ = pV_m/RT, so dividing gives immediately

Z=1+B′(T) p+C′(T) p2+⋯Z = 1 + B'(T)\,p + C'(T)\,p^2 + \cdots

This is the pressure-series virial equation of state, and it is exact in the sense that it is simply a Taylor expansion of measured data; B′B', C′C' are empirical temperature-dependent coefficients.

Step 3. Relate the pressure series to the more physically transparent volume series. It is more common, and closer to molecular theory, to expand in 1/Vm1/V_m instead of pp:

Z=1+B(T)Vm+C(T)Vm2+⋯Z = 1 + \frac{B(T)}{V_m} + \frac{C(T)}{V_m^2} + \cdots

The two expansions must agree order by order once pp is eliminated using p≈RT/Vmp \approx RT/V_m to lowest order, giving the standard low-order relation B′≈B/RTB' \approx B/RT.

Step 4. Interpret the leading coefficient B(T)B(T) molecularly. Statistical mechanics shows that B(T)B(T) arises from the pairwise interaction potential u(r)u(r) between two molecules:

B(T)=−2πNA∫0∞[e−u(r)/kBT−1]r2 drB(T) = -2\pi N_A \int_0^{\infty} \left[e^{-u(r)/k_BT} - 1\right] r^2 \, dr

At long range, u(r)u(r) is attractive (negative), which makes the integrand positive there and drives B(T)B(T) negative — the physical signature of attraction lowering ZZ below 1. At short range, the steep repulsive wall makes u(r)u(r) large and positive, driving the integrand toward −1-1 and pushing B(T)B(T) toward positive values — the signature of excluded volume raising ZZ above 1.

Step 5. Extract the Boyle temperature. Since to leading order in pp,

Z≈1+B(T)RT pZ \approx 1 + \frac{B(T)}{RT}\,p

the initial slope of ZZ versus pp is B(T)/RTB(T)/RT. This slope vanishes exactly when B(T)=0B(T) = 0, defining TBT_B. Below TBT_B, B(T)<0B(T) < 0 and attraction dominates at low pressure, producing the characteristic initial dip in ZZ. Above TBT_B, B(T)>0B(T) > 0 and ZZ rises immediately from 1.

Boxed result.

Z(p,T)=1+B(T)RT p+O(p2),B(TB)=0\boxed{Z(p,T) = 1 + \frac{B(T)}{RT}\,p + \mathcal{O}(p^2), \quad B(T_B) = 0}

ZZ's low-pressure slope is fixed entirely by the second virial coefficient, and its sign is a direct experimental probe of whether attraction or repulsion controls the gas at that temperature.

Worked examples

Example 1 — Foundational: computing ZZ from a pp–VV–TT measurement. One mole of carbon dioxide gas is confined at T=313 KT = 313\ \text{K} and p=60.0 atmp = 60.0\ \text{atm}. Experiment shows the molar volume is Vm=0.2652 L mol−1V_m = 0.2652\ \text{L mol}^{-1}. Find ZZ and interpret it. Step 1. Convert to consistent SI-friendly units using R=0.08206 L atm K−1mol−1R = 0.08206\ \text{L atm K}^{-1}\text{mol}^{-1}. Step 2. Compute the ideal molar volume at these conditions:

Vm∘=RTp=(0.08206 L atm K−1mol−1)(313 K)60.0 atm=0.4280 L mol−1V_m^\circ = \frac{RT}{p} = \frac{(0.08206\ \text{L atm K}^{-1}\text{mol}^{-1})(313\ \text{K})}{60.0\ \text{atm}} = 0.4280\ \text{L mol}^{-1}

Step 3. Compute ZZ:

Z=VmVm∘=0.26520.4280=0.6196Z = \frac{V_m}{V_m^\circ} = \frac{0.2652}{0.4280} = 0.6196

Step 4. Sanity check via the direct definition:

Z=pVmRT=(60.0)(0.2652)(0.08206)(313)=15.91225.685=0.6196Z = \frac{pV_m}{RT} = \frac{(60.0)(0.2652)}{(0.08206)(313)} = \frac{15.912}{25.685} = 0.6196

Both routes agree. Since Z=0.620Z = 0.620 is well below 1, CO₂ at 313 K and 60 atm is strongly dominated by attractive intermolecular forces — the actual volume is only 62% of the ideal prediction. This is physically reasonable: CO₂ has a relatively high critical temperature (304 K), so 313 K is only slightly above TcT_c, a regime where attractions are known to be severe.

Example 2 — Applied: locating the pressure at which N₂ returns to near-ideal behavior. Nitrogen gas at T=300 KT = 300\ \text{K} has a measured second virial coefficient B=−4.5 cm3 mol−1B = -4.5\ \text{cm}^3\,\text{mol}^{-1} and, from tables, a third virial coefficient C=1100 cm6 mol−2C = 1100\ \text{cm}^6\,\text{mol}^{-2}. Using the volume-series virial equation truncated at the CC term, estimate the molar volume and ZZ at p=100 atmp = 100\ \text{atm}, and compare with the ideal prediction. Step 1. Write the two-term-corrected virial equation with pp in atm, VmV_m in cm³/mol, using R=82.06 cm3atm K−1mol−1R = 82.06\ \text{cm}^3\text{atm K}^{-1}\text{mol}^{-1}:

Z=pVmRT=1+BVm+CVm2Z = \frac{pV_m}{RT} = 1 + \frac{B}{V_m} + \frac{C}{V_m^2}

Step 2. First find the ideal molar volume as a zeroth iterate:

Vm(0)=RTp=(82.06)(300)100=246.2 cm3 mol−1V_m^{(0)} = \frac{RT}{p} = \frac{(82.06)(300)}{100} = 246.2\ \text{cm}^3\,\text{mol}^{-1}

Step 3. Iterate: insert Vm(0)V_m^{(0)} into the right side to refine ZZ, then recompute VmV_m.

Z(1)=1+−4.5246.2+1100246.22=1−0.01828+0.01815=0.99987Z^{(1)} = 1 + \frac{-4.5}{246.2} + \frac{1100}{246.2^2} = 1 - 0.01828 + 0.01815 = 0.99987

Step 4. Because BB and CC nearly cancel at this VmV_m, Z(1)≈1.000Z^{(1)} \approx 1.000 to three significant figures, so the correction is tiny; one more iteration confirms convergence:

Vm(1)=Z(1)RTp=(0.99987)(246.2)=246.2 cm3 mol−1V_m^{(1)} = Z^{(1)}\frac{RT}{p} = (0.99987)(246.2) = 246.2\ \text{cm}^3\,\text{mol}^{-1}

The iteration is stationary, so Vm=246.2 cm3 mol−1V_m = 246.2\ \text{cm}^3\,\text{mol}^{-1} and Z=0.9999Z = 0.9999. Step 5. Interpret: at 300 K and 100 atm, nitrogen sits almost exactly at Z=1Z = 1 despite being at fairly high pressure — this is because 300 K is close to N₂'s experimental Boyle temperature (TB≈327 KT_B \approx 327\ \text{K}), where attraction and repulsion nearly cancel over a wide range of pp. Contrast this with Example 1: CO₂ at a temperature close to its own (much lower) TcT_c shows severe deviation, while N₂ near its Boyle temperature shows almost none, even at comparable pressure. This contrast is exactly the qualitative behavior sketched in the first figure.

Limiting cases & common traps

RegimeBehavior of ZZPhysical reason
p→0p \to 0 (any TT)Z→1Z \to 1Molecules far apart; both attraction and finite size become negligible
T=TBT = T_BZ≈1Z \approx 1 over a wide pp rangeB(TB)=0B(T_B) = 0; attraction and repulsion cancel to first order
T≪TBT \ll T_B, moderate ppZ<1Z < 1, shows a minimumAttractive forces dominate
Very high pp (any TT)Z>1Z > 1, rising without boundExcluded volume dominates; molecules cannot be compressed past close packing
T≫TBT \gg T_BZ>1Z > 1 for all p>0p > 0Thermal energy suppresses attraction; repulsion wins immediately

The chemist behind it

The compressibility factor's modern quantitative form owes much to Heike Kamerlingh Onnes, who introduced the virial expansion of pVmpV_m in powers of pp (or 1/Vm1/V_m) around 1901 while pursuing precision gas measurements at Leiden. His group's meticulous pp–VV–TT data on gases at low temperature — motivated by the eventual liquefaction of helium in 1908 — provided the experimental backbone that let later theorists connect virial coefficients to intermolecular potentials.

Origins · 1 minHeike Kamerlingh Onnes and how this was discovered
HK
Heike Kamerlingh Onnes
1853–1926 · Leiden physicist who introduced the virial equation of state and first liquefied helium, providing the precision p–V–T data that made Z a quantitative tool

Ask the tutor: How does the van der Waals equation predict the exact shape of the Z-versus-p curve, and why does it fail near the critical point?

Why does Z equal 1 for an ideal gas but not for real gases?

The ideal gas law assumes molecules have zero volume and no intermolecular forces, so pVm=RTpV_m = RT holds exactly, making Z=pVm/RT=1Z = pV_m/RT = 1 identically. Real molecules occupy finite volume and interact through attractive and repulsive forces, both of which change how VmV_m responds to pp and TT. These effects vanish only in the low-density limit, so ZZ deviates from 1 whenever intermolecular forces or molecular size become significant relative to the thermal and pressure scales involved.

Is there a single formula that predicts Z for any gas at any condition?

Not exactly — ZZ depends on the specific intermolecular potential of each substance, so no universal closed-form expression works perfectly for all gases. However, the law of corresponding states shows that when ZZ is plotted against reduced pressure pr=p/pcp_r = p/p_c and reduced temperature Tr=T/TcT_r = T/T_c, most gases collapse onto nearly the same curve. This approximate universality, covered in the corresponding-states article, makes generalized compressibility charts practically useful for engineering estimates.

How is Z related to the virial coefficients B and C?

The virial equation writes ZZ as a power series in 1/Vm1/V_m (or in pp), with coefficients B(T)B(T), C(T)C(T), and so on. The leading coefficient B(T)B(T) dominates at low-to-moderate density and directly reflects the balance between attraction and repulsion; it is negative below the Boyle temperature and positive above it. Higher terms like C(T)C(T) become important only as density increases further, refining the prediction beyond the Boyle-temperature-controlled first-order behavior described here.

Can Z ever be greater than 1 even at low pressure?

Yes, for gases at temperatures well above their Boyle temperature. In that regime the second virial coefficient B(T)B(T) is already positive, so even a small pressure increase pushes ZZ above 1 rather than causing the usual initial dip. Hydrogen and helium, which have unusually low critical temperatures, show Z>1Z > 1 at room temperature for essentially this reason — their Boyle temperatures are lower than most other common gases.

How does Z connect to the van der Waals equation?

The van der Waals equation, (p+a/Vm2)(Vm−b)=RT\left(p + a/V_m^2\right)(V_m - b) = RT, can be rearranged and expanded in 1/Vm1/V_m to yield a virial-like series whose second coefficient is B(T)=b−a/RTB(T) = b - a/RT. This single expression reproduces the qualitative story here directly: the bb term (excluded volume) pushes BB positive, the aa term (attraction) pushes it negative, and setting B(T)=0B(T) = 0 gives the van der Waals prediction for the Boyle temperature, TB=a/(Rb)T_B = a/(Rb).

Before this

Where this leads