Compressibility Factor (Z) Calculator

This calculator works out the compressibility factor Z for a real gas, the number engineers and chemists use to describe how far a gas's actual behaviour departs from the ideal gas law. Using the formula Z = PV / (nRT), it compares the pressure-volume product you measure against what an ideal gas would produce at the same temperature and amount. You enter pressure (in atm, Pa, kPa, bar or psi), volume (in litres, cubic metres, millilitres or cubic centimetres), the amount of gas in moles, and temperature (in Kelvin or Celsius), then choose how many decimal places to show. The calculator converts everything into consistent units before calculating. It returns the compressibility factor Z itself, the ideal gas volume the same conditions would predict, the percentage deviation from ideal behaviour, and a plain-English behaviour reading showing whether attractive or repulsive intermolecular forces dominate. A full calculation breakdown shows each step from PV and nRT through to the final ratio, alongside an interpretation panel and a worked example matching the default values. Remember that temperature must be entered as an absolute value, since using Celsius directly in the formula gives a meaningless result. This tool is intended for educational and general scientific estimation; for critical applications such as natural gas pipeline or reservoir calculations, use validated equation-of-state software designed for the specific gas mixture involved.

Calculate.co.nz is proud to be partnered with Premium Homes, a recognised leader in eco-friendly, sustainable, and energy-efficient homebuilding. With a dedicated team and award-winning experience, they create homes that prioritise health, comfort, and long-term performance. Their founders, Andrew and Kelly, set out to raise the standard of residential construction in New Zealand by combining practical building expertise with a clear commitment to doing things better for homeowners.
Calculate.co.nz partner: Premium Homes
Advertise on this page
Standard formula  Z = PV / (nRT). R = 8.314462 J mol-1 K-1 (SI) or 0.082057 L atm mol-1 K-1.

1. Gas Conditions

atm
L
mol
K

2. Units

Compressibility Factor Result

Compressibility Factor Z
0.8124
Dimensionless
Ideal Gas Volume
2.4617 L
nRT/P (same units as input)
Deviation from Ideal
-18.76%
(Z - 1) as percentage
Behaviour
Attractive forces
Relative to ideal gas

Calculation Breakdown

Pressure (P)10 atm (10.0000 atm)
Volume (V)2 L (2.0000 L)
Amount (n)1 mol
Temperature (T)300 K (300.00 K)
Gas constant (R)0.082057 L atm mol−1 K−1
PV (numerator)20.0000 L atm
nRT (denominator)24.6171 L atm
Z = PV / nRT0.8124

Interpretation

Ideal gas Z1.0000 (exact)
Your Z0.8124
Z < 1: attractive forcesYes (Z < 1)
Z > 1: repulsive forcesNo
Volume vs ideal0.4617 L smaller than ideal
Overall deviation-18.76%
Result: Enter values above to calculate.

Worked Example (matching the calculator defaults)

Given: P = 10 atm, V = 2.0 L, n = 1 mol, T = 300 K

Using R = 0.082057 L atm mol-1 K-1:

nRT = 1 × 0.082057 × 300 = 24.6171 L atm

PV = 10 × 2.0 = 20.0000 L atm

Z = PV / nRT = 20.0000 / 24.6171 = 0.8124

Z < 1: this gas is more compressible than ideal. Attractive intermolecular forces are dominant at these conditions, pulling molecules closer together so the actual volume is smaller than the ideal gas prediction of 2.4617 L.

What is the Compressibility Factor?

The compressibility factor Z (also called the gas deviation factor or compression factor) is a dimensionless number that describes how much a real gas deviates from ideal gas behaviour. It is defined by the equation:

Z = PV / (nRT)

where P is the absolute pressure, V is the volume, n is the number of moles, R is the universal gas constant, and T is the absolute temperature in Kelvin. For a perfect (ideal) gas, Z = 1 exactly. Real gases deviate from this value depending on temperature, pressure, and the nature of the gas molecules.

Why Z Differs from 1

The ideal gas law assumes molecules have no volume of their own and exert no forces on each other. Real molecules break both assumptions:

The Formula

Starting from the ideal gas law PV = nRT, the compressibility factor is simply the ratio of the real gas PV product to the ideal gas PV product:

Z = PV / (nRT)

Rearranging, the real gas equation of state is:

PV = ZnRT

This means the ideal gas law with a correction factor Z. Engineers use this in petroleum and natural gas work to calculate how much gas a reservoir or pipeline actually holds under real conditions.

Units and Gas Constant

Pressure unitVolume unitR value
Pa (pascals)8.314462 J mol-1 K-1
atmL0.082057 L atm mol-1 K-1
barL0.083145 L bar mol-1 K-1

Temperature must always be in Kelvin (K = degC + 273.15) because the ideal gas law requires absolute temperature. Using Celsius will give a completely wrong result.

Typical Z Values for Common Gases

GasConditionsApproximate Z
Nitrogen (N2)25 degC, 1 atm1.0000
Carbon dioxide (CO2)25 degC, 1 atm0.9950
Methane (CH4)25 degC, 100 atm0.877
Hydrogen (H2)25 degC, 100 atm1.068
Ammonia (NH3)25 degC, 10 atm0.956
Water vapour200 degC, 1 atm0.985

Note: hydrogen and helium have Z > 1 even at moderate pressures because their quantum mechanical properties cause repulsive interactions to dominate earlier than for most other gases.

Applications

The compressibility factor is used extensively in natural gas engineering to calculate reservoir capacity, pipeline capacity, and gas meter correction factors. It also appears in thermodynamics, chemical engineering process design, and atmospheric science. For most everyday engineering purposes at near-atmospheric pressures, Z is close enough to 1 that the ideal gas law is a good approximation.

Related Calculators

Method: Z = PV / (nRT) using R = 0.082057 L atm mol-1 K-1 (atm/L inputs) or R = 8.314462 J mol-1 K-1 (Pa/m3 inputs). All unit conversions applied before calculation. Source: NIST Chemistry WebBook, "Compressibility Factor" definition; IUPAC Green Book (2007) Section 2.11.

This calculator is for educational and scientific estimation purposes. For critical engineering applications such as natural gas pipeline and reservoir calculations, use validated equation-of-state software with appropriate correlations for the specific gas mixture.