There is no published scientific study demonstrating that pill bugs are specifically attracted to cornstarch. The idea circulates widely because cornstarch is a staple ingredient in classroom science fair projects where students test pill bug food preferences, and anecdotal reports from those experiments sometimes suggest pill bugs will nibble on it. But “attracted to” implies a deliberate seeking behavior, and the reality is more mundane: pill bugs are generalist detritivores that explore and sample a wide range of organic materials, and cornstarch happens to be one they can consume. Understanding what actually drives their feeding choices reveals a more interesting story than a simple yes-or-no attraction.
Where the Cornstarch Question Comes From
If you search for pill bugs and cornstarch, you will mostly land on science fair project guides rather than peer-reviewed research. These experiments typically place pill bugs in a choice chamber with cornstarch on one side and another substance (sand, baking soda, flour, sugar) on the other, then count how many bugs end up on each side after a set time. The setup is popular because pill bugs are easy to collect, harmless, and active enough to produce observable behavior in a short period. Cornstarch gets included because it is a safe, food-grade powder that teachers already have on hand.
The problem is that these experiments rarely control for the many things that actually influence where a pill bug goes. Pill bugs are strongly driven by moisture gradients, darkness, and physical contact with surfaces. If the cornstarch side of the chamber happens to be slightly damper, slightly darker, or slightly more textured, the bugs will cluster there for reasons that have nothing to do with food preference. Professional researchers studying isopod behavior use tightly controlled humidity and light conditions precisely because these variables overwhelm dietary signals. So when a student concludes “pill bugs prefer cornstarch,” they may actually be observing a humidity preference or a thigmotactic response, the tendency to press against surfaces, rather than any genuine food choice.
What Pill Bugs Actually Prefer to Eat
Pill bugs, primarily the common species Armadillidium vulgare, are detritivores. Their main food in the wild is decaying leaf litter, rotting wood, and other decomposing plant material. They show a measurable preference for leaves that have already begun to break down over fresh ones. Research on terrestrial isopods and woodland leaf litter decomposition has shown that previously decayed leaves are their preferred food source, and feces derived from those decayed leaves lost only modestly more mass than intact decaying leaves, suggesting the bugs are extracting nutrients from material that is already partially degraded by fungi and bacteria.1PubMed. Effects of terrestrial isopods on the decomposition of woodland leaf litter
This preference for pre-decayed material makes ecological sense. Fungi and bacteria soften tough plant cell walls and concentrate nutrients, making the food easier to digest and more nutritionally rewarding. A fresh green leaf is far less appealing to a pill bug than a brown, crumbling one from the bottom of a leaf pile. In gardens, you will find pill bugs congregating under mulch, in compost bins, and around rotting logs rather than on living plants, though they will occasionally feed on tender seedlings or strawberries when conditions are right.
Cornstarch is a purified carbohydrate extracted from corn kernels. It contains essentially no fiber, no protein, and no fat. While pill bugs can physically consume it and likely extract some energy from the starch molecules, it is a far cry from the nutritionally complex food they seek in nature. Decaying leaves come packaged with microbial biomass, mineral traces, and a mix of carbohydrates and proteins. Cornstarch offers calories but not much else, which makes it an unlikely target for genuine food-seeking behavior.
How Pill Bugs Digest Plant Material
One reason people assume pill bugs would be drawn to cornstarch is that starch is a plant-derived carbohydrate, and pill bugs eat plants. But the carbohydrates pill bugs are adapted to process are far more complex than cornstarch. Their primary dietary challenge is breaking down cellulose and lignin, the tough structural materials in plant cell walls, not simple starches.
Research on A. vulgare has revealed that lignocellulose digestion in these animals is a collaborative effort between the pill bug’s own enzymes and the microbial community living in its gut. The host produces its own carbohydrate-active enzymes expressed in digestive tissues, while gut bacteria and archaea contribute a complementary set of enzymes that target cellulose, hemicellulose, and lignin. Together, these two enzyme repertoires allow pill bugs to extract nutrition from woody, fibrous plant debris that most animals cannot digest.2PubMed Central. Lignocellulose degradation at the holobiont level: teamwork in a keystone soil invertebrate
The gut bacteria involved are dominated by members of the Bacillaceae family, which made up roughly 60 to 70 percent of bacteria isolated from pill-bug guts in one study that also examined termites and stem borers.3Scientific Reports. Diversity and functional significance of cellulolytic microbes living in termite, pill-bug and stem-borer guts These microbes are cellulolytic, meaning their specialty is cracking open the tough glucose chains locked inside cellulose. Cornstarch, by contrast, is already a relatively simple molecule. It consists of amylose and amylopectin, which are chains of glucose connected by bonds that most animals can break without specialized microbial help. So while pill bugs could digest cornstarch, their digestive system is essentially overqualified for the job. Their evolutionary investment has gone into cracking the hard stuff, not the easy stuff.
What Actually Drives Pill Bug Movement
If you watch pill bugs in a choice chamber, you might interpret their clustering near cornstarch as attraction to it. But pill bug movement is governed by a hierarchy of environmental cues, and food odor ranks surprisingly low on that list compared with physical conditions.
Moisture is the dominant driver. Pill bugs are terrestrial crustaceans that breathe through gill-like structures called pleopods on the underside of their abdomen. These structures need to stay moist to function, so pill bugs are under constant pressure to find and stay in humid microhabitats. When given a choice between a dry area with food and a moist area without food, pill bugs reliably choose moisture. This is why you find them under rocks, logs, flowerpots, and mulch rather than out in the open even if food is present.
Light avoidance is the second major driver. Pill bugs are negatively phototactic, meaning they move away from light. In a choice chamber with uneven lighting, bugs will pile up on the darker side regardless of what food is there. Contact preference, or thigmotaxis, adds another layer. Pill bugs prefer to have their body touching surfaces on multiple sides, which is why they wedge themselves into cracks and under flat objects. A pile of cornstarch powder offers more surface contact than a smooth, empty chamber floor, which alone could explain clustering behavior in a poorly designed experiment.
This does not mean pill bugs have zero food-seeking behavior. They do detect chemical cues from decaying organic matter and will orient toward decomposing leaf litter. But these chemical signals are much stronger from microbe-rich, partially rotted material than from a refined powder like cornstarch, which has almost no volatile organic compounds to signal its presence.
Why Science Fair Results Can Be Misleading
The cornstarch question persists in large part because science fair experiments produce seemingly clear results that get shared without the context needed to interpret them. A few specific problems recur in these setups.
- Moisture confounds: Cornstarch is hygroscopic and absorbs ambient moisture. In a sealed choice chamber, the cornstarch side may develop a slightly higher humidity microclimate, drawing pill bugs for reasons unrelated to food.
- Texture confounds: Fine powder offers more surface contact than a bare plastic floor, triggering thigmotactic preferences rather than feeding interest.
- Small sample sizes: Most classroom experiments use five to ten pill bugs observed for 15 to 30 minutes. With such small numbers and short observation windows, random movement can easily look like preference.
- No feeding verification: Counting how many bugs are near the cornstarch is not the same as confirming they are eating it. Pill bugs can sit on a substance for shelter, moisture, or contact comfort without consuming it. Actual feeding studies measure mass loss of the food source or examine gut contents.
None of this means science fair experiments are worthless. They teach observation, hypothesis formation, and experimental design. But the results should be interpreted as preliminary observations, not definitive evidence of dietary preference. A researcher studying pill bug food choices would use much longer trials, larger populations, controlled humidity and temperature, and would measure actual consumption rather than proximity.
Foods That Pill Bugs Genuinely Seek Out
If you want to attract pill bugs deliberately, whether for a garden trap, a composting project, or a pet isopod colony, the materials that work best align with what they eat in nature. Decaying hardwood leaves, especially oak and maple, are consistently preferred. Rotting vegetables and fruit scraps are readily consumed. Pill bugs will eat carrots, potatoes, squash, apples, and similar produce once it starts to soften and decompose. In captivity, isopod keepers report strong responses to fish flakes, dried shrimp, and cuttlebone, the last being a calcium source that pill bugs need for their exoskeleton, which is unusual among arthropods because it is partially mineralized with calcium carbonate.
Calcium is worth highlighting because it represents a nutritional need that genuinely shapes pill bug behavior. Unlike insects, whose exoskeletons are made mostly of chitin, pill bugs have a calcium-rich exoskeleton more reminiscent of their marine crustacean relatives. They need a steady supply of dietary calcium, especially around molting, when they shed and rebuild their exoskeleton in two stages, back half first, then front half a few days later. This calcium demand drives them toward mineral-rich food sources and explains why they sometimes nibble on concrete, chalk, or limestone in gardens. Cornstarch contains essentially no calcium and no minerals at all, which further argues against it being a significant attractant.
Pill Bugs as Decomposers
The broader context for understanding pill bug diet is their ecological role. They are among the most important macrofauna decomposers in temperate ecosystems. By shredding leaf litter into smaller fragments and passing it through their gut, they dramatically increase the surface area available for microbial colonization. Research has confirmed that isopods accelerate the breakdown of woodland leaf litter, and their feces become a substrate for further microbial decomposition.1PubMed. Effects of terrestrial isopods on the decomposition of woodland leaf litter This nutrient cycling function depends on pill bugs consuming complex, fibrous organic material, not refined starches.
The microbial communities in their guts are specifically tuned for this work. Two taxonomically distinct but functionally overlapping microbial communities have been identified in A. vulgare populations from different origins, suggesting that the pill bug’s digestive strategy is flexible enough to recruit different bacterial partners depending on local conditions, while maintaining the same core ability to break down tough plant fibers.2PubMed Central. Lignocellulose degradation at the holobiont level: teamwork in a keystone soil invertebrate This functional redundancy points to a digestive system built for resilience in processing difficult plant material, not one designed to detect and pursue simple carbohydrates like cornstarch.
Using Pill Bugs in Gardens and Compost
For gardeners, the practical takeaway is that pill bugs are allies in decomposition and generally do not need to be baited or attracted with anything exotic. A damp area with plenty of leaf litter or mulch will sustain a healthy population. If you want to concentrate them in one spot, perhaps to keep them away from tender seedlings, a simple trap of a damp piece of cardboard or a halved cantaloupe rind placed on the soil surface overnight will draw far more pill bugs than cornstarch ever would. They come for the moisture and the decaying organic matter, which is exactly what their biology equips them to find.
In compost bins, pill bugs are among the first macrofauna to colonize and begin shredding organic inputs. They work best in outdoor compost systems where moisture levels stay high and a mix of brown and green material provides the decaying-leaf habitat they prefer. Vermicomposters sometimes find pill bugs appearing alongside their worms, and the two coexist well since they process material at different stages of decomposition.
For those keeping isopods as pets, a trend that has grown considerably in recent years, diet variety matters more than any single ingredient. Experienced keepers offer a rotating mix of decayed hardwood leaves, vegetable scraps, protein sources like dried insects, and calcium supplements. Cornstarch would not be harmful in small amounts, but it would not provide meaningful nutrition either. It is essentially empty calories for an animal whose digestive system is engineered to extract value from woody plant debris. The cellulolytic bacteria in their guts, dominated by Bacillaceae species, thrive on the complex polysaccharides found in leaf litter, not on refined starch granules.3Scientific Reports. Diversity and functional significance of cellulolytic microbes living in termite, pill-bug and stem-borer guts
Pill Bugs and Other Common Household Substances
The cornstarch question is part of a broader set of folk claims about what pill bugs are attracted to or repelled by. Some people sprinkle diatomaceous earth to repel them, which works not by repelling but by physically damaging their gill-like breathing structures and causing desiccation. Others claim pill bugs are attracted to beer traps, and there is some truth to this since beer contains fermenting sugars and yeast that produce volatile organic compounds resembling those released by decaying plant material. Beer traps designed for slugs do sometimes catch pill bugs as bycatch.
Essential oils like peppermint and citrus are sometimes suggested as pill bug repellents. There is limited formal research on this, but anecdotal reports from pest management professionals suggest these have a modest short-term effect at best. The most effective way to reduce pill bug numbers in unwanted areas remains reducing moisture. Fix leaky faucets, improve drainage around foundations, remove ground-level debris, and ensure mulch is not piled directly against the house. Pill bugs cannot survive long in dry conditions, so moisture management is far more effective than any attractant or repellent substance.
One substance that genuinely does attract pill bugs in a well-documented way is copper. Or rather, copper repels them. Isopods are sensitive to heavy metals, and copper in particular has been shown to trigger avoidance behavior. This is relevant in contaminated soils where heavy metal levels can alter isopod distribution patterns. It is also why some gardeners place copper tape around raised beds, though this technique is more commonly associated with slugs and its effectiveness against pill bugs has not been rigorously tested in field conditions.