How do fireworks work?
The pyrotechnics we see lighting up the night sky every 4th of July owe their brilliance to a rather straightforward chemical reaction discovered a little over a thousand years ago in ancient China. Originally used to chase off evil spirits, potassium nitrate (which isn't explosive on its own) is combined with flammable charcoal and sulfur to create gunpowder. This explosive dust is then stuffed into paper tubes, which are arranged in rows and columns to be detonated by electrical triggers in choreographed sequences.

Fireworks really just use gunpowder?
Well, not exactly. The kind of gunpowder used in fireworks displays burns much slower than the kind used in firearms (you want to actually see all the little sparks and flashes, after all). A single firework tube is constructed layer-by-layer of different gunpowder types.

For rockets and aerial shells (the kind of fireworks that are shot into the sky), there are two main explosive stages: At the bottom of the tube sits base powder that launches the shell into the sky — usually 500 to 600 feet.

When the shell crests, a second timed explosion ignites dozens of marble-sized explosives. These create the flowery ring patterns, strobes, flashes, peonies, and all the other designs you see illuminating the night sky.

Different chemical ratios and compounds are used to create everything from the sound it makes (a whistle versus a screecher) to the color. A single firework can have as many as 16 different pyrotechnic effects built into it.

How do you add colors?
Colors are created using various compositions of metal salts, like calcium chloride, sodium nitrate, and copper compounds. The amount of energy emitted corresponds with the individual elements; the amount of energy determines the color along the light spectrum, with wavelengths varying from red to yellow to purple to white.

Who assembles fireworks?
Because machines can cause sparks or electrostatic discharges, fireworks are still assembled by hand. Usually, this takes place in small concrete buildings isolated from other structures. (The building's roof is often intentionally weakened so that any accidental explosions are funneled upward.) The Zambelli family, an American fireworks dynasty, have been putting on shows for the NFL, New Years Eve, and more since 1893.

How are shows choreographed?
Usually by pen and paper, or on a computer, according to Slate. Felix Grucci, who does choreography for one of America's leading fireworks companies, says he "will play the piece [of music] six or seven times at high volume before he starts writing out ideas."

Fireworks by Grucci uses special forms that break the display into one-minute intervals. The form specifies exactly which type of shell should be fired at each moment. To time this properly, the choreographer has to know how long it takes for each shell to open up after it's fired. For example, if he wanted two hearts to appear just when Phil Collins mentions hearts, he'd have to mark them on the form about five seconds before the words come in the song. [Slate]

A well-designed show is replete with highs and lows intended to stir emotion. Oftentimes, there is even a fake climax built in to mislead sky watchers in the middle. Fun!

How long does it take to actually set up a show?
It can take up a week of delicate precision to wire up, depending on the number of shells. For safety reasons, fireworks are usually launched from a barge over a river or lake. (This is also preferable since the reflection on the water doubles the visual impact.)

Macy's 4th of July Fireworks, which explodes 40,000 shells over New York's Hudson River every year, is billed as "the nation's largest display of pyrotechnic firepower." The show is said to be the costliest and most expensive in the U.S., reports Daily Finance. Although most small-town shows range from $30,000 to $50,000 for a half hour of fireworks, Macy's Independence Day festivities typically average several million dollars.