Foam is made by trapping gas bubbles inside a liquid or solid. This sounds simple, but it never happens on its own. Creating foam always requires energy, whether that’s your hands whipping egg whites, a machine injecting gas into molten plastic, or a chemical reaction releasing carbon dioxide inside a mattress. The gas creates bubbles, and something in the surrounding material stabilizes those bubbles long enough for the foam to hold its shape.
Why Foam Needs More Than Just Gas and Liquid
When gas enters a liquid, it naturally wants to escape. Bubbles rise, pop, and merge back together because maintaining all those tiny bubble walls takes energy. Every new bubble wall is a new surface, and surfaces between gas and liquid carry tension that the system tries to minimize. This is why blowing air into pure water doesn’t produce lasting foam. The bubbles collapse almost immediately.
For foam to form and persist, you need a stabilizing agent. In most cases, this is a surfactant: a molecule with one end that likes water and one end that doesn’t. These molecules rush to the surface of each bubble, forming a thin protective skin that lowers the energy cost of maintaining that surface. Dish soap, proteins in egg whites, and the compounds in shampoo all work this way. They reduce the surface tension of the liquid, making it far easier for bubbles to form and much harder for them to merge together.
The surfactant layer does something else that’s critical. When a bubble wall starts to thin in one spot, the surfactant molecules spread unevenly, creating a localized difference in surface tension that pulls liquid back into the thinning area. This self-healing mechanism is what keeps a column of soap bubbles intact for minutes rather than milliseconds.
Mechanical Methods: Whipping, Shaking, and Bubbling
The most intuitive way to make foam is to physically force air into a liquid. This is what happens when you whisk cream, shake a cocktail, or run a cappuccino machine. The energy from agitation breaks air into smaller and smaller bubbles while the stabilizing agents in the liquid coat each one.
Speed matters enormously. Slow stirring produces a few large bubbles that pop quickly. Rapid agitation, typically above 1,000 rpm in industrial settings, generates dense foam with tiny, uniform bubbles. Industrial foam production uses rotor-stator mixers, porous membranes that air is forced through, or double-syringe techniques where liquid is pushed back and forth through a narrow opening to create consistent bubble sizes.
In cooking, the stabilizing agents are usually proteins. Whipping egg whites unfolds their protein molecules, which then wrap around air bubbles and lock into place. Cream foams because milk fat and milk proteins together coat the bubbles. The more you whip, the more bubbles you create and the stiffer the foam becomes, until you eventually break the structure entirely (overwhipped cream turning to butter, for example).
How Aerosol Cans Produce Foam
Shaving cream, mousse, and spray whipped cream all rely on the same principle. Inside the can, the product sits under high pressure alongside a liquefied propellant gas. When you press the nozzle, the internal pressure forces the product up a tube, through a valve, and out the opening. The moment it exits, the pressure drops to normal atmospheric levels. That sudden pressure drop causes the propellant to rapidly expand from liquid to gas, inflating millions of tiny bubbles throughout the product in an instant.
The nozzle design determines whether you get a fine mist, a stream, or a thick foam. Foam nozzles restrict and slow the flow, giving the expanding gas time to create stable bubbles within the product rather than atomizing it into a spray.
How Solid Foams Are Manufactured
The foam in your couch cushions, insulation panels, and yoga mat started as a liquid that was inflated with gas and then hardened. The gas comes from compounds called blowing agents, and the choice of blowing agent is one of the biggest decisions in foam manufacturing.
Physical blowing agents are gases or low-boiling-point liquids, like pentane, nitrogen, or carbon dioxide, that are mixed into the raw material under pressure. When the pressure is released or heat is applied, they expand into gas and inflate the material. Chemical blowing agents work differently: they’re compounds that decompose at specific temperatures and release gas as they break down. Baking soda (sodium bicarbonate) is the simplest example. Industrial versions include compounds that decompose between 115°C and 250°C, each releasing a predictable volume of gas. One widely used chemical blowing agent produces 220 milliliters of gas per gram of material.
Polyurethane Foam
Polyurethane is the most common solid foam, found in mattresses, car seats, insulation, and packaging. It forms through a two-part chemical reaction. One component (an isocyanate) reacts with another (a polyol) to create the solid polymer structure. At the same time, the isocyanate reacts with water to produce carbon dioxide gas, which inflates the mixture as it hardens. For ultra-low-density foams like mattresses, manufacturers often add liquid carbon dioxide alongside the water-based reaction. As the mixture heats up from the chemical reaction, the liquid CO2 boils into gas, providing extra expansion. This combination of chemical and physical blowing keeps the temperature from climbing too high during production.
The original blowing agents for many foam types were chlorofluorocarbons (CFCs), which produced excellent foam but destroyed the ozone layer. They were banned under the Montreal Protocol in 1989. Their replacements were also eventually restricted for similar reasons. Today, the industry primarily uses hydrocarbons like pentane and cyclopentane, water-based systems, and liquid CO2.
Open-Cell vs. Closed-Cell Foam
The internal structure of a solid foam depends on how the manufacturing process is controlled. In closed-cell foam, every bubble is completely sealed off by solid walls. The trapped gas can’t escape, which makes the foam rigid, water-resistant, and an excellent insulator. Closed-cell foams get their properties primarily from the material in those cell walls rather than from the air inside.
Open-cell foam has interconnected bubbles where the walls between cells have partially broken down. Air moves freely through the material, making it soft, compressible, and breathable. This is why open-cell foam is used for seat cushions and mattresses, while closed-cell foam goes into insulation boards and flotation devices. Manufacturers control which type they get by adjusting the chemistry, temperature, and timing of the foaming process.
Why Foam Eventually Breaks Down
Liquid foams are inherently unstable. Three processes work simultaneously to destroy them. First, gravity pulls liquid downward out of the bubble walls, a process called drainage. As the walls thin, they become more fragile. Second, gas slowly migrates from smaller bubbles into larger ones because smaller bubbles have higher internal pressure. This makes big bubbles grow while small ones shrink and vanish, gradually coarsening the foam into fewer, larger bubbles. Third, the thinning walls eventually rupture, and neighboring bubbles merge.
How fast this happens depends on both physics and chemistry. Bubble size and the amount of liquid in the foam set the baseline rate, but the type of surfactant matters just as much. Some surfactants create rigid, elastic films that resist thinning for hours. Others produce fragile films that drain in seconds. Using two different surfactants together can slow the process further by creating a more resistant film around each bubble, blocking gas transfer between bubbles of different sizes.
Solid foams sidestep most of these problems. Once the polymer hardens, the bubble structure is locked in place permanently. The “walls” are solid plastic or rubber rather than thin liquid films, so gravity and gas transfer can’t collapse them. This is why a sponge holds its shape for years while a head of beer foam lasts minutes.

