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.
Compressibility factor calculator from measured P, V, T
Compressibility factor calculator: Pitzer virial correlation
Compressibility factor calculator: Peng-Robinson Z and chart
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?
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:
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:
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 condition | Tr | Pr | Z (reference) |
|---|---|---|---|
| Air, 25 °C, 1 atm | 2.26 | 0.027 | 1.000 |
| Nitrogen, 20 °C, 200 bar | 2.32 | 5.89 | 1.052 |
| Methane, 25 °C, 100 bar | 1.56 | 2.17 | 0.852 |
| Methane, −23 °C, 50 bar | 1.31 | 1.09 | 0.836 |
| CO₂, 47 °C, 60 bar | 1.05 | 0.81 | 0.713 |
| n-Butane, 510 K, 25 bar | 1.20 | 0.66 | 0.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?
| Method | Good for | Limits |
|---|---|---|
| Measured PVT data (panel 1) | Calibrating models, checking cylinder contents, lab data | Needs accurate P, V, T and mass |
| Pitzer virial correlation (panel 2) | Quick hand calculations at low to moderate pressure, nonpolar gases | Only 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 EOS | Highest accuracy for design | Tables 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.
- Real Gas Calculator
- Ideal Gas Law Calculator
- Heat Capacity Calculator
- Specific Heat Calculator
- Pressure Drop Calculator
- All chemical engineering calculators
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.