The compressibility factor, written Z, is the ratio of a gas's actual molar volume to the molar volume an ideal gas would occupy at the same temperature and pressure. It is a single dimensionless number that says how far reality has departed from PV = nRT, and in which direction. The calculator above returns it either from measured data or from a van der Waals prediction.
Arb Digital builds free physics calculators that own one job cleanly. The boundary here matters: the ideal gas law calculator on this site solves PV = nRT for whichever variable you are missing, and it assumes ideality throughout. This page does the opposite. It reports the deviation ratio from ideality rather than solving the ideal equation, and it is the tool you reach for once you suspect the ideal answer is wrong.
What This Compressibility Factor Calculator Does
In measured mode it applies the definition directly: Z = PVm ÷ RT. You supply a pressure, a temperature and a molar volume that you have measured or obtained from a property database, and the tool returns Z along with the ideal molar volume for comparison and the percentage by which reality departs from it.
In van der Waals mode it goes the other way. You supply the two van der Waals constants for your gas plus a pressure and a temperature, and the tool solves the van der Waals equation for the molar volume and reports the resulting Z. It also derives the critical temperature and critical pressure implied by those constants and reports the reduced conditions, which is what the corresponding-states approach needs.
The grid always shows both molar volumes side by side, because that comparison is what Z actually means. A Z of 0.80 is not an abstraction: it says the gas occupies four fifths of the space an ideal gas would, and if you sized a vessel from the ideal law you have overestimated the volume required by a quarter.
How to Use It
- Prefer measured mode when you have data. The definition needs no model and no assumptions, so it is exact by construction. Any error in the answer is an error in your inputs.
- Keep units consistent with the gas constant shown. The tool works in bar, litres per mole and kelvin, using R = 0.0831446 L·bar per mole kelvin. Convert before entering, not after.
- Use absolute temperature. Celsius in the temperature box will give an answer that is wrong by a large and unobvious factor, and at low temperatures it can even change the sign.
- Take van der Waals constants from a published table. They are specific to each gas and are fitted quantities, not fundamental constants.
- Read the reduced conditions. Two different gases at the same reduced temperature and pressure have similar compressibility factors, which is the whole basis of generalised charts.
The Formula: How Z Is Calculated
The definition is Z = PVm ÷ RT, where Vm is the molar volume. Rearranged, the real gas equation becomes PV = ZnRT, which shows exactly what Z is doing: it is a correction factor multiplying the ideal answer. OpenStax Chemistry 2e, section 9.6 on non-ideal gas behaviour, defines Z as the ratio of the measured molar volume to the ideal molar volume at the same temperature and pressure and gives the van der Waals equation alongside it.
Work the defaults. At 100 bar and 300 K the ideal molar volume is RT ÷ P = 0.0831446 × 300 ÷ 100 = 0.24943 L/mol. With a measured molar volume of 0.200 L/mol, Z = 0.200 ÷ 0.24943 = 0.8018. The gas occupies about 20 per cent less space than the ideal law predicts, so attraction between the molecules is winning.
The van der Waals equation is (P + a ÷ Vm²)(Vm − b) = RT. Solving it for Vm at a given P and T means finding the root of a cubic, which the tool does numerically starting from the ideal volume. The critical constants follow analytically from the same two parameters: Tc = 8a ÷ 27Rb and Pc = a ÷ 27b².
Check that with the default constants, which are the published van der Waals values for carbon dioxide. Tc = 8 × 3.640 ÷ (27 × 0.0831446 × 0.04267) = 304 K, and Pc = 3.640 ÷ (27 × 0.04267²) = 74.0 bar. Both are within a fraction of a per cent of the measured critical point of carbon dioxide, which is a fair demonstration that the model captures the right physics even where it is quantitatively approximate. Precise experimental values for real fluids are available from the NIST Chemistry WebBook thermophysical properties of fluid systems.
Why Z Goes Below One and Then Above It
Two competing effects set the value of Z, and which one wins depends on the conditions. Intermolecular attraction pulls molecules toward each other, which reduces the pressure they exert on the container relative to an ideal gas and lets the gas be compressed into a smaller volume. That drives Z below one. Molecular volume works the other way: the molecules occupy space that is not available for compression, which makes the gas harder to squeeze and drives Z above one.
At moderate pressures attraction usually dominates and Z dips below one. As pressure rises further the molecules are pushed close enough together that their own volume becomes the limiting factor, Z turns around and climbs, and at high enough pressure it exceeds one and keeps rising. Plotting Z against pressure for almost any gas produces that characteristic dip-and-rise curve.
Temperature shifts the balance. At high temperature the molecules have enough kinetic energy that the attractive wells barely deflect them, so the dip shallows and eventually vanishes; Z then rises monotonically from one. The temperature at which the initial slope of Z against pressure is zero is the Boyle temperature, and at that temperature a gas behaves ideally over a surprisingly wide pressure range.
Corresponding States and Why Reduced Conditions Matter
One of the more elegant results in the subject is that Z is approximately a universal function of reduced temperature and reduced pressure — that is, of T ÷ Tc and P ÷ Pc. Two chemically unrelated gases at the same reduced conditions have similar compressibility factors, which is why generalised compressibility charts exist and why a single chart can serve for many substances.
The reason is that the critical point encodes the scale of the intermolecular forces. Normalising by it removes most of what distinguishes one gas from another, leaving behaviour that is close to universal. The principle is approximate rather than exact, and it works best for small non-polar molecules; strongly polar substances such as water and ammonia, and quantum gases such as hydrogen and helium, depart from it noticeably.
This is why the tool reports reduced conditions in van der Waals mode. If your reduced temperature is well above two and your reduced pressure well below one, you are in territory where the ideal gas law is fine and Z will sit close to unity. If the reduced temperature is near one, you are close to the critical point, and no simple model will serve you well.
Where This Sits Among the Other Gas Tools
The clean division is between ideal and real. The ideal gas law calculator solves PV = nRT for a missing variable and assumes Z equals one throughout; the combined gas law calculator, the Boyle's law calculator and the Charles's law calculator handle the special cases of that same ideal relation. This page is where you go when that assumption is the thing you are questioning: multiply an ideal result by Z and you have the real answer. For mixtures, the partial pressure calculator and the mole fraction calculator handle composition, the molar mass calculator converts between mass and moles, and the pressure converter gets your inputs into bar.
Arb Digital builds free tools like this one because useful pages earn attention. If you want tools, calculators or content built for your own audience, we can help.
Browse All Free Tools Talk to Arb DigitalCommon Mistakes to Avoid
- Using Celsius or Fahrenheit for temperature — Z is defined with absolute temperature. A Celsius value produces a badly wrong ratio and near the freezing point can even produce a negative one.
- Mixing pressure units — the gas constant used here is in litre bar per mole kelvin. Entering pascals or atmospheres without converting scales the answer by orders of magnitude.
- Confusing molar volume with total volume — Z uses volume per mole. Feeding it a tank volume rather than a per-mole figure will not produce a number near unity.
- Trusting van der Waals near the critical point — the equation is qualitatively right but quantitatively poor in that region, and it misrepresents the shape of the coexistence curve.
- Assuming Z is constant for a gas — it is a function of both temperature and pressure, and it changes continuously. A single quoted value is meaningless without the conditions it applies to.
Related Free Tools From Arb Digital
Start with the ideal gas law calculator and apply Z to its result, or use the combined gas law calculator, the Boyle's law calculator and the Charles's law calculator for the classical special cases. For mixtures, use the partial pressure calculator and the mole fraction calculator. Convert between mass and amount with the molar mass calculator and the moles to grams calculator, and get your inputs into consistent units with the pressure converter. Everything Arb Digital publishes is listed on the free online tools hub.
Frequently Asked Questions
It is the ratio of a gas's actual molar volume to the molar volume an ideal gas would occupy at the same temperature and pressure. A value of one means ideal behaviour, below one means the gas is more compressible than ideal, and above one means it is less compressible.
Divide the product of pressure and molar volume by the product of the gas constant and absolute temperature. With pressure in bar, molar volume in litres per mole and temperature in kelvin, the gas constant is 0.0831446 litre bar per mole kelvin.
Because at high pressure the volume occupied by the molecules themselves becomes significant. That excluded volume cannot be compressed, so the gas resists compression more than an ideal gas would, and its actual molar volume exceeds the ideal prediction.
The ideal gas law solves PV equals nRT and assumes the compressibility factor is exactly one. This page reports how far from one it actually is. Multiply an ideal gas law result by Z and you convert an idealised answer into a real one.
It is the observation that gases at the same reduced temperature and reduced pressure, meaning the same fractions of their critical values, have approximately the same compressibility factor. It works well for small non-polar molecules and less well for polar substances such as water and ammonia.
At low pressure and well above the critical temperature, where the ideal gas law is accurate to about one per cent for common gases at ambient conditions up to a few bar. Accuracy degrades as pressure rises or as the temperature approaches the critical value.
It captures the qualitative behaviour well, including the dip below one and the eventual rise above it, and it reproduces critical constants to within a few per cent. Quantitatively it is only approximate, and near the critical point more sophisticated equations of state or measured data are needed.
This tool is provided for educational and preliminary engineering use. The van der Waals mode is a two-parameter model and is approximate, particularly near the critical point, so pressure-vessel, process and safety calculations should use measured property data or a validated equation of state reviewed by a qualified engineer.