Life's Little Mysteries

How do fireflies light up?

A long-exposure shot of specks of light from fireflies in the forest
The firefly's lantern, or light-producing organ, helps these beetles glow so they can repel predators and communicate during courtship. (Image credit: Trevor Williams via Getty Images)

It's one of the quintessential signs of summer in parts of the United States: fireflies twinkling in the night. Fireflies' ability to produce their own light is called bioluminescence, which is found in select animals, bacteria and fungi all over the world. Most of these creatures live in caves or oceans. But a handful live where humans can see them, including the more than 2,000 species of beetle that make up the firefly family.

So we know what the effect is called. But how do fireflies (family Lampyridae), also called lightning bugs, create these dazzling displays?

The key to their light is a chemical reaction based on a compound called luciferin, said Timothy Fallon, a biochemical geneticist at the University of California, San Diego.

Luciferin makes light by losing electrons — a process called oxidation — in the presence of adenosine triphosphate (ATP), a molecule that provides energy for cells, and magnesium. This reaction is mediated by the enzyme luciferase. Fireflies have light organs in their abdomens where these reactions occur, which contain a layer of crystallized uric acid that helps reflect and boost light. 

This system of using luciferin and luciferase has evolved independently several times in bioluminescent animals, including in another group of light-up beetles called Sinopyrophoridae.

Related: Which group of animals has the most species?

Only in the last few hundred years have scientists started to understand how some living things are able to make light. One of the first people to make headway on this was a 17th-century Royal Society member in Oxford who discovered that air was essential for a bioluminescent fungus to glow. 

Indeed, oxygen is one of the main ingredients for firefly bioluminescence. 

Fireflies need luciferin, luciferase, adenosine triphosphate (ATP) and magnesium to light up.  (Image credit: Ali Majdfar via Getty Images)

Glowing starts early for fireflies. Pupae — and even eggs — are able to make light, possibly as a signal to predators that they won't make good eating, as some of them are poisonous due to chemicals called lucibufagins, which they synthesize from their diet. When fireflies have finished metamorphosing and reach adulthood, they make new light organs. But the overall system is the same, with light coming from inside special cells found in light organs on some fireflies' undersides, turning them yellow, orange, green or even blue.

These cells are chock-full of luciferin and luciferase, as well as an unusually high number of mitochondria. These tiny organelles pump out the ATP fireflies need to get the chemical reaction going. Fireflies turn their light on and off through the flow of oxygen to these cells. No oxygen means darkness. Lots of oxygen? You've got a glow. 

This on and off switch is important for U.S. East Coast fireflies that use flashing signals as adults to find the right breeding partner. Finding mates as a beetle can be tough and each flashing species has evolved its own light sequence to distinguish itself from the others. That makes bioluminescence a "Morse code love song in light," said Lynn Faust, an independent firefly researcher based in Knoxville, Tennessee. "With their extremely short adult lives, it's a race against time" to find a mate. 

Researchers have come a long way in understanding the science behind firefly bioluminescence. But countless firefly species remain undocumented in Asia and Africa, and researchers are still struggling to understand how beetles first evolved their glow-in-the-dark specialty 130 million to 140 million years ago, according to research published on the preprint database BioRxiv.

"The biggest unanswered questions are, like, what are all the genes that are involved in bioluminescence?" Fallon said.

A major breakthrough came in 1985 when researchers discovered the gene responsible for making luciferase. This enzyme is now used in biomedical research to artificially light up specific proteins in plants and animals. In 2024, researchers in Wuhan, China discovered two more genes in a Aquatica leii, a rare aquatic firefly, that they suspect may help position the lantern — the adult firefly's glowing organ — in the abdomen and enable light-generating genes, such as luciferase. 

Besides deciphering firefly bioluminescence, scientists are still learning what makes fireflies tick in the wild. Recent years have seen firefly numbers dwindle due to light population, habitat loss and climate change. "We know so little" about fireflies in their natural habitat," Faust said. "How on Earth can we conserve and protect [them] if we barely understand their most basic requirements?"

Freda Kreier
Live Science Contributor

Freda Kreier is a journalist based out of Washington, D.C. She majored in molecular biology at Colorado College. Freda holds a master’s in science communication from the University of California, Santa Cruz. Her work focuses on science and the natural world, with bylines in Nature, The New York Times and more.