Glowworm, or glow worm, is the common name for various different groups of insect larvae and adult larviform females that glow through bioluminescence. They may sometimes resemble worms, but all are insects (Arachnocampa and Orfelia being flies and all the others being beetles).
The glow in the former two groups is a yellow-green colour. The so-called railroad worms in the Phengodidae family have an additional red light at their head. The fly larvae produce a blue-green colour. The glow is produced by different organs in the different families, suggesting they evolved separately, though several other beetle families in the superfamily Cantharoidea also exhibit bioluminescence, suggesting a single origin within this lineage and hence that the Lampyrids and Phengodids share a bioluminescent ancestor. The chemical reaction in each case is very efficient; nearly 100% of the energy input is turned into light (compared to the best light-emitting diodes at just 22%).
The purpose of the glow varies. Those adult females that glow do so to attract a male for mating. The Lampyridae larvae are believed to glow as a warning signal to predators, like toads, not to eat them as they are mildly toxic. But the Arachnocampa and Orfelia larvae, on the other hand, glow to attract prey like midges into sticky snare lines for the larva to feed on.