Why Flies Are Attracted to Light

Many of us have observed the entrancing dance of insects around an outdoor lamp or porch light on a summer evening. This phenomenon, where insects gravitate towards sources of light, has fascinated both casual observers and scientists alike. Yet, it’s not just a mere spectacle. Unraveling the reasons behind this behavior, particularly in flies, offers valuable insights into pest control strategies, maintaining ecological equilibrium, and enhancing our broader understanding of biological processes. As we delve deeper, we’ll explore the myriad factors that draw flies to luminescence and the subsequent consequences of this attraction. Whether it’s a matter of evolution, survival, or sheer curiosity, one thing’s for certain: there’s more to this nocturnal display than meets the eye.

The Science Behind Light Attraction

Flies, like many other insects, have evolved over millions of years, developing behaviors that enhance their chances of survival and reproduction. One such behavior is their attraction to light.

Historically, before the advent of artificial lights, flies and other nocturnal insects used natural light sources, primarily the moon and stars, as navigational aids. By maintaining a consistent angle to these celestial bodies, they could fly in straight lines and navigate vast distances. However, artificial lights, which are much brighter and closer than the moon or stars, can confuse these insects. The continuous attraction towards them is a misfiring of an otherwise useful navigational strategy. So, while being attracted to light initially had clear advantages for navigation, in today’s world of omnipresent artificial lighting, this behavior often leads to flies circling lights rather than navigating efficiently.

Not the pest you are looking for?

Check out our pest library to see what other pests we have articles on

Flies’ attraction to light is an innate behavior, deeply rooted in their evolutionary history. This means that flies do not “learn” to be drawn to light over their lifetime; rather, they are born with this predisposition. Throughout their evolutionary timeline, flies that were better at using light for navigation would have had a survival advantage, leading to the perpetuation of this trait in successive generations. Over countless generations, this behavior became hardwired into the genetic makeup of flies. Today, even in the presence of artificial lights which do not serve the same navigational purpose as celestial ones, flies continue to exhibit this innate attraction.

The Fly’s Visual System

Flies have compound eyes, comprised of thousands of individual units called ommatidia. Each ommatidium captures a segment of their surroundings, allowing them to detect fast movements essential for survival. These ommatidia are adept at sensing changes in light intensity and adapting to diverse light scenarios. Their capacity to perceive and respond to light aids in navigation, especially during the dusk hours when they are most active. The inherent sensitivity of their eyes to light, coupled with their evolutionary use of light for navigation, significantly influences their attraction to luminous sources.

How Do Different Light Wavelengths Affect Fly Attraction?

Flies demonstrate varied responses to different light wavelengths or colors. They have a heightened sensitivity to ultraviolet (UV) light. In nature, surfaces like water or foliage reflect UV light, signaling potential sites for food or breeding to flies. Consequently, artificial lights that emit strong UV light can be irresistibly alluring to them. Nonetheless, the attraction levels can diverge based on the fly species and their specific environmental adaptations.


Absolutely, flies are influenced by light polarization. Polarized light consists of light waves vibrating mainly in parallel directions. In the natural world, when light reflects off surfaces such as water, it becomes polarized. Many fly species associate polarized light with water, a crucial element in their reproductive cycle. Artificial lights that generate or alter polarized light patterns can be misinterpreted by flies as natural water bodies, increasing their allure. This is another scenario where man-made lights unintentionally harness a fly’s natural tendencies, attracting them with misleading cues.

Flies and Different Light Conditions

The intensity of light plays a pivotal role in determining fly behavior. Brighter lights tend to attract more flies than dimmer ones. When exposed to a high-intensity light source, flies often exhibit increased activity levels, moving toward the source in search of potential food or mating opportunities. Conversely, dimmer light may not elicit the same strong attraction, allowing flies to engage in other behaviors like resting or foraging. Furthermore, abrupt changes in light intensity can startle or disorient flies, causing temporary erratic movements.

Are There Any Specific Colors of Light That Are More Attractive to Flies Than Others?

Yes, flies display varied attractions to different colors of light. Generally, flies are more drawn to blues and ultraviolet (UV) wavelengths, associating them with natural cues like the sky or certain types of vegetation. On the contrary, colors on the warmer end of the spectrum, such as reds and oranges, tend to be less attractive to many fly species. However, it’s important to note that attraction can vary based on the species and their environmental adaptations.

Ultraviolet (UV) Lights

Ultraviolet (UV) light has a stronger allure for many fly species compared to visible light. In nature, UV light reflection can signal the presence of water or potential food sources. Flies have evolved to pick up on these UV cues to locate essential resources. Artificial UV lights, such as those used in bug zappers or certain lighting setups, can be especially enticing to flies due to their heightened sensitivity to this part of the spectrum.

Specific Wavelengths of Light That Repel Flies

Interestingly, while certain wavelengths attract flies, others may deter them or elicit minimal response. Wavelengths on the far-red end of the spectrum seem to be less appealing to most fly species. Some research has suggested that specific light combinations, especially those devoid of UV and blue light, can serve as repellents. However, the degree of repellence can vary based on the species and the specific conditions under which the light is presented.

Time and Environmental Variables

Flies exhibit varied levels of attraction to light depending on the time of day. Dusk and dawn, often termed “crepuscular hours,” are peak times for many fly species to be attracted to light. As the sun sets or rises, flies use the gradual changes in light to navigate, mate, and search for food. During these transitional light periods, artificial light sources can be especially enticing to them. Conversely, during the peak daylight hours, when ambient light levels are high, artificial lights typically hold less allure. Similarly, deep into the night, when it’s pitch-dark, the number of flies actively seeking out light diminishes, as many species become less active or seek refuge.

