Chemical Engineering · Thermodynamics
Compressibility factor calculator icon showing Z versus reduced pressure curves

Compressibility factor calculator

This compressibility factor calculator finds Z, the correction that turns PV = nRT into PV = ZnRT for a real gas, in three ways: from measured pressure, volume, amount and temperature; from reduced conditions with the Pitzer generalized virial correlation; and from the Peng-Robinson equation, with a Z versus Pr chart.

Use absolute pressure. Pick a gas to load Tc, Pc and ω, choose Custom to type your own, or switch the mode to “Reduced Tr and Pr” to work straight from a textbook chart problem.

Compressibility factor calculator from measured P, V, T

Z = PV/(nRT) for a gas sample whose pressure, volume, temperature and amount are known.
N₂ 28.014, air 28.96, CO₂ 44.01, CH₄ 16.04 g/mol.

Compressibility factor calculator: Pitzer virial correlation

Z = 1 + (B⁰ + ωB¹)·Pr/Tr with the Abbott equations for B⁰ and B¹. Best at low to moderate pressure.
Blank = 0 (simple fluid).
Only used when Gas = Custom.
Only used when Gas = Custom.
Needed for SRK and Peng-Robinson; blank = 0.
Optional; only needed for density.

Compressibility factor calculator: Peng-Robinson Z and chart

Stable-root Z from the Peng-Robinson equation, plotted against reduced pressure with curves for several Tr.
Blank = 0 (simple fluid).
Only used when Gas = Custom.
Only used when Gas = Custom.
Needed for SRK and Peng-Robinson; blank = 0.
Optional; only needed for density.

How to use the compressibility factor calculator

Use the first panel of the compressibility factor calculator when you have data: a cylinder or vessel of known volume, a measured pressure and temperature, and a known mass or number of moles. It returns Z and tells you how much an ideal gas calculation would be off. Use the second and third panels to predict Z. Pick a gas (or Custom with your own Tc, Pc and ω) and enter T and P, or switch to “Reduced Tr, Pr and ω” when a problem is already stated in reduced form. The second panel applies the Pitzer generalized virial correlation and checks whether you are inside its validity range; the third panel solves Peng-Robinson and draws the Z chart. Every result of the compressibility factor calculator has a “Show the working” list with the numbers substituted.

What is the compressibility factor Z?

Z = P·V / (n·R·T) = P·Vm / (R·T)

The compressibility factor is the ratio of the actual molar volume of a gas to the molar volume an ideal gas would have at the same temperature and pressure. Z = 1 is ideal behavior. Z below 1 means intermolecular attraction pulls the molecules together and the gas is denser than PV = nRT predicts; Z above 1 means the finite size of the molecules dominates. Once Z is known, every ideal gas formula is corrected in one step: V = ZnRT/P and ρ = PM/(ZRT). A compressibility factor calculator is therefore the bridge between the Ideal Gas Law Calculator and full equations of state.

Corresponding states: Z from Tr, Pr and ω

The principle of corresponding states says that gases at the same reduced temperature Tr = T/Tc and reduced pressure Pr = P/Pc have about the same Z. Pitzer added a third parameter, the acentric factor ω, which corrects for non-spherical and slightly polar molecules. The generalized virial form, with the equations of Abbott, is:

Z = 1 + (B⁰ + ω·B¹) · Pr / Tr, B⁰ = 0.083 − 0.422 / Tr^1.6, B¹ = 0.139 − 0.172 / Tr^4.2

It is a truncated virial equation, so it is only reliable at moderate density. The usual guideline, from Smith, Van Ness and Abbott and repeated in Lira’s Michigan State University notes on equations of state, is Tr > 0.686 + 0.439·Pr (equivalently a reduced volume above about 2). The compressibility factor calculator checks this condition and warns when you are outside it. At higher density, use the Peng-Robinson panel, which is valid for gas and liquid alike:

Peng-Robinson in reduced form: A = 0.45724·α·Pr/Tr², B = 0.07780·Pr/Tr, Z³ − (1 − B)Z² + (A − 3B² − 2B)Z − (AB − B² − B³) = 0

Worked example: n-butane at 510 K and 25 bar

This is a standard textbook comparison (Smith, Van Ness and Abbott) and the default in the second and third panels of the compressibility factor calculator. With Tc = 425.12 K, Pc = 37.96 bar and ω = 0.200: Tr = 510 / 425.12 = 1.1997 and Pr = 25 / 37.96 = 0.6586. Then B⁰ = 0.083 − 0.422 / 1.1997^1.6 = −0.2324 and B¹ = 0.139 − 0.172 / 1.1997^4.2 = 0.0589, so B·Pc/(R·Tc) = −0.2324 + 0.200 × 0.0589 = −0.2206 and Z = 1 − 0.2206 × 0.6586 / 1.1997 = 0.8789. The molar volume is V = ZRT/P = 1491 cm³/mol against 1696 cm³/mol for an ideal gas. The validity check passes: 1.1997 is above 0.686 + 0.439 × 0.6586 = 0.975.

