The main cause of non-ideality in gases is intermolecular forces: the attractions and repulsions between gas molecules that the ideal gas law assumes don’t exist. A secondary cause, equally important under certain conditions, is the physical volume of the molecules themselves. Together, these two factors explain every significant deviation from ideal gas behavior.
The ideal gas law treats gas molecules as infinitely tiny points that never pull on or push against each other. That’s a useful simplification at everyday temperatures and low pressures, but it breaks down when molecules are forced close together or slowed down enough to “feel” each other’s presence.
Intermolecular Attractions: The Dominant Factor
All gas molecules exert weak attractive forces on their neighbors. At low pressures, molecules are far apart and these forces are negligible. But as pressure rises or temperature drops, molecules spend more time near each other, and those attractions start to matter. The pull between neighboring molecules slightly reduces the force with which they hit the walls of their container, so the measured pressure ends up lower than the ideal gas law predicts.
This effect is strongest at temperatures just above a gas’s boiling point, where molecules are moving slowly enough that attractions can significantly influence their paths after collisions. Faster-moving molecules (at higher temperatures) have enough kinetic energy to shrug off these attractions, which is why heating a gas pushes its behavior closer to ideal.
The strength of these attractions varies widely between gases. Water vapor, carbon dioxide, and ammonia have relatively strong intermolecular forces, which is why they deviate from ideal behavior more dramatically than gases like nitrogen or hydrogen. Ammonia, for instance, has an attraction constant roughly three times larger than nitrogen’s, reflecting the stronger pull between its molecules.
Molecular Volume: The High-Pressure Factor
The ideal gas law also assumes molecules take up zero space. At ordinary pressures, that’s reasonable because molecules occupy a tiny fraction of their container’s volume. But compress a gas enough and the molecules themselves start taking up a meaningful share of the available space.
When this happens, the gas becomes harder to compress than the ideal gas law predicts. The measured volume of the container includes both the space molecules can move through and the “excluded volume,” the space occupied by the molecules and the buffer zones around them where other molecules can’t go. That excluded volume is actually larger than the physical volume of the molecules alone, because two molecules can’t overlap or occupy the same spot.
This effect only becomes significant at high pressures. At moderate pressures, it’s the attractive forces that dominate deviations from ideal behavior.
How the Two Causes Compete
What makes real gas behavior interesting is that these two effects push in opposite directions. Intermolecular attractions make a gas more compressible than expected (molecules get pulled slightly closer together), while molecular volume makes a gas less compressible than expected (molecules physically can’t squeeze any tighter). The balance between them shifts depending on conditions.
Scientists track this balance using something called the compressibility factor, Z, calculated as PV/nRT. For a perfectly ideal gas, Z equals exactly 1. When attractive forces dominate, Z drops below 1 because the gas compresses more easily than predicted. When molecular volume dominates, Z rises above 1 because the gas resists compression.
At moderate pressures, most gases show Z values below 1, meaning attractions are winning. Push the pressure high enough and Z climbs above 1 as molecular volume takes over. Carbon dioxide illustrates this clearly: at moderate pressures its strong intermolecular attractions produce pressures lower than the ideal gas law predicts, but at very high pressures the volume of CO₂ molecules causes measured values to exceed ideal predictions.
When Gases Deviate the Most
Two conditions maximize non-ideal behavior: high pressure and low temperature. High pressure forces molecules close together, amplifying both the effect of attractions and the significance of molecular volume. Low temperature slows molecules down, making them less able to overcome attractive forces after collisions. Gases behave most ideally under the opposite conditions: low pressure and high temperature, where molecules are far apart and moving fast.
This is why gases like CO₂ and ammonia, which have strong intermolecular attractions and relatively large molecules, show pronounced deviations under conditions where hydrogen or helium (small molecules, weak attractions) still behave nearly ideally.
The Van der Waals Equation
In the 1870s, Johannes van der Waals modified the ideal gas law to account for both causes of non-ideality. His equation adds two constants for each gas. The constant “a” corrects for intermolecular attractions, and the constant “b” corrects for molecular volume. When both constants are zero, the equation reduces to the ideal gas law.
These constants are measured experimentally and vary by gas. A few examples show the pattern:
- Nitrogen: a = 1.39, b = 0.0391
- Carbon dioxide: a = 3.59, b = 0.0427
- Water vapor: a = 5.46, b = 0.0305
- Ammonia: a = 4.17, b = 0.0371
Higher “a” values mean stronger intermolecular attractions. Water vapor and ammonia top the list because they form hydrogen bonds, one of the strongest types of intermolecular attraction. Higher “b” values indicate larger effective molecular size. Notice that water vapor has a high “a” but a small “b,” meaning its deviations come primarily from attractions rather than molecular bulk.
A Real-World Consequence: Gas Cooling on Expansion
Non-ideality has a practical effect you encounter every time you use a refrigerator or air conditioner. When a real gas expands, its molecules move farther apart and must work against their mutual attractions. That work consumes energy, which comes from the gas’s own thermal energy, so the gas cools down. This is called the Joule-Thomson effect, and it only happens because of intermolecular forces. A truly ideal gas would not change temperature when expanding.
This cooling effect is strongest at temperatures just above a gas’s condensation point, where intermolecular attractions are most significant. Engineers exploit it deliberately in refrigeration systems, industrial gas liquefaction, and cryogenics. It’s one of the clearest demonstrations that non-ideality isn’t just an academic concept but a physical reality with everyday applications.

