Have you ever wondered what is that plastic thing inside Guinness can? If so, you probably know that it has something to do with nitrogen and that it helps in forming the head of the beer. But how exactly does it work?

A list of nitrogenated beers grows longer every day, and for good reason. Nitrogen is less acidic than carbon dioxide, and a nitrogen-infused beer has a softer, creamier top. The problem is, nitrogen does not dissolve very well in beer—once you put it there, it will not stay dissolved for long. Therefore, beer companies had to find a way to add nitrogen to your beer just before you start drinking it. This is where beer widgets come in.

The purpose of the Guinness nitrogen ball is to add nitrogen to a can of Draught Guinness just after you open it. The same applies for other beers with widgets. A beer can widget is a rather simple device—in essence, it is just a hollow spherical ball with a small hole in it.

When your beer goes into a can at the brewery, it is important to make sure that the can does not contain oxygen. Therefore, a beer can is pressurized with a mix of carbon dioxide and nitrogen gas. As you can see in the picture, the inner volume of the beer widget is also filled with gaseous nitrogen. Just before the can is sealed, a shot of liquid nitrogen is added to the mix.

Then, liquid nitrogen starts to evaporate, increasing the pressure inside the can and forcing some beer and dissolved nitrogen inside the widget. When you open a can of nitrogenated beer, the pressure inside rapidly decreases. Consequently, compressed beer and nitrogen gas escape the widget through a small hole and agitate the whole body of liquid. The bubbles created as the result of this process then form a characteristically thick head of the beer.

The floating widget in your beer can is the product of a long process of technological development. The idea to infuse the beer with nitrogen was developed by Guinness in late 1960s, but it took decades to come up with the simple and practical solution being used today. The first attempts to create nitrogenated beer was much weirder and included such strange contraptions as a special gas compartment built into a can or a separate “initiator” device.