If you shake up a soda pop and then open it, why does it explode?
(Lansing State Journal, November 11, 1992)
When you open a can or bottle of soda for the first time, you hear a familiar hiss. This is the sound of carbon dioxide gas escaping from the bottle. This gas is under pressure and it is this pressure that keeps the soda carbonated. When the cap is opened, the pressure on the contents of the bottle suddenly decreases and when the pressure on a gas decreases it expands taking up more space. It is this sudden change in pressure and sudden expansion of the gas that forces the gas out of the container. Usually this gas has collected at the top of the can or bottle and when the container is opened it escapes with no more than a hiss.
If the bottle is shaken, the gas which was at the top is mixed through the soda. When you stop shaking the bottle, most of this gas returns to the top of the container. However, small bubbles of the gas get stuck all over the sides of the bottle. When the bottle is opened, these bubbles expand very quickly and try to force their way up and out of the bottle. To do this, they must push through the soda to the top and in doing so they force soda out of the bottle in a very explosive and messy fashion.
One way to prevent this from happening is to tap the sides of the container. This knocks the trapped bubbles off the sides of the bottle allowing them to collect at the top of the bottle. If you knock all of the bubble off the sides, the container can be opened without a spray of soda.