When the weather outside is frightful, soaking in a hot bath can sound especially appealing. And adding a bath bomb to the water can elevate the experience. But what exactly is in these scented spheres, and what makes them so fizzy?

Bath bombs are usually made from three key ingredients: baking soda, citric acid and cornstarch, said Frankie Wood-Black, an instructor in chemistry at Northern Oklahoma College and an experienced bath-bomb maker. Often, bath bombs also include dyes and perfumes, and sometimes they have epsom salt.

The fizziness of bath bombs comes from the chemical reactions that happen when the baking soda and citric acid come into contact with water, Wood-Black told Live Science. Baking soda, or sodium bicarbonate, has the chemical formula NaHCO3. In water, baking soda quickly dissolves, and the positively charged sodium (Na+) breaks apart from negatively charged bicarbonate (HCO3-).

Meanwhile, the citric acid also dissolves, with a single hydrogen ion (H+) separating from the rest of the molecule, Wood-Black said. Then, that positively charged hydrogen from the citric acid and the negatively charged bicarbonate from the baking soda mingle, very quickly undergoing a series of reactions. One of the end products is carbon dioxide (CO2). Because carbon dioxide is a gas, it forms small bubbles in the bath water, creating a delightful fizz.

If there are perfumes or scented oils in the bath bomb, they are released into the air with the carbon dioxide bubbles, Wood-Black said. The sodium from the baking soda and the rest of the citric acid molecule (minus the hydrogen that it lost when it dissolved) simply remain in the water.

The cornstarch in a bath bomb has just one job: It slows down the reaction.

By binding to the baking soda as well as the citric acid, the cornstarch slows down the rate at which both of them dissolve. The effect is that the fizziness may last 3 or 4 minutes, instead of only seconds, Wood-Black said.

Making bath bombs is not difficult, she said. She mixes 1 cup of baking soda, one-half cup of citric acid and one-half cup of cornstarch together in a bowl. All three items can be found at grocery stores. Citric acid is found in soda and candy and can also be used to make cheese, Wood-Black noted. After mixing the three ingredients, she adds about 1 teaspoon of water, which is enough to just barely moisten the ingredient mixture so that the powder sticks together. She then scoops the mixture into a mold (such as a Santa or a star candy mold) to form a shape and lets the shapes dry overnight.

But you can also just mix together the three key ingredients and skip the water. Leave the mixture in a jar, and then scoop it into your bath, she said.

Food coloring can be used to dye bath bombs, she said. But she doesn’t dye the ones she makes. “I opt not [to do that],” she said. “I’m a chemist by profession, but with food coloring, I just get it all over the place.”