Originally published on July 4, 2012. From holidays like the Fourth of July to victories, fireworks mean celebration. And to me, they’re a celebration of chemistry too. Atoms and reactions power the colors, sounds and smoke of fireworks. The first firecracker was discovered in China about 1,000 years ago. Called black powder, this explosive is a mixture of potassium nitrate, charcoal and sulfur. You only need the first two ingredients, an oxidizing agent and a fuel, to start the explosion. The oxidizing agent, often a perchlorate or nitrate salt, releases oxygen gas that feeds the fire in a firework. The fuel reacts with the oxidizing agent to create the gas. The sulfur in black powder intensifies and continues the reaction between the other two ingredients. Learn more about the chemistry of fireworks from the American Chemical Society:Pyrotechnicians often add metal salts to make colorful fireworks. Here’s where that color comes from: Heating atoms of sodium, barium or strontium pumps energy into the electrons whizzing around each nucleus. Those energized electrons shoot up to higher locations in the atom. As they fall back down to their usual positions, the electrons lose their extra energy as visible light. The amount of energy released during this process – which depends on the element – is related to the color of the light that we see. Higher energy, like that released by copper atoms, corresponds to a shorter wavelength of light towards the blue end of the spectrum. Red light from strontium atoms has a longer wavelength and lower energy. (The same process gives neon lights their color too. Electricity energizes the neon, xenon or argon in the lights.) Loud bangs come from confining the explosions in a shell, much like a grenade. Gases expand faster than the speed of sound when the shell bursts, creating a loud sonic boom. An abandoned recipe for crackling fireworks called dragon eggs shows how chemists control the ingredients in the firework to get sound effects too. The oxidizing agent in this recipe is lead oxide, which becomes lead atoms as the firework burns. These atoms vaporize in the flame. And those vapors create off little crackles as they expand. Whistling fireworks are more tricky. Pyrotechnicians need to find the right ingredients so that the mixture burns just enough to push air out of its tube — but doesn’t detonate with a bang. The starburst patterns of fireworks depend on how the designers pack explosive pellets into a shell. For a look at the innards of a firework before it explodes, check out this diagram from NOVA Online. In case you’re worried about the environmental effects of the perchlorate oxidizers or metal colorants, fear not. Chemists are developing recipes for environmentally-friendly fireworks too. Enjoy the fireworks this holiday and stay safe! For those looking to host their own fireworks shows, check your local laws first. It’s illegal where I live.