What Happens When a Gas Is Compressed?

When a gas is compressed, its particles are forced into a smaller space, which increases pressure, raises density, and (depending on conditions) can increase temperature. Because gas is mostly empty space between fast-moving particles, it can be squeezed down dramatically compared to liquids or solids. What happens next depends on how quickly the compression occurs, whether heat can escape, and how much pressure is applied.

Why Gases Can Be Compressed at All

In a gas, the individual molecules are spread far apart relative to their size. Most of the volume inside a container of gas is simply empty space. This is fundamentally different from a liquid or solid, where molecules are already packed closely together. That empty space gives you room to push the molecules closer, which is why you can squeeze air into a tire or a scuba tank but can’t meaningfully compress a cup of water.

Pressure Increases as Volume Shrinks

The most immediate effect of compressing a gas is a rise in pressure. When you reduce the volume of a container, the gas molecules don’t slow down, but they have less distance to travel before hitting a wall. They collide with the container walls more frequently, and each square inch of wall absorbs more impacts per second. That increased collision rate is what we measure as higher pressure.

This relationship follows a pattern known as Boyle’s Law: at a constant temperature, pressure and volume are inversely proportional. If you cut the volume in half, the pressure doubles. The math is straightforward: P1 × V1 = P2 × V2. So a gas occupying 10 liters at 1 atmosphere of pressure will exert 2 atmospheres if compressed to 5 liters, as long as the temperature stays the same.

Temperature Rises During Rapid Compression

Keeping temperature constant during compression is the textbook scenario, but in practice, compressing a gas quickly heats it up. When you push a piston into a cylinder, you’re doing mechanical work on the gas. That energy has to go somewhere. If the compression happens fast enough that heat can’t escape to the surroundings, all of that work converts directly into internal energy, raising the temperature of the gas. Physicists call this an adiabatic process.

You’ve felt this if you’ve ever touched the bottom of a bicycle pump after inflating a tire. The pump gets noticeably hot. The first law of thermodynamics explains why: the energy you put in by pushing the handle increases the kinetic energy of the air molecules inside, and faster-moving molecules mean a higher temperature. This same principle is why diesel engines work. Air is compressed so rapidly and forcefully that it reaches temperatures high enough to ignite fuel without a spark plug.

This heating effect matters in practical settings too. When scuba tanks are filled with high-pressure air, the compression generates heat. Dive shops typically let a freshly filled cylinder cool for about an hour before topping it off, because as the gas cools back to room temperature, the pressure drops (roughly 0.6 bar for every degree Celsius of cooling). A tank that reads full while hot will show a lower pressure once it cools down.

Density Increases

Since compression forces the same number of molecules into a smaller space, the density of the gas rises. This is a straightforward consequence: mass stays constant while volume decreases, so mass per unit volume goes up. At twice the pressure (and constant temperature), a gas has twice the density. This is why compressed air tanks can hold enough breathable gas for an hour-long dive in a cylinder you can carry on your back.

Enough Compression Can Turn Gas Into Liquid

If you compress a gas far enough and the temperature is low enough, the molecules will be pushed so close together that attractive forces between them take over, and the gas condenses into a liquid. This is how propane is stored in tanks and how industrial gases like oxygen and carbon dioxide are transported.

There’s a catch, though. Every substance has a critical temperature above which no amount of pressure will liquefy it. For carbon dioxide, that threshold is about 31°C, which is close to room temperature. For water, it’s 374°C. For oxygen, it’s a frigid -119°C, which is why liquefying oxygen requires both high pressure (about 50 atmospheres at the critical point) and serious cooling. Above the critical temperature, the gas enters a strange state called a supercritical fluid, which has properties of both a gas and a liquid but won’t fully condense no matter how hard you squeeze.

Real Gases Behave Differently Under Extreme Pressure

The simple rules above assume gas molecules are tiny points with no volume and no attraction to each other. That’s a useful simplification at everyday pressures, but it breaks down when compression gets extreme.

At very high pressures, two things happen that the simple model doesn’t predict. First, the molecules themselves take up a meaningful fraction of the total space. You can’t compress the gas as much as the simple equations suggest because the molecules have actual physical volume that can’t be squeezed away. This makes the real gas occupy more space than the idealized math predicts.

Second, molecules do attract each other slightly. At moderate compression, this attractive force pulls molecules inward and reduces the pressure slightly below what you’d calculate from the simple model. Carbon dioxide is a good example: as you compress it, the measured pressure initially falls below the idealized prediction because CO2 molecules attract each other relatively strongly. But at very high pressures, the volume effect dominates, and the real pressure climbs above the prediction.

These competing effects are why engineers working with high-pressure systems use more complex equations that account for molecular size and intermolecular attraction, rather than relying on the simplified version taught in introductory courses.

Energy Is Stored in Compressed Gas

Compressing a gas requires work, and that energy doesn’t disappear. It’s stored in the gas as increased internal energy (in the case of rapid compression) or transferred out as heat (in slow compression). This is why compressed gas is genuinely an energy storage medium. When you release the gas, it expands, does work on its surroundings, and cools down. Pneumatic tools, air brakes, and pressurized spray cans all rely on this stored energy to function.

The amount of work needed to compress a gas depends on the external pressure applied. You have to push harder than the gas pushes back. The greater the pressure difference between outside and inside, the more energy it takes to force the gas into a smaller volume, and the more energy is available when the gas expands again.