Accidentally eating a worm or larva found inside a nut is, for the vast majority of people, completely harmless. Your stomach acid makes short work of these tiny creatures, and they pass through your digestive system without causing illness, infection, or parasitic colonization. The bigger risks are indirect: allergic cross-reactivity if you’re sensitive to shellfish, and the possibility that a heavily infested nut carries mold or off flavors that signal broader quality problems.
What Those “Worms” Actually Are
The “worms” people find curled inside pecans, walnuts, almonds, and other tree nuts are almost never true worms. They’re the larval stage of various moths and beetles that lay their eggs on or inside developing nuts while they’re still on the tree. In pecans, for example, the most common culprits include the pecan weevil, whose larvae are robust, dirty-white, C-shaped grubs up to about five-eighths of an inch long that develop inside the nut during late summer and early fall. The pecan nut casebearer is another frequent invader, with pale brownish-yellow to light gray-brown larvae of similar size, while the hickory shuckworm produces smaller white larvae that tunnel into young nuts and destroy the interior or burrow into the shuck and prevent the kernel from developing properly.1Oklahoma State University Extension. Field Key to Larvae in Pecans – Section: Descriptions of Larvae
Other tree nuts face their own species. The navel orangeworm is a common pest in almonds and pistachios in California. Codling moth larvae occasionally turn up in walnuts. Indian meal moths, a ubiquitous pantry pest, can infest nuts after harvest during storage. What all these insects share is that their larvae are soft-bodied, typically pale, and relatively small. None of them are parasites of humans or other mammals. They’re plant-feeders, and you are not part of their life cycle.
What Happens in Your Digestive System
If you bite into a nut and realize a second too late that something soft and squirming was inside, the larva is heading into an environment that is extraordinarily hostile to insect life. Human stomach acid sits at a pH between roughly 1.5 and 3.5, an acidity level that rapidly breaks down soft-bodied insect larvae the same way it breaks down any other protein. The larva is digested just like the nut around it. You absorb whatever small amount of protein and fat the larva contained, and the rest moves through without incident.
A reasonable worry is whether the larva could somehow survive the trip and take up residence in your gut. This concern has a name in medical literature: intestinal myiasis, where fly larvae colonize the gastrointestinal tract. But most documented cases involve accidental ingestion of fly larvae from completely different environments, not nut-infesting species. Even in those cases, evidence suggests the larvae rarely survive. A case report examining intestinal pseudomyiasis caused by drain-fly larvae noted that the breathing requirements of these larvae make it unlikely they could survive, let alone continue developing, inside the gastrointestinal tract.2Cureus. Intestinal and Urinary Pseudomyiasis by Psychodinae Larvae in an Adolescent: A Fact, Fallacy, or Harmless Spectator? The larvae that infest nuts are even less equipped for that environment. They’re adapted to chew on plant tissue inside a dry, airy shell, not to withstand stomach acid and zero oxygen. In practical terms, there is no documented case of a nut-boring larva establishing an infection in a human gut.
The one scenario where swallowing a larva might cause mild GI upset has nothing to do with the larva itself. If the nut was heavily damaged and had begun to mold, the combination of degraded nut oils and fungal metabolites could cause nausea, an unpleasant taste, or a brief bout of stomach discomfort. That’s a food-quality issue, not an insect issue.
The Allergy Risk That Deserves Attention
This is where the story gets more clinically interesting. If you have a known allergy to shellfish, dust mites, or cockroaches, eating insect larvae could theoretically provoke a reaction, even if you’ve never been allergic to insects before. The reason is a protein called tropomyosin, which functions as a kind of universal allergen across invertebrate species. Tropomyosin from crustaceans like shrimp, lobster, and crab shares enough structural similarity with tropomyosin from insects, arachnids, and mollusks that the immune system can mistake one for the other.3PubMed. Tropomyosin: an invertebrate pan-allergen
This cross-reactivity isn’t theoretical. Researchers have documented allergic reactions to edible insects that tracked back to tropomyosin sensitivity. In one case, a 27-year-old man had an allergic reaction to a commercially sold house cricket snack. Days later, he had a similar reaction after eating shrimp. Laboratory analysis confirmed that the protein responsible in both cases belonged to the tropomyosin allergen family.4PubMed. Allergic Reaction to a Commercially Available Insect Snack Caused by House Cricket (Acheta domesticus) Tropomyosin Beyond tropomyosin, new IgE-binding proteins in insects have been identified that go beyond the well-known pan-allergens, meaning the picture of insect allergy is still expanding.5PubMed Central. Allergens from Edible Insects: Cross-reactivity and Effects of Processing
For someone who accidentally eats one small larva in a pecan, the actual allergenic dose is tiny, far less than eating a serving of cricket flour or a whole shrimp. A serious reaction from a single small larva in a nut would be unusual. But if you have a severe shellfish or dust-mite allergy and you notice you’ve been eating from a bag of heavily infested nuts, it’s worth being aware that the proteins involved are related. If you ever develop unexplained hives, oral tingling, or breathing difficulty after eating nuts that seemed “off,” cross-reactivity with insect proteins is a possibility your allergist would want to consider.
Mycotoxins and the Real Risk of Damaged Nuts
The larva itself is a negligible health concern, but the damage it caused to the nut might not be. When insect larvae bore through a developing nut, they break the shell’s natural barrier against moisture and fungal spores. This can invite mold colonization, particularly by Aspergillus species that produce aflatoxins, a group of potent carcinogens regulated in food supplies worldwide. A wormy nut isn’t automatically a moldy nut, but the two problems travel together often enough that the nut industry treats insect damage as a predictor of mycotoxin risk.
Research on insect larvae and aflatoxin paints a somewhat reassuring picture on one front: the larvae themselves don’t seem to concentrate toxins. A study feeding aflatoxin-contaminated groundnut press cake to black soldier fly larvae found that aflatoxin B1 levels in the larvae were lower than the levels in the feed material, meaning no bioaccumulation occurred.6PubMed Central. Bioconversion of aflatoxin-contaminated groundnut press cake by larvae of black soldier fly Hermetia illucens results in a complete mass balance for aflatoxin B1 That study involved a different insect species than the ones that infest tree nuts, so the finding doesn’t transfer directly. But the general principle that soft-bodied larvae don’t act as toxin magnifiers is worth noting.
The more practical concern is the nut meat itself. If a nut has visible tunneling, dark discoloration, or a bitter and musty taste, those are signs of mold growth that may have produced mycotoxins. One wormy nut eaten accidentally isn’t going to give you aflatoxin poisoning. Aflatoxin risk is about chronic, repeated exposure to contaminated food over time. But tasting something bitter, rancid, or “off” in a nut is a good reason to spit it out and check the rest of the batch.
Taste, Rancidity, and How to Spot Trouble
Before health risks even enter the picture, most people’s first signal that something went wrong is flavor. Insect-damaged nuts often taste noticeably different from intact ones. The tunneling breaks cell walls and exposes the nut’s oils to oxygen, accelerating rancidity. This process produces unpleasant, stale, or soapy off-flavors that your palate usually catches before your brain processes what happened.
Lipid oxidation in insect-related food products is a well-documented quality problem. A study examining commercially available insect-based food products found that rancidity was common, with all samples exceeding established thresholds for malondialdehyde, a marker of fat breakdown, and nearly half exceeding peroxide limits.7PubMed Central. Insect-based products commercialized online: a snapshot of lipid oxidation and mineral content That study looked at products made from insects rather than insect-infested nuts, but the underlying chemistry is the same: when insect fat and nut fat are both exposed to oxygen and time, oxidation follows. A nut that has been partially consumed by a larva, with its interior disrupted and its oil exposed, is primed for exactly this kind of degradation.
Spotting infested nuts before you eat them comes down to a few simple checks:
- Entry holes: Look for tiny round holes in the shell, often barely a millimeter across. These are where the adult insect laid its egg or where the mature larva bored out.
- Weight: A nut that feels suspiciously light for its size may be mostly hollow inside, its meat consumed by a larva.
- Webbing or frass: Indian meal moth larvae leave behind fine silk webbing and small pellets of excrement called frass. If you see either in a bag of shelled nuts, the batch is infested.
- Discoloration: Dark stains, mushy spots, or powdery residue inside a cracked nut suggest either insect damage, mold, or both.
- Taste: A bitter, soapy, or musty flavor on the first bite is your most reliable guard. Spit it out and move on.
How Industry Keeps Larvae Out of Your Bag
Commercial nut processing includes multiple steps designed to intercept infested nuts before they reach consumers. After harvest, nuts are typically dried to reduce moisture, which slows insect development and mold growth. Mechanical sorting removes nuts that are visibly cracked, undersized, or discolored. More advanced operations use optical sorting, where cameras and near-infrared sensors can detect internal damage invisible to the naked eye. Researchers have developed methods using near-infrared spectroscopy to discriminate internally damaged almonds from sound ones, identifying specific wavelengths that reveal tunneling or decomposition hidden beneath an intact shell.8Journal of Food Engineering. Internal damage inspection of almond nuts using optimal near-infrared waveband selection technique
Cold storage is another common control measure. Keeping shelled nuts at low temperatures slows or halts larval development and kills many pest species over time. Some processors use controlled-atmosphere storage, replacing oxygen with carbon dioxide or nitrogen to suffocate insects at all life stages without chemical residues. Fumigation with phosphine gas remains an option for large-scale treatment of stored nuts and dried fruits, though the industry has been moving toward non-chemical methods where possible.
Despite all of this, no system catches every infested nut. A larva that entered a developing pecan on the tree, fed inside the shell, and pupated or died before harvest can leave behind a perfectly sealed nut that looks and weighs normal until you crack it open. This is why finding an occasional larva in home-shelled nuts, especially from backyard trees or farmers’ markets, isn’t unusual and doesn’t indicate a systemic food-safety failure.
Nutritional Content of Insect Larvae
This might not be the reassurance you’re looking for, but the larvae themselves are nutritious. Edible insects as a category are high in protein, with levels ranging from about 20 to 76 percent of dry weight depending on species and life stage. Their fat content varies widely, from 2 to 50 percent of dry weight, and can include a high proportion of polyunsaturated fatty acids, sometimes up to 70 percent of total fatty acids.9NFS Journal. Nutritional and sensory quality of edible insects The larvae found in your pecans are not the same species evaluated in most edible-insect research, which tends to focus on crickets, mealworms, and black soldier flies raised under controlled conditions. But the basic nutritional profile of insect larvae is similar across many species: they’re essentially small packets of protein and fat wrapped in a thin layer of chitin.
None of this means you should regard a wormy nut as a bonus. The larvae inside tree nuts have been eating nut meat their entire lives, so you’re not gaining nutrition you wouldn’t have gotten from the nut itself. And unlike farmed edible insects raised on clean substrates, wild nut-boring larvae have been living in an uncontrolled environment where mold and bacteria could be present. The point is just that the larval tissue itself is, from a nutritional standpoint, food. Your body treats it like food because it is.
Why the Disgust Hits Harder Than the Actual Risk
Knowing all of the above, most people would still rather not eat a worm. The disgust reaction to finding a larva in your food is intense, immediate, and completely out of proportion to the actual danger. That disproportionality is by design. Disgust evolved as a behavioral immune system, a set of rapid-fire psychological responses that steer organisms away from potential sources of infection before the conscious mind even finishes evaluating the threat.10PubMed Central. Disgust as an adaptive system for disease avoidance behaviour The system works on cues rather than on accurate risk assessment. A soft, wriggling, unexpected creature inside food you’ve already put in your mouth triggers the maximum alarm, even when the actual pathogen risk is near zero.
Cultural conditioning amplifies the biological signal. In many Western food traditions, insects are categorized as contaminants rather than food, and encountering one in a meal triggers not just disgust but a sense of violation, as if a safety boundary has been breached. Research on attitudes toward edible insects has argued that resistance to eating insects in Western contexts is rooted less in ecology or nutrition than in culturally shaped disgust and food neophobia, reinforced by frameworks that portray insect consumption as primitive.11Journal of Insects as Food and Feed. Disgust, culture and colonial legacies in attitudes toward edible insects In many other food cultures worldwide, insect larvae are eaten deliberately and valued as reliable nutrition. The visceral horror you feel finding a grub in your walnut is real, but it’s a cultural artifact layered on top of an evolutionary reflex, not a calibrated warning that you’re in medical danger.
The practical upshot: if you ate a wormy nut and only realized it afterward, there’s no need to induce vomiting, call poison control, or visit the emergency room. If the nut tasted fine, the larva was almost certainly digested without consequence. If the nut tasted bitter, rancid, or off, the discomfort you feel is more likely from the degraded nut oils or mold than from the larva. Either way, one accidental encounter poses no meaningful health risk to an otherwise healthy person. The bag of nuts may be worth inspecting more carefully before you keep snacking, but you yourself are fine.