Both temperature and humidity have a significant impact on a fly’s attraction to light. In optimal temperature ranges, flies are more active and responsive to light cues. Extreme temperatures, whether too hot or too cold, can reduce a fly’s activity and consequently its attraction to light. Humidity plays a dual role: while higher humidity can stimulate fly activity, especially for species that breed in moist environments, extremely high humidity levels can impede a fly’s flight abilities, reducing their responsiveness to light sources. In essence, a balanced combination of temperature and humidity creates conditions conducive for flies to respond more robustly to light stimuli.

Behavioral Patterns Across Fly Species and Habitats

Delve into the diverse responses to light across different fly species and the influence of their habitats.

Are All Species of Flies Equally Attracted to Light?

No, not all fly species exhibit the same degree of attraction to light. While many are drawn to it, the intensity of this attraction can vary widely. Factors influencing this variation include the specific ecological niches the flies occupy, their feeding habits, and reproductive behaviors. For instance, certain species that primarily breed in well-lit environments might show a stronger affinity for light, whereas others that have evolved in darker, shaded areas might not respond as robustly.

Comparison to Other Insects

While both flies and moths are attracted to light, their reasons and the intensity of this attraction can differ. Moths are notoriously known for their almost fatal attraction to flames and bright lights. Their behavior is driven by an innate navigational mechanism that uses celestial bodies, like the moon, for direction. Artificial lights confuse this mechanism, leading them to circle or dive into the source. Flies, on the other hand, use light for navigation too but are also influenced by other ecological cues associated with light. The degree of attraction also varies, with some fly species being less intensely drawn to light compared to moths.

Nocturnal Fly Species

Typically, nocturnal fly species have evolved to be more sensitive to lower light levels than their diurnal counterparts. This heightened sensitivity aids them in navigating and locating resources during the night. As a result, nocturnal species tend to be more attracted to artificial light sources, as these can overpower their natural nighttime cues. Diurnal species, accustomed to the bright light of day, might not exhibit the same level of attraction to artificial lights, especially during daylight hours. However, come dusk, even some diurnal species can be found gravitating towards light sources.

Variation Across Lifecycles and Environments

A fly’s attraction to light can differ significantly based on its stage in the lifecycle. Larvae and pupae, the immature stages, are generally not attracted to light, focusing more on feeding and growth in often sheltered and dark environments. However, as they metamorphose into adults, the attraction to light becomes more pronounced, especially as it becomes a tool for navigation, mating, and locating food sources. Adult flies, especially those that are newly emerged, often use light gradients to move away from their breeding sites.

Regions and Habitats

the attraction to light can vary across different habitats. Flies in tropical and densely vegetated regions, where light can be a scarce resource under the canopy, might be more strongly drawn to light sources as they stand out starkly against the darker backdrop. Conversely, in open and well-lit areas like grasslands, the attraction might be less intense. Coastal flies might also show attraction to light, associating its polarization patterns with water.

Urban Light Pollution

Urban light pollution, a byproduct of our ever-expanding cities, has had profound effects on many insect populations, including flies. The constant barrage of artificial light during the night can disrupt natural fly behaviors such as mating, feeding, and navigation. Some species might be drawn to urban areas, mistaking them for promising habitats due to the light, only to face challenges like a lack of food sources. Light pollution can also disrupt the predator-prey relationships, offering undue advantages or disadvantages. Furthermore, with artificial lights impacting their natural internal clocks, some flies might experience altered activity patterns, leading to longer exposure to predators or reduced reproductive success.

Practical Implications and Uses

Harnessing the knowledge of flies’ affinity for light can be instrumental in pest control. Recognizing their behavioral patterns in response to specific light wavelengths and intensities can guide the development of targeted control strategies. For example, UV light traps can be employed in strategic locations to lure and capture flies, reducing their populations in specific areas. By understanding when during the day or night flies are most attracted to light, pest control methods can be optimized for maximum efficiency.

Effective Strategies for Using Light to Trap or Repel Flies

Several strategies exploit flies’ attraction to light. Bug zappers, which use UV light to attract and then electrocute pests, are popular tools. Another approach involves using light traps, which lure flies using specific light wavelengths and then trap them using sticky surfaces or containment chambers. For repelling, lights that emit wavelengths unattractive or disorienting to flies can be employed. Additionally, pulsed or flickering lights can deter flies by disorienting them and disrupting their navigational cues.

Artificial Lights and Ecosystem Disruptions

Artificial lights can significantly disrupt fly populations and their behavior. Consistent exposure to artificial lights, especially during nocturnal hours, can confuse and mislead flies, leading to wasted energy, reduced mating opportunities, and higher susceptibility to predators. Over time, these disruptions can cause shifts in population dynamics, potentially reducing numbers in certain areas or leading to the predominance of species more tolerant of light pollution. Such alterations can ripple through ecosystems, impacting not only the flies themselves but also species that interact with them, be it as predators, prey, or competitors.


The phenomenon of flies being attracted to light is a blend of evolutionary, behavioral, and environmental factors. From an evolutionary standpoint, light provides essential cues for navigation, mating, and foraging. The fly’s visual system has evolved to process these cues effectively, with different wavelengths impacting attraction dynamics. Behaviorally, while many fly species are drawn to light, the intensity and specifics of this attraction can vary based on species, lifecycle stage, and habitat. Practically, this understanding has significant applications, especially in pest control, where light can be a tool for trapping or repelling flies. However, with the boon of artificial lighting also comes the bane of light pollution, which can disrupt fly populations and behaviors, indicating the delicate balance and intricate relationship between flies and light.