The Peng-Robinson panel gives Z = 0.8576 for the same state, the Lee-Kesler generalized tables give Z ≈ 0.865, and a high-accuracy reference equation for n-butane gives Z ≈ 0.874. All methods agree within about 2%, while the ideal gas law (Z = 1) is 14% off. The first panel’s default is a different situation: a 50 L nitrogen cylinder holding 10.93 kg at 200 bar and 20 °C. n = 10.93 / 0.028014 = 390.2 mol and Z = 200 × 10⁵ × 0.050 / (390.2 × 8.314462618 × 293.15) = 1.0516. Here Z is above 1, so an ideal gas calculation would overestimate the cylinder contents by about 5%.

Typical values to check a compressibility factor calculator

The values below come from the NIST reference equations of state (see the NIST Chemistry WebBook fluid properties) and are rounded to three decimals. Use them to sanity-check results from the compressibility factor calculator.

Gas and conditionTrPrZ (reference)
Air, 25 °C, 1 atm2.260.0271.000
Nitrogen, 20 °C, 200 bar2.325.891.052
Methane, 25 °C, 100 bar1.562.170.852
Methane, −23 °C, 50 bar1.311.090.836
CO₂, 47 °C, 60 bar1.050.810.713
n-Butane, 510 K, 25 bar1.200.660.874

Two patterns are worth remembering. Near Tr ≈ 1 and Pr ≈ 1 Z drops steeply, so CO₂ just above its critical point is far from ideal even at moderate pressure. At high Tr and high Pr Z rises above 1, which is why compressed hydrogen and nitrogen at room temperature hold less gas than the ideal gas law suggests. Well inside their validity range, the generalized methods in the compressibility factor calculator agree with these reference values to within 1–3%. Agreement degrades near the critical point: for CO₂ at 47 °C and 60 bar (Tr = 1.05, just inside the virial guideline) the virial correlation gives 0.763, 7% high, and Peng-Robinson 0.695, 2.5% low.

Which method in the compressibility factor calculator should you use?

MethodGood forLimits
Measured PVT data (panel 1)Calibrating models, checking cylinder contents, lab dataNeeds accurate P, V, T and mass
Pitzer virial correlation (panel 2)Quick hand calculations at low to moderate pressure, nonpolar gasesOnly for Tr > 0.686 + 0.439·Pr; not for liquids
Peng-Robinson (panel 3)Gas and liquid, high pressure, hydrocarbons, CO₂, N₂Liquid density error 5–10%; less accurate near the critical point
Lee-Kesler tables or reference EOSHighest accuracy for designTables or software needed

For the full equations of state, including van der Waals, Redlich-Kwong and SRK, molar volume from pressure and all roots of the cubic, use the Real Gas Calculator. Use this compressibility factor calculator when what you need is Z itself, for example to correct a gas density, a compressor calculation or a flow meter reading.

Common mistakes with a compressibility factor calculator

Gauge pressure in Pr. Pr must use absolute pressure, in hand work and in any compressibility factor calculator; at low pressure the error from gauge readings is huge in relative terms. Temperature in °C in Tr. Tr = T/Tc only works with kelvin or rankine; the compressibility factor calculator converts for you. Applying the virial correlation at high pressure. Outside Tr > 0.686 + 0.439·Pr the two-term virial equation can give badly wrong or even negative Z. Dividing instead of multiplying. Real volume is Z times the ideal volume, and real density is the ideal density divided by Z. Using pure-component Tc and Pc for a mixture. For natural gas and other mixtures, use pseudo-critical properties (Kay’s rule: mole-fraction-weighted Tc and Pc) and enter them as a custom gas.

Related calculators

Turn Z into gas density or volume with the Ideal Gas Law Calculator (divide the ideal density by Z), compare equations of state in the Real Gas Calculator, and use corrected densities in the Reynolds Number Calculator and Pressure Drop Calculator.

Frequently asked questions

What is a normal compressibility factor?

It depends on the state, which is why a compressibility factor calculator is useful. Z = 1 for an ideal gas. Air at ambient conditions has Z ≈ 1.000; natural gas in pipelines at 50–100 bar typically has Z ≈ 0.80–0.90; hydrogen and nitrogen at several hundred bar have Z above 1.

Can the compressibility factor be greater than 1?

Yes. At high reduced temperature and high pressure, repulsion between molecules dominates and Z exceeds 1. Hydrogen at room temperature has Z above 1 at any pressure.

How do you calculate Z from reduced temperature and pressure?

Compute Tr = T/Tc and Pr = P/Pc, then read Z from a generalized chart, use the Pitzer virial correlation Z = 1 + (B⁰ + ωB¹)Pr/Tr at moderate pressure, or solve Peng-Robinson. The compressibility factor calculator does all of this when you choose “Reduced Tr, Pr and ω”.

Is the compressibility factor the same as compressibility?

No. Z is a dimensionless correction to the ideal gas law. Isothermal compressibility, κ = −(1/V)(∂V/∂P) at constant T, has units of 1/pressure and describes how much the volume changes with pressure.

Is this compressibility factor calculator free?

Yes. It runs in your browser, needs no sign-up and does not store or send the values you enter.