Mealworms strongly prefer darkness. Both the yellow mealworm (Tenebrio molitor) and the lesser mealworm (Alphitobius diaperinus) actively move away from light and seek shelter when exposed to it. The strength of this preference is remarkable: in controlled experiments, up to 80 percent of adult lesser mealworms had taken cover within five minutes of a light source being turned on.1Environmental Entomology. Lesser mealworm Alphitobius diaperinus (Coleoptera: Tenebrionidae) displays negative phototaxis and conditional hygrotaxis This instinct runs deep enough to shape their entire daily activity cycle and, as researchers are finding, even influences how fast they grow.
How Mealworms Behave When Exposed to Light
Entomologists describe the mealworm’s light-avoidance behavior as negative phototaxis, meaning the animals actively orient away from a light source rather than simply being indifferent to it. In a series of lab experiments on the lesser mealworm, researchers placed beetles and larvae in petri dishes split into a sheltered half and an exposed half, then turned on lights of different colors. In complete darkness, the insects wandered randomly between the two halves with no preference for shelter. But the moment light was introduced, the picture changed dramatically. Under white light, adult beetles began clustering under shelter within about two minutes, and within five minutes the vast majority had hidden.1Environmental Entomology. Lesser mealworm Alphitobius diaperinus (Coleoptera: Tenebrionidae) displays negative phototaxis and conditional hygrotaxis
This was not a subtle effect. When no shelter was available under white light, beetles simply moved randomly around the dish, unable to escape. But with a dark refuge present, they beelined for it. That contrast confirms the behavior is driven by the light itself, not by some other property of the shelter like warmth or texture.
Late-stage larvae showed the same basic pattern. Exposed to white light, they had a significantly greater chance of hiding after just two minutes. Green and blue light also drove larvae into shelter, though the response was a bit slower, reaching significance after about four minutes.1Environmental Entomology. Lesser mealworm Alphitobius diaperinus (Coleoptera: Tenebrionidae) displays negative phototaxis and conditional hygrotaxis The larvae’s alarm reaction to light is not something they learn; it appears to be hardwired from early development.
Which Colors of Light Mealworms React To
Not all wavelengths of light provoke the same strength of response, and the differences between larvae and adults are interesting. Adults responded to every color tested: white, green, blue, and red. Green light triggered the fastest adult reaction. Under green light, adults were already sheltering at significantly higher rates within the first minute, while white, blue, and red light took about two minutes to produce the same effect.1Environmental Entomology. Lesser mealworm Alphitobius diaperinus (Coleoptera: Tenebrionidae) displays negative phototaxis and conditional hygrotaxis Something about green wavelengths seems to be especially salient to the adult beetle’s visual system.
Larvae, on the other hand, showed a notable blind spot. Red light did not trigger any significant hiding behavior in late-stage larvae. Under red illumination, larvae behaved as though they were in darkness, wandering without preference. White, green, and blue light all drove them to shelter, but red did not.1Environmental Entomology. Lesser mealworm Alphitobius diaperinus (Coleoptera: Tenebrionidae) displays negative phototaxis and conditional hygrotaxis This distinction is worth knowing if you keep mealworm larvae and want to observe them without disturbing their behavior. A dim red light should let you watch them without triggering their hiding instinct, at least during the larval stage. Once they reach adulthood as darkling beetles, even red light will send them scurrying.
The reason for this developmental shift is not entirely clear. The adult beetle’s compound eyes are more complex than the larval ocelli (the simple light-sensing organs larvae use), and it is plausible that adult eyes detect a broader range of the spectrum. Whatever the mechanism, the practical upshot is that larvae are somewhat less light-sensitive than adults, but both life stages share the core preference for darkness.
When Thirst Overrides the Fear of Light
The mealworm’s commitment to darkness is strong but not absolute. One condition can override it: dehydration. Researchers found that adult lesser mealworms will tolerate light exposure if they are dehydrated and can detect a nearby water source. Under normal hydration, the beetles consistently chose dark shelter even when water was available in the lit area. But when the insects were water-stressed, their drive to find moisture overpowered their aversion to light.1Environmental Entomology. Lesser mealworm Alphitobius diaperinus (Coleoptera: Tenebrionidae) displays negative phototaxis and conditional hygrotaxis
This makes sense from a survival standpoint. Darkling beetles live in dry environments like grain stores and poultry litter, where water is often scarce. A beetle that refuses to leave cover even to drink would eventually die of desiccation. So the behavioral rule appears to be: avoid light unless you are dangerously thirsty and water is close. Researchers call this conditional hygrotaxis, meaning the water-seeking behavior only kicks in under specific physiological need.
This finding also helps explain field observations. In poultry houses, the highest densities of lesser mealworms are found beneath crusted litter and under feed trays, which are dark, sheltered spots. But beetles sometimes turn up in more exposed areas near water lines, and the dehydration override likely explains those sightings.1Environmental Entomology. Lesser mealworm Alphitobius diaperinus (Coleoptera: Tenebrionidae) displays negative phototaxis and conditional hygrotaxis
Mealworms Are Nocturnal
The preference for darkness extends beyond a simple flinch reaction to light. Mealworms are genuinely nocturnal animals. Classic circadian-rhythm research on the yellow mealworm (Tenebrio molitor) found that adult beetles held on a 12-hour light, 12-hour dark cycle were active exclusively during the dark period.2Annals of the Entomological Society of America. Circadian Rhythm of Locomotor Activity and Susceptibility to Methyl Parathion of Adult Tenebrio molitor (Coleoptera: Tenebrionidae) During the light phase they remained still, tucked away in whatever shelter was available. This is a true circadian rhythm, meaning the activity pattern is entrained to the light-dark cycle rather than being a random response.
In the wild and in grain storage facilities, this nocturnal habit keeps mealworms safe from predators that hunt by sight during the day. It also keeps them in more humid microenvironments, since the dark hiding places they occupy (under debris, inside crevices) tend to retain more moisture than exposed surfaces that dry out during daylight hours.
If you rear mealworms at home, you have probably noticed this pattern firsthand. Open the container during the day and the larvae and beetles sit motionless in the substrate. Come back after the lights have been off for a while and you’ll find them crawling around on the surface, feeding and exploring. This activity timing is not random laziness; it is a deeply ingrained survival strategy.
Even Pupae React to Light
Between the larval and adult stages, mealworms go through a pupal phase during which they appear outwardly inert. They do not walk or feed, but they are not as insensible as they look. Researchers studying habituation in Tenebrio molitor pupae exposed them to a continuous light stimulus and found that the pupae responded with vigorous abdominal contractions. At first, the number of contractions was high. Over the course of sustained exposure, the contractions declined, suggesting the pupae were habituating to the stimulus rather than simply running out of energy.3PubMed Central. Analysis of Habituation Learning in Mealworm Pupae (Tenebrio molitor)
Habituation is considered one of the simplest forms of learning: repeated exposure to a harmless stimulus leads to a reduced response. The fact that pupae can do this tells us two things. First, even at the pupal stage, mealworms sense and react to light. Second, their nervous system is capable of adjusting its output based on experience, which is a rudimentary but real form of behavioral plasticity. The pupal stage is not the sensory blank it might appear to be, and bright light is stressful enough to provoke a physical reaction even from an organism that cannot run away.
How Light Conditions Shape Growth and Development
Beyond immediate behavior, the amount of light mealworms experience over the course of their development influences how quickly they grow and mature. A study on Tenebrio molitor tested three photoperiod regimes: long-day conditions (16 hours of light, 8 of darkness), short-day conditions (8 hours of light, 16 of darkness), and constant darkness. The results were clear: constant darkness produced the fastest development and the highest growth rates.4PubMed Central. Effect of Temperature and Photoperiod on Development, Survival, and Growth Rate of Mealworms, Tenebrio molitor
Mealworms raised in constant darkness reached the pupal stage faster than those raised under either light regime. Across all temperatures tested, constant darkness produced an average developmental time that was significantly shorter than the long-day condition. At 25°C, the fastest developmental times were recorded under constant darkness, with larvae reaching pupation in about 126 days on average, compared with roughly 157 days under long-day conditions.4PubMed Central. Effect of Temperature and Photoperiod on Development, Survival, and Growth Rate of Mealworms, Tenebrio molitor That is a difference of about a month, which is substantial when you are trying to produce mealworms efficiently.
Growth rates told the same story. Across all temperatures, mealworms in constant darkness grew at an average rate of about 36 percent, compared with roughly 32 to 33 percent under long-day or short-day conditions. The very highest growth rates, around 41 percent, were recorded at 25°C and 30°C under constant darkness.4PubMed Central. Effect of Temperature and Photoperiod on Development, Survival, and Growth Rate of Mealworms, Tenebrio molitor So the darkness preference is not just a behavioral quirk; it maps onto real physiological outcomes. Mealworms raised in the conditions they prefer actually do better.
Temperature, it should be said, had a larger effect than light on most developmental measures. Survival was around 97 percent at 25°C but dropped to about 92 percent at 20°C, regardless of light conditions.4PubMed Central. Effect of Temperature and Photoperiod on Development, Survival, and Growth Rate of Mealworms, Tenebrio molitor If you had to choose between getting the temperature right and getting the lighting right, temperature wins. But when both can be controlled, darkness gives an additional and measurable advantage.
What This Means for Keeping Mealworms
Whether you raise mealworms as pet food, fishing bait, or for composting, the research points in a consistent direction: keep them in the dark. A solid-walled container with an opaque lid is better than a clear plastic bin in a lit room. If you need to check on them, a dim red light is your best option during the larval stage, since larvae do not appear to react to red wavelengths. Once the larvae have pupated and become adult beetles, even red light will disturb them, so brief white-light checks are better than prolonged observation under any color.
Ambient room light during the day is probably not going to kill your colony. Survival rates in the photoperiod study did not differ dramatically between light regimes at the same temperature. But if you are trying to maximize output, perhaps because you farm mealworms commercially or need a steady supply for reptile feeding, constant or near-constant darkness can shave weeks off the development cycle. That faster turnover adds up over multiple generations.
Moisture management matters here too. The dehydration override observed in lesser mealworms suggests that if your colony’s substrate is too dry, you may see beetles venturing into lit areas or behaving erratically. That is not a light problem; it is a hydration problem. Keeping the substrate slightly moist with small pieces of vegetable like carrot or potato should reduce stress behavior regardless of lighting.
Two Different “Mealworms” and How They Compare
It is worth clarifying that the common name “mealworm” is applied to at least two distinct beetle species. The yellow mealworm, Tenebrio molitor, is the large species sold in pet stores and increasingly farmed for human food. The lesser mealworm, Alphitobius diaperinus, is smaller and is primarily known as a pest in poultry houses. Much of the sharpest behavioral data on light avoidance comes from studies on the lesser mealworm, while the growth-rate and photoperiod data come from the yellow mealworm.
Both species belong to the family Tenebrionidae, commonly known as darkling beetles, a name that is itself a nod to their dark-loving habits. The family contains thousands of species, and negative phototaxis appears to be widespread among them. So while the two mealworm species differ in size, habitat, and economic importance, they share the core trait that anyone asking this question wants to know about: given the choice, they will choose darkness every time. The consistency across species, life stages, and experimental designs makes this one of the more reliable statements you can make in insect behavior. Mealworms do not just tolerate darkness. They seek it.
Red Light as a Research and Observation Tool
The finding that larvae ignore red light while adults do not has practical uses beyond pet-keeping. Entomologists studying mealworm behavior in the lab regularly use red illumination to observe larvae without altering their behavior. This is similar to the approach used in rodent research, where red light lets experimenters watch nocturnal animals during their active phase without disrupting circadian rhythms. For mealworm larvae, red light functions the same way: the animals behave as though they are in darkness, making observations more naturalistic.
With adult beetles, however, the trick does not work. Adults detect and respond to red light, although their reaction is slightly slower than their response to green or blue wavelengths. If you are running a classroom experiment on mealworm behavior or just watching your colony at night, keep this age distinction in mind. The larvae you observe under a red flashlight are behaving normally. The adult beetles in the same container are not.