Why Are Bugs Attracted to Light? The 2024 Science Behind the Swarm
What is it about your porch light or camping lantern that attracts insects? Find out!
Quick Reference
- The short answer: Many night-flying insects are positively phototactic. They steer by tilting their backs toward the brightest light in the sky, so an artificial bulb traps them in a loop.
- The 2024 update: Imperial College London researchers (Fabian and colleagues, Nature Communications, January 2024) showed bugs do not mistake porch lights for the Moon. They are disoriented by the dorsal-light-response reflex.
- Strongest pull: White light and ultraviolet (UV). Mercury-vapor lamps, fluorescent tubes, and unfiltered LEDs draw the biggest crowds.
- Weakest pull: Warm yellow, amber, and red bulbs. The longer wavelengths do not register as “sky” to most night fliers.
- Folk read: A bright porch on a still humid night will pull in moths, beetles, and lacewings. Country wisdom says swap the white bulb for a yellow one, or read by lantern indoors.
- Outdoor evening tip: Yellow bug lights or a small fire pit draw fewer insects than a fluorescent porch fixture. Mosquitoes are a separate problem since they follow carbon dioxide, not light.

Country wisdom is blunt about it: leave the porch light off if you want to keep the bugs off the screen door. Farmers and stargazers have known the rule for generations. What is new is the science behind it. A January 2024 study from Imperial College London, led by Dr. Samuel Fabian and published in Nature Communications, used high-speed motion capture to settle a question entomologists had argued about for almost a hundred years. This guide walks through the old answer (moonlight navigation), the new answer (dorsal-light-response disorientation), what kinds of bulbs pull which bugs, and how to keep your summer evenings yours.
Flip on a porch light or a camping lantern on a warm summer night and the moths, beetles, and lacewings find it within minutes. Turn it off and they scatter. The pattern is so reliable that Almanac readers use it to plan firefly watching nights and outdoor suppers. The scientific name for the behavior is phototaxis. The full explanation, though, took until 2024 to nail down.
How Phototaxis Affects Insects
A phototactic animal moves toward or away from light by reflex. Moths, junebugs, lacewings, mayflies, and most night-flying beetles are positively phototactic. They steer toward the brightest source in their field of view. Cockroaches, earwigs, and silverfish are negatively phototactic. They scuttle for the dark the second you flip a kitchen switch. Both reactions are hardwired in the insect’s nervous system, not a learned behavior, which is why a porch light at 2 a.m. still gathers a crowd even if there is no reward at the bulb.
For most of the twentieth century, scientists had two competing explanations for the moth-and-bulb dance. The first was the moonlight-navigation theory. Night-flying insects, the argument went, use the Moon as a fixed celestial reference. A porch light fools them into treating a nearby bulb as the Moon, and they spiral inward as they try to keep it at a constant angle. The second was the escape-route theory. Bugs flushed from a bush head for the brightest spot in the sky to outpace a predator. An artificial light at ground level, brighter than the Moon, becomes a false escape hatch.
What the 2024 Imperial College Study Found
Both old theories turn out to be wrong. In January 2024, Dr. Samuel Fabian and his team at Imperial College London published a study in Nature Communications that used high-speed cameras and motion capture to track moths, dragonflies, and other insects flying around artificial lights at night, both in a London lab and in a Costa Rican rainforest. They found the insects were not mistaking bulbs for the Moon, and they were not trying to escape. They were tipping their backs toward the light.
The behavior is called the dorsal-light-response. For hundreds of millions of years, night-flying insects have used the brightest patch of sky (almost always overhead) to keep themselves right-side up. The reflex is older than the moths themselves. When an artificial light sits below or beside an insect, the reflex still fires. The bug tilts its back toward the bulb, which sends it into an orbit or a stall. The Smithsonian’s coverage of the study includes slow-motion clips of the trapped flight paths, and they are worth the watch.
The practical takeaway is simple. Bugs are not chasing your light because they want to be there. They are stuck in a reflex loop. That is why moths bash themselves against a bulb instead of resting on it, why a single porch fixture can collect dozens of insects in an hour, and why the easiest fix is a bulb the reflex does not register.
Why Do Insects Keep Flying Around the Light?
Once a bug is stuck in the dorsal-light orbit, getting out is hard. The first problem is the reflex itself. The longer the insect stays near the bulb, the more its flight path locks into a tight loop. The second problem is night blindness. Picture standing in a brightly lit kitchen and someone cuts the power. You stand frozen for a moment as your pupils dilate. The same thing happens to a moth, but slower.
A moth’s compound eye is built of thousands of small sensors, each called an “ommatidium.” After a stretch near a bright bulb, the ommatidia take up to thirty minutes to fully readjust to darkness. During that half hour, the moth is functionally blind to predators, branches, and spider webs. So even if the moth could break the orbit, flying into the surrounding dark is dangerous. Staying near the bulb is the safer of two bad options, until exhaustion drops it.
The escape-route idea (an insect flushed from cover heading for the brightest spot in the sky) was once a leading theory, and was discussed for decades in entomology textbooks. The 2024 work does not erase it. Some flying insects do flee toward open sky when startled. But the slow, hours-long swarms at a porch light, the ones you actually notice, are the dorsal-light reflex. See also: What the Heck Is a Bugnado?
What Kinds of Lights Attract Bugs Most?
Not all bulbs draw the same crowd. The short version is: the shorter the wavelength, the more bugs you get. UV and white light look like daytime sky to a night-flier. Yellow, amber, and red light do not. The breakdown by bulb type follows.
| Light source | How many bugs it pulls | Why |
|---|---|---|
| Mercury-vapor lamp | Heaviest swarm | Strong UV plus white light; entomologists use these as collection traps. |
| White fluorescent tube | Heavy swarm | Broad spectrum including UV and short blue wavelengths. |
| Cool-white LED (5000K or higher) | Moderate to heavy | High blue content reads as “sky” to dorsal-light-response. |
| Warm-white LED (2700K to 3000K) | Light | Mostly long-wavelength yellow tones; weaker reflex trigger. |
| Incandescent campfire or candle | Light | Long wavelengths and flicker; few insects orbit it the way they do a steady bulb. |
| Yellow “bug light” bulb | Very light | Cuts out UV and short blue; most night-fliers do not register it. |
| Red or amber LED | Almost none | Below the threshold for most insect light sensors. |
For the porch, a warm-white or yellow bulb is the simplest fix. For a backyard supper, a yellow string light or a small fire pit will out-perform a bright overhead fixture. The University of Nebraska Department of Entomology has a plain-English breakdown of which insects respond to which wavelengths, and it lines up with what the Almanac has recommended for decades.
Do Bug Zappers Actually Work?
Bug zappers throw white and UV light, exactly the spectrum night-flying insects orbit. So they pull a crowd. The trouble is the crowd. Studies from the University of Delaware and others have shown that the insects killed in a backyard zapper are mostly harmless beetles, moths, and lacewings. Mosquitoes, the bug most homeowners actually want gone, are barely drawn to UV light. Mosquitoes track the carbon dioxide on your breath, the warmth of your skin, and the lactic acid in your sweat. A zapper does not read as a target to them.
The Almanac take: a zapper near a vegetable patch can do more harm than good by killing the parasitic wasps and lacewings that eat aphids and cabbage worms. If mosquitoes are the problem, the long-standing solutions still hold. Drain standing water within fifty feet of the porch, plant a few rounds of basil, lemon balm, and citronella geranium near the seating area, and reach for one of our herbal repellents when the breeze drops. For a deeper guide to plant-based options, see our list of natural bug repellents.
Folklore and Old-Country Fixes
Long before anybody coined the word “phototaxis,” country households worked out the rule the hard way. The folk fixes below show up in Almanac archives going back to the early twentieth century. Most still hold up.
- “Read by lantern indoors, not on the porch.” A lantern brought outdoors will collect every moth in the yard. The fix farmers used was to keep the bright light inside the screened porch or kitchen, and to sit on a dark stoop with a candle if reading was needed.
- “Yellow paper around the porch lantern.” Long before commercial yellow bug bulbs, almanac readers wrapped a porch lantern with a sheet of amber tissue or a yellow lamp shade. The effect is the same: filter out the short wavelengths and most bugs lose interest.
- “Bugs by the door mean rain by morning.” A heavy bug night on the porch is often a humid still night, which is a classic pre-front pattern. The bugs do not predict the rain. They share the same low-pressure cue.
- “Burn an evening fire upwind.” A small fire pit upwind of the seating area pulls more bugs to the flame than the seating draws away. Country families used this long before tiki torches existed.
- “No porch light, no moth eggs in the screen.” Moths laying eggs on door screens is a real seasonal nuisance. Skip the porch light for two weeks in late June and the problem mostly resolves itself.
None of these are forecasts. They are practical rules built on long memory in a fixed place. They line up with the science more often than not, which is the test the Almanac has always used.
How to Keep Bugs Off the Porch Tonight
- Swap the porch bulb. Yellow “bug light” bulbs or warm-white LEDs (2700K or lower) draw a fraction of the bugs a cool-white or UV bulb does.
- Move the bright light away from where you sit. A bright work light at the far end of the yard pulls the swarm to it. Sit in the darker zone.
- Put a small fan on the porch. Mosquitoes and gnats are weak fliers. A box fan on low knocks the count down faster than any zapper.
- Close the screens before sundown. Most porch infestations are insects pulled in while doors were propped open at dusk, the peak window for phototactic bugs.
- Drain standing water and clear leaf piles. Mosquito larvae hatch in less than a tablespoon of standing water. The Almanac’s go-to is a weekly walk of the yard with a watering can to tip out birdbaths, kid pools, and tire ruts.
- Plant a pollinator border. A patch of bee balm, mint, and lavender near the seating area gives off oils most biting bugs avoid, and feeds the bees that do real work.
None of these are a magic shield. Used together, they cut a bug-heavy summer evening down to a manageable one. Your own porch is the test. Run the changes for a week, watch what shows up at the door, and adjust from there.

