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 Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
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
-
Dimensionless
Ideal Gas Volume
-
nRT/P (same units as input)
Deviation from Ideal
-
(Z - 1) as percentage
Behaviour
-
Relative to ideal gas

Calculation Breakdown

Pressure (P)-
Volume (V)-
Amount (n)-
Temperature (T)-
Gas constant (R)-
PV (numerator)-
nRT (denominator)-
Z = PV / nRT-

Interpretation

Ideal gas Z1.0000 (exact)
Your Z-
Z < 1: attractive forces-
Z > 1: repulsive forces-
Volume vs ideal-
Overall deviation-
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.

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use

Reviewed and maintained. Last reviewed 2026-07-19 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.