Compressibility Factor Calculator
Solve the real-gas equation of state Z = PV / (nRT) for any of its five variables — the compressibility factor, pressure, volume, moles, or temperature — with step-by-step algebra, a live piston-cylinder schematic, real-gas comparisons via the van der Waals equation, and full reference tables.
Predicted Z from the van der Waals equation for common gases at your pressure and temperature. Gases with low critical temperature (He, H₂) stay near ideal; gases near or above their critical pressure (CO₂, NH₃) deviate strongly.
Z is a correction factor for non-ideality
The ideal gas law PV = nRT assumes molecules have no volume and exert no forces on each other. Real molecules do both. The compressibility factor Z measures how wrong that assumption is at the current conditions — it is the ratio of the actual molar volume to the ideal molar volume. A Z of 0.9 means the gas occupies 10% less space than ideal (intermolecular attraction pulls molecules together); a Z of 1.1 means it occupies 10% more (molecular volume pushes them apart). Real gas equations like van der Waals, Redlich-Kwong, and Peng-Robinson all aim to predict Z accurately.
Low pressure, high temperature → Z ≈ 1
At low pressure (below a few atmospheres) molecules are far apart, so both their finite volume and their mutual attraction become negligible. At high temperature, molecules move fast enough that attractive forces cannot hold them together long enough to matter. The combined regime — low P and high T relative to the gas's critical point — is where Z sits closest to 1 and the ideal gas law works best. This is why the ideal gas law is a good approximation for air at ambient conditions but fails badly for steam in a boiler or CO₂ in a high-pressure pipeline.
Z < 1 means attraction wins; Z > 1 means repulsion wins
In the low-to-moderate pressure range, attractive forces dominate and Z drops below 1 — the gas is more compressible than ideal because molecules are pulling each other inward. At high pressure, molecules are packed so tightly that their finite size becomes the dominant effect and Z rises above 1. The result is that Z passes through a minimum at intermediate pressures (typically 50–150 atm depending on temperature). For example, nitrogen at 0°C has Z ≈ 0.997 at 10 atm, ≈ 0.98 at 100 atm, rises through 1.0 around 300 atm, and reaches 1.25 at 1000 atm.
Real-gas engineering needs accurate Z values
In chemical process design, pipeline transport, and gas storage, using Z = 1 when it is actually 0.7 or 1.3 leads to errors in equipment sizing, compressor duty, and safety margins that can be catastrophic. The petroleum industry uses the Standing-Katz generalized compressibility chart (Z as a function of reduced pressure and temperature) as the industry standard, with the Pitzer acentric factor correction for non-hydrocarbon gases. Modern process simulators use cubic equations of state (Peng-Robinson, Soave-Redlich-Kwong) with binary interaction parameters to predict Z to within 1–3% across a wide range of conditions.
How to Use This Calculator
The compressibility factor Z is defined by the real-gas equation of state Z = PV/(nRT). Enter four of the five variables and the calculator solves for the fifth.
1. Choose what to solve for
Select Z, P, V, n, or T from the toggle. The calculator rearranges Z = PV/(nRT) algebraically for whichever variable you choose — no iterative solving needed.
2. Enter values with the right units
Each field has its own unit selector. Pressure can be Pa, kPa, MPa, bar, atm, psi, or mmHg. Volume in m³, L, mL, cm³, or ft³. Amount in mol, kmol, or lbmol. Temperature in K, °C, °F, or °R. The calculator converts everything to SI internally.
3. Use absolute pressure and temperature
Z requires absolute pressure (not gauge) and absolute temperature (not Celsius or Fahrenheit directly — the calculator handles that conversion). If your pressure gauge reads 10 bar, the absolute pressure is about 11 bar — add atmospheric pressure.
4. Read the result and Z-scale
The result card shows Z along with a colour-coded verdict: near-ideal (0.99–1.01), attractive-dominated (Z < 1), or repulsive-dominated (Z > 1). The horizontal scale shows exactly where your Z sits between 0.1 and 3.0.
5. Check the schematic and real-gas comparison
The piston-cylinder schematic shows how V and P relate to the physical gas. In advanced mode, the real-gas comparison table uses the van der Waals equation to estimate Z for He, H₂, N₂, O₂, CH₄, CO₂, NH₃, and H₂O at your exact conditions.
6. Switch to Advanced for depth
Advanced mode adds Z vs V and Z vs n charts, a sensitivity panel showing partial derivatives, the real-gas comparison table, and companion metrics including molar volume, deviation from ideal, and reduced conditions.
What This Tool Offers
Built around the real-gas equation of state Z = PV/(nRT), the fundamental correction to the ideal gas law.
Five-way solving
Solve for Z, P, V, n, or T. All five rearrangements are handled algebraically, so no iteration is needed and results are exact.
Full unit flexibility
Seven pressure units, five volume units, three amount units, and four temperature scales — all converted internally to SI for the calculation.
Live piston-cylinder schematic
A physical schematic showing the gas in a cylinder with a movable piston, molecule density scaled by n, and a marker on the Z-scale showing where your value sits.
Real-gas comparison
See what Z would be for eight common gases at your pressure and temperature, computed via the van der Waals equation — so you know which gases are close to ideal and which deviate strongly.
Four coordinated charts
Z vs P (linear), Z vs T (hyperbolic), Z vs V (linear), and Z vs n (hyperbolic) — each plotted with your current operating point marked.
Reference tables
A gas constant reference table in seven unit systems, critical constants for common gases, typical Z values across pressure ranges, and a complete variable reference.
Reference Tables & Conversions
A gas constant reference in multiple unit systems, critical constants for common gases, and typical Z values across pressure.
Universal Gas Constant (R) in Various Unit Systems
The same physical constant expressed in different units. Choose the value that matches your pressure and volume units.
| Units | Value of R | Typical use |
|---|---|---|
| J/(mol·K) | 8.314462618 | SI base — with Pa and m³ |
| Pa·m³/(mol·K) | 8.314462618 | Same as J/(mol·K) |
| kPa·L/(mol·K) | 8.314462618 | Common in chemistry |
| L·atm/(mol·K) | 0.082057 | Classic chemistry textbook |
| L·bar/(mol·K) | 0.0831446 | Common in European industry |
| L·mmHg/(mol·K) | 62.3636 | Legacy medical/vacuum |
| cal/(mol·K) | 1.98588 | Nutrition and biology |
| ft³·psi/(lbmol·°R) | 10.7316 | US customary engineering |
| ft³·atm/(lbmol·°R) | 0.73024 | US gas industry |
| BTU/(lbmol·°R) | 1.98588 | US HVAC |
Critical Constants of Common Gases
Critical temperature and pressure define the reduced properties used in generalized compressibility charts. Gases with low critical temperature (He, H₂) behave nearly ideally at room conditions.
| Gas | Tc (K) | Pc (bar) | Vc (L/mol) | ω (acentric) | Behavior at 25°C, 1 atm |
|---|
Typical Compressibility Factors Across Pressure
Z values for common gases at 300 K across a range of pressures. Values below 1 indicate attractive forces dominate; values above 1 indicate molecular volume dominates.
| Gas | 1 atm | 10 atm | 50 atm | 100 atm | 300 atm | 1000 atm |
|---|
Variable Reference
| Symbol | Meaning | Typical range | Units |
|---|---|---|---|
| Z | Compressibility factor | 0.2 – 2.0 | dimensionless |
| P | Absolute pressure | 10² – 10⁸ | Pa (or kPa, bar, atm) |
| V | Volume | 10⁻⁴ – 10 | m³ (or L, cm³) |
| n | Amount of substance | 10⁻³ – 10⁵ | mol (or kmol, lbmol) |
| R | Universal gas constant | 8.314 (SI) | J/(mol·K) |
| T | Absolute temperature | 10 – 3000 | K (or °R) |
| Vm | Molar volume | 0.02 – 1 | L/mol |
| Vm,ideal | Ideal molar volume | RT/P | L/mol |
| Pr | Reduced pressure | P/Pc | dimensionless |
| Tr | Reduced temperature | T/Tc | dimensionless |
What Does the Compressibility Factor Measure?
The compressibility factor Z is a dimensionless correction that quantifies how much a real gas deviates from ideal behaviour. Under the ideal gas law, PV = nRT, so the ratio PV/(nRT) is exactly 1. Real gases, however, have molecules with finite size and with attractive and repulsive forces between them, so PV/(nRT) is not 1 — it is Z. When Z equals 1, the gas behaves ideally. When Z is less than 1, attractive forces dominate and the gas occupies less volume than ideal. When Z is greater than 1, molecular volume dominates and the gas occupies more volume than ideal. Engineers use Z to correct every real-gas calculation in chemical processing, gas pipelines, compressor design, and high-pressure storage.
Compressibility Factor Formula
The defining relationship is a simple ratio:
where P is absolute pressure, V is volume, n is moles, R is the universal gas constant (8.314462618 J/(mol·K) in SI), and T is absolute temperature. Rearranged to solve for the other four variables:
V = Z·n·R·T / P
n = P·V / (Z·R·T)
T = P·V / (Z·n·R)
The molar volume and its ideal counterpart follow directly:
Vm,ideal = R·T / P
Z = Vm / Vm,ideal
Reduced properties — the basis of generalized compressibility charts — are:
Compressibility Variables
| Symbol | Meaning | Notes |
|---|---|---|
| Z | Compressibility factor | Ratio of real to ideal molar volume |
| P | Absolute pressure | Use gauge + atmospheric for absolute |
| V | Total volume | Volume of the container |
| n | Moles of gas | Moles = mass / molar mass |
| R | Universal gas constant | 8.314 J/(mol·K) in SI |
| T | Absolute temperature | Kelvin or Rankine, never °C or °F |
| Vm | Molar volume | V/n; the volume per mole of gas |
| Tr, Pr | Reduced T and P | Inputs to the generalized compressibility chart |
How Each Variable Affects Z
The formula Z = PV/(nRT) is linear in P and V, and inverse-linear in n and T. Because Z is the quantity being calculated, these relationships describe how Z changes when the other four variables are held fixed — which is exactly what happens in different types of thermodynamic processes. Holding V, n, and T constant while raising P raises Z proportionally. Holding P, n, and T constant while raising V does the same. Holding P, V, and T constant while raising n lowers Z. Holding P, V, and n constant while raising T lowers Z.
In practice, however, real processes usually hold different variables fixed, which is why real-gas Z curves bend rather than being simple straight lines. On an isotherm (constant T), as P is raised, V decreases faster than 1/P — the Z vs P curve dips below 1 at moderate pressures and rises above 1 at high pressures. On an isobar (constant P), as T is raised, V increases faster than T — the Z vs T curve rises toward 1. The simple linear relationship Z = PV/(nRT) describes only what happens when the other three variables stay fixed.
Compressibility Factor Examples
P = 101325 Pa, V = 0.0224 m³, n = 1 mol, T = 273.15 K
nRT = 1 × 8.314 × 273.15 = 2271.0 J
PV = 101325 × 0.0224 = 2269.7 J
Z = 2269.7 / 2271.0 = 0.9994 (near-ideal)
P = 10132500 Pa, V = 0.0032 m³, n = 10 mol, T = 373.15 K
nRT = 10 × 8.314 × 373.15 = 31025 J
PV = 10132500 × 0.0032 = 32424 J
Z = 32424 / 31025 = 1.045 (slightly repulsive)
P = Z·n·R·T / V = 0.85 × 5 × 8.314 × 300 / 0.05
= 0.85 × 12471 / 0.05 = 212,000 Pa ≈ 2.1 bar
T = P·V / (Z·n·R) = 5e6 × 0.02 / (1.05 × 3 × 8.314)
= 100000 / 26.19 = 3819 K
Frequently Asked Questions
Z is the ratio of the actual volume a real gas occupies to the volume an ideal gas would occupy at the same P, T, and n. It matters because the ideal gas law is wrong for real gases — sometimes by only 1% (air at room conditions), sometimes by 30% or more (CO₂ at 100 atm, steam at high pressure). Any engineering calculation involving real gases — compressor sizing, pipeline flow, gas storage, distillation column design, refrigeration cycles — needs Z to be correct. Using Z = 1 when the actual Z is 0.7 means your equipment will be undersized by 30%, which in high-pressure systems can be dangerous.
Two competing effects determine Z. Intermolecular attraction pulls molecules together, making the gas more compressible than ideal and driving Z below 1. Molecular volume (the finite size of molecules) prevents them from being packed too tightly, making the gas less compressible than ideal and driving Z above 1. At moderate pressure, molecules are close enough for attraction to matter but not so close that their size dominates — so Z dips below 1. At high pressure, molecules are packed so tightly that their finite size becomes the dominant effect, and Z rises above 1. The crossover point depends on the gas and temperature but is typically in the 100–300 atm range.
Reduced pressure Pr = P/Pc and reduced temperature Tr = T/Tc, where Pc and Tc are the gas's critical pressure and temperature. The critical point is where liquid and gas become indistinguishable. Reduced properties normalise a gas's behaviour to its own critical point, which turns out to be a powerful insight: gases with the same Pr and Tr have nearly the same Z. This "corresponding states" principle is the basis of the generalized compressibility charts used throughout engineering. For example, N₂ at 25°C and 50 atm has Tr = 298/126 = 2.36 and Pr = 50/34 = 1.47 — and any other gas at the same reduced conditions will have a similar Z.
There is no single best equation — accuracy depends on the gas and conditions. The van der Waals equation (1873) is the simplest and is used in this calculator for the real-gas comparison table; it captures the qualitative behaviour but has ~5–10% error near the critical point. Redlich-Kwong and its modification by Soave (SRK) are more accurate for hydrocarbons. Peng-Robinson (1976) is the industry standard in process simulation and works well for natural gas, petroleum fluids, and light gases. Benedict-Webb-Rubin (BWR) and Lee-Kesler are more complex but more accurate over wide ranges. For very high accuracy (reference quality), multi-parameter equations like IAPWS-95 for water or the GERG-2008 for natural gas are used, but they require extensive data tables.
The Standing-Katz chart and its Nelson-Obert refinements plot Z on the y-axis against reduced pressure Pr on the x-axis, with a family of curves for different reduced temperatures Tr. To use it: (1) look up the gas's critical temperature and pressure, (2) compute Pr = P/Pc and Tr = T/Tc, (3) find the curve for your Tr, (4) read the Z value at your Pr. For gases with a significant acentric factor (ω > 0.1, like CO₂ or water), a correction using Pitzer's correlation Z = Z⁰ + ω·Z¹ improves accuracy. The chart covers Pr from 0 to about 15 and Tr from 1.0 to 3.0, which spans most engineering applications.
Yes — "compressibility factor," "deviation factor," and "Z-factor" all refer to the same quantity. The gas industry often calls it the Z-factor or deviation factor. In some texts the reciprocal 1/Z is called the "supercompressibility ratio" and appears in gas-metering equations (the "supercompressibility factor" Fpv is √(1/Z) in AGA-8). The terminology can be confusing, but all of them are derived from the same underlying Z = PV/(nRT). When someone says "the Z-factor of this gas is 0.85," they mean exactly the quantity this calculator computes.
For most gases, Z is within 1% of unity when the pressure is below about 5 atm and the temperature is well above the gas's critical temperature (say Tr > 2). Air at room temperature and pressure has Z ≈ 0.9995. Nitrogen at 10 atm and 300 K has Z ≈ 0.997. If your calculations require better than 1% accuracy, or your conditions are above 5–10 atm, or the gas has a critical temperature near or above the operating temperature (like CO₂, NH₃, or steam), you need to use a real Z value. As a rough rule of thumb: if the pressure is more than 10% of the gas's critical pressure, real-gas corrections start to matter.
Variables
| Symbol | Quantity | Unit |
|---|---|---|
| Z | Compressibility factor | |
| P | Absolute pressure | atm |
| V | Molar volume | L/mol |
| n | Moles of gas | mol |
| R | Universal gas constant | 0.08206 L.atm/mol.K |
| T | Absolute temperature | K |
What it means
The compressibility factor Z is a correction factor that accounts for the non‑ideal behaviour of real gases. It is defined as Z = PV/(nRT), where P is pressure, V is volume, n is moles, R is the gas constant, and T is temperature. For an ideal gas, Z = 1. For real gases, Z can be less than 1 (indicating intermolecular attraction reduces volume) or greater than 1 (repulsion forces dominate). Z is a function of temperature and pressure, and is often correlated using the principle of corresponding states (reduced temperature and pressure) or via equations of state like van der Waals, Peng‑Robinson, or Soave‑Redlich‑Kwong. The compressibility factor is essential for accurate calculations of gas properties in pipelines, compressors, and chemical reactors. It is also used in thermodynamic property estimation, such as enthalpy and entropy departures. Understanding Z is crucial for process design in the oil and gas, petrochemical, and power generation industries, where gases often deviate significantly from ideal behaviour.
Worked example
Compressibility Factor – Two Examples
Real‑World| Parameter | Value |
|---|---|
| P | 1 atm |
| V | 22.4 L/mol |
| T | 273 K |
| Parameter | Value |
|---|---|
| P | 50 atm |
| V | 0.4 L/mol |
| T | 300 K |
Common mistakes
- Pressure P: Absolute pressure, not gauge.
- Temperature T: In Kelvin.
- Volume V: In m³, molar volume in m³/mol.
- Ideal gas constant R: 8.314 J/(mol·K) – ensure units match.
- Z = 1 for ideal gas: Deviation increases at high pressure and/or low temperature; use an equation of state for accurate Z.
Applications
The compressibility factor, Z = PV/(nRT), corrects the ideal gas law for real gas behaviour. It is a function of temperature and pressure, with Z=1 for ideal gases, Z<1 indicating attractive forces dominate (usually at moderate pressures), and Z>1 indicating repulsive forces (at high pressures). Engineers use Z in calculations involving gases at high pressure, such as in natural gas pipeline design, compressors, and chemical reactors. It is essential for accurate volumetric flow rates, equipment sizing, and process design. Charts or equations of state (e.g., Peng‑Robinson) provide Z values. By using the compressibility factor, professionals can ensure safe and efficient design of gas handling and processing systems.
- Design of natural gas pipelines and storage facilities
- Sizing of compressors and gas expanders
- Process simulation of high‑pressure chemical reactors
- Calculation of gas densities and flow rates in custody transfer
- Safety analysis for gas pressurised systems and relief devices
Related calculators · Process Design
Recently updated formulas
Suggest an improvement
Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.