Frequently Asked Questions
Why are bugs attracted to light, really?
Night-flying insects use the brightest patch of sky overhead to stay right-side up. The reflex is called the dorsal-light-response. When an artificial bulb sits below or beside them, the reflex still fires, and they tilt their backs toward the bulb. The result is the orbit you see around a porch light. A 2024 Imperial College London study confirmed the mechanism.
Do moths really mistake porch lights for the Moon?
No. That was the leading theory for most of the twentieth century, but the 2024 high-speed-camera work by Dr. Samuel Fabian’s team showed the flight paths do not match a moon-navigation model. Insects are reflex-tilted toward the brightest light, not steering by it as a celestial reference.
Why do bugs swarm white bulbs but ignore yellow ones?
Most night-flying insects have light sensors tuned to short wavelengths (ultraviolet, blue, and green). Yellow, amber, and red bulbs emit mostly long wavelengths, which the sensors barely register. A standard yellow ‘bug light’ bulb is the simplest porch fix.
Do bug zappers actually kill mosquitoes?
Hardly any. The vast majority of insects killed in a backyard zapper are harmless moths, beetles, and lacewings, including some that eat garden pests. Mosquitoes track carbon dioxide, body heat, and skin scent, not UV light. A box fan and a yellow porch bulb do more for mosquitoes than a zapper does.
Are some insects repelled by light?
Yes. Cockroaches, earwigs, silverfish, and many ground beetles are negatively phototactic. They run from a sudden light because their evolutionary niche is dark and damp. That is why you see them scatter when you switch on a basement light at night.
Why does a moth bash itself against the bulb instead of just landing?
Once the dorsal-light reflex is firing, the moth’s flight path is a tight orbit. It cannot easily break out. Compound eyes also take up to thirty minutes to readjust to darkness, so the surrounding dark looks dangerous. Stuck near the bulb is the lesser of two threats, until exhaustion drops the insect.
Does the Moon phase actually change how many bugs swarm my porch?
A little, indirectly. On bright full-Moon nights, the dorsal-light reflex has competition from the natural sky, and porch lights pull slightly fewer insects. On dark new-Moon nights, your bulb is the only show in town and the swarm grows. The Almanac’s Full Moon Calendar can help you plan around it.
What is the best plant-based way to keep bugs away from outdoor evenings?
Plant a pollinator and herb border around the seating area: basil, lemon balm, citronella geranium, lavender, and mint. Pair that with our list of natural bug repellents for the biting kinds. Combined with a yellow bulb and a fan, you cover most of what a backyard supper needs.
The science is finally caught up to the country rule: kill the white porch light, let the Moon do the work. Use the Best Days Calendar to pick the right summer evenings for porch suppers and firefly watching, and let the bugs find someone else’s bulb.

Amber Kanuckel
Amber Kanuckel is a freelance writer from rural Ohio who loves all things outdoors. She specializes in home, garden, environmental, and green living topics.





Very interesting read. I always wondered why it’s party time for moths on my front porch! I don’t mind though as all these little bugs provide food for nesting birds during the day. Feed them all winter and they will de-bugg your yard all summer.
Guess my bug zapper actually did zap more bugs under the pole lite by the shed. Just hanging it off the porch got hardly no bugs. Thanks for the bug info.
I found this article very informative. I am 73 years old and never knew this. Well, you learn something new everyday, right? Keep up the good work!!
Gary: Yellow lights don’t keep bugs away so much as most bugs simply aren’t attracted to them. If you use them on your porch, you’ll have far fewer insects buzzing around than if you used white lights!
Since you won’t accept my comment or question, I will delete Farmer’s Almanac e-mails.
Do yellow lights keep bugs away?
Bugs are like people, strange.
I enjoyed reading this….,answers my questions as to why all those moths are coming onto the porch…..
Very interesting read. Thank you
I found this very interesting, I’ve wondered this all my life. Thanks ! Now I know why the zappers don’t work, makes sense now.