Skip to content
Omnikalc

Gas compressibility factor calculator: how far is your gas from ideal?

Choose a gas, then enter the temperature and the pressure to get the compressibility factor Z, the real gas density and the error of the ideal gas law.

Updated on
Your inputs
°F

Value out of range

psia

Value out of range

Results

Compressibility factor Z

0.9378

A noticeable departure from the ideal gas law
Real gas density
1.510 lb/ft³
Ideal gas density
1.417 lb/ft³
Error of the ideal gas law
-6.2 %
Reduced temperature Tr
1.538
Reduced pressure Pr
0.750

Real gases depart from the ideal gas law, especially when the pressure is high or the temperature is low. This gas compressibility factor calculator finds the compressibility factor Z of five common gases from the temperature and the pressure, with the Pitzer virial correlation. It gives the real gas density, the ideal gas density, the error of the ideal law and the reduced conditions.

How the calculation works

  • Choose the gas and enter its temperature and absolute pressure.
  • The calculator divides them by the critical temperature and critical pressure of the gas to get the reduced values Tr and Pr.
  • It applies the Pitzer virial correlation: Z = 1 + (B⁰ + ω B¹) Pr / Tr, where B⁰ = 0.083 − 0.422 / Tr¹·⁶, B¹ = 0.139 − 0.172 / Tr⁴·² and ω is the acentric factor.
  • It gives Z, the real density (ρ = P M / (Z R T)) and the density that the ideal gas law would give.

Example

Methane at 68 °F and 500 psia has Tr = 293.15 / 190.56 = 1.538 and Pr = 34.47 / 45.99 = 0.750. The correlation gives Z = 0.938. The real density is 1.51 lb/ft³ (24.2 kg/m³), against 1.42 lb/ft³ for an ideal gas, so the ideal gas law is 6.2 % too low on the density.

Why it matters

The compressibility factor is a correction that engineers apply to gas volumes in storage, metering, compressors and pipelines. A quick estimate of Z shows whether the ideal gas law is good enough or whether a detailed equation of state is needed, and it gives a better mass of gas in a tank at high pressure.

Good to know

The correlation is for pure gases and does not apply to mixtures such as natural gas without mixing rules. It is a two-term virial equation, so it loses accuracy at high density, near the critical point and for polar gases. The critical constants are standard handbook values for the five gases in the list. The pressure is absolute, so add the local atmospheric pressure to a gauge reading.

The van der Waals equation calculator is another real-gas model, the ideal gas law calculator gives the reference case, the air density calculator covers the atmosphere, and the Clausius–Clapeyron calculator covers the vapor pressure of liquids.

Frequently asked questions

What is the compressibility factor?

It is the ratio Z = P V / (n R T) of the real volume of a gas to the volume of an ideal gas at the same pressure and temperature. Z = 1 for an ideal gas. Z below 1 means that attraction between molecules makes the gas denser than ideal, and Z above 1 means that repulsion makes it less dense.

What are the reduced temperature and pressure?

They are the temperature and the pressure divided by the values at the critical point of the gas. According to the law of corresponding states, gases with the same Tr and Pr have nearly the same Z. This is why one correlation can be used for many gases, with the acentric factor ω as a correction for the shape of the molecule.

When is the virial correlation reliable?

The two-term correlation is good for Tr above about 1.0 and moderate reduced pressure, roughly Pr below 1 to 2 or below Tr/2. Near the critical point or in a dense gas, an equation of state such as Peng–Robinson or the Lee–Kesler tables is needed. At low pressure, Z goes to 1.

Why does it matter for gas storage and flow?

A cylinder or a pipeline at high pressure holds more or less gas than the ideal law predicts. For methane near 500 psia the difference is 6 %, and at 3,000 psia it is much more. Meter readings, tank capacity and compressor power are all calculated with Z.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.