The “worm” inside an apple is almost always the larva of one of two insects: the codling moth or the apple maggot fly. Neither is a true worm. Both are harmless if accidentally swallowed, though the experience is understandably unpleasant. Here’s what you’re actually looking at, how it got there, and what to do about it.
What the “Worm” Actually Is
The most common culprit is the codling moth larva. It’s a pinkish-white caterpillar with a brown or dark brown head and six tiny legs, growing up to about 20 mm (roughly three-quarters of an inch) long. If you cut into an apple and find a tunnel running from the skin toward the core, packed with reddish-brown crumbly debris, you’re looking at codling moth damage. That debris is called frass, a mix of feces and chewed fruit tissue the larva leaves behind as it eats its way inward.
The other possibility is the apple maggot, which is the larva of a fruit fly. Apple maggots are smaller, only about 6.5 to 8 mm long, and look quite different. They’re white, completely legless, and have no visible head. Instead, they have a wedge-shaped body with two tiny black hooks at the pointed feeding end. Rather than tunneling to the core in a single path, apple maggots tend to create winding, irregular brown trails through the flesh, making the fruit feel soft and mealy.
How Larvae Get Inside
Codling moths lay their eggs on or near developing fruit. When an egg hatches, the tiny larva chews through the apple’s skin and burrows inward, tunneling all the way to the core where the seeds are. The entry point is often nearly invisible, marked only by a tiny mound of reddish-brown frass about 1/16 inch across. These entry holes frequently appear where two fruits touch each other or where a leaf rests against the skin, making them easy to miss during a casual inspection. If you scrape away the frass, you can see the pinhole where the larva entered.
Apple maggot flies take a different approach. The adult fly punctures the apple’s skin with a needle-like organ and deposits eggs directly into the flesh. The larvae hatch inside the fruit and feed as they grow, so there’s no obvious entry tunnel. The damage often isn’t visible on the outside at all until the fruit starts to decay.
Is It Safe If You Ate Some?
Accidentally eating a codling moth larva or apple maggot, or a bite of fruit containing frass, is not a health risk. These larvae feed exclusively on fruit tissue and don’t carry bacteria, parasites, or toxins that affect humans. They’re essentially protein. The frass is similarly harmless, made up of digested apple and waste from a creature that eats nothing but apple.
This is different from the parasites sometimes found on raw leafy greens, like rat lungworm, which arrives via slugs or snails on lettuce. The insect larvae inside apples are a completely different situation. There are no documented cases of illness from accidentally swallowing a codling moth larva or apple maggot. If you bit into an apple and noticed a worm after the fact, you can stop worrying.
How to Spot an Infested Apple
Before biting into an apple, especially one from a farmers market, backyard tree, or organic source, look for these signs:
- Tiny brown mounds on the skin. A small pile of reddish-brown crumbly material, about the size of a pinhead, marks a codling moth entry point. Check where fruits were touching each other, near the stem end, and around the blossom end at the bottom.
- Soft or discolored patches. Apple maggot damage often shows up as mushy, brownish areas under skin that may still look normal. If part of the apple feels unusually soft when you squeeze it, larvae may have been feeding inside.
- Brown trails in the flesh. When you slice the apple, irregular brown streaks running through the white flesh indicate maggot feeding tracks. A single clean tunnel heading toward the core points to codling moth.
If you find damage in one section, the rest of the apple is fine to eat. Just cut away the affected area generously. The larvae don’t contaminate the surrounding tissue with anything harmful.
Why Store-Bought Apples Rarely Have Worms
Commercial apples go through USDA grading before reaching grocery shelves. The top grades, U.S. Extra Fancy and U.S. Fancy, require apples to be completely free of insect damage. Even the lower U.S. Utility grade prohibits “serious damage” from insects. Combined with the pest management programs used in commercial orchards, this means finding a larva in a supermarket apple is extremely rare. It happens occasionally, but the vast majority of wormy apples come from backyard trees, pick-your-own orchards, or small-scale organic farms where pest control is less intensive.
Preventing Worms in Backyard Apples
If you grow your own apples, codling moths are likely your biggest challenge. A few strategies make a real difference without requiring heavy pesticide use.
Fruit bagging is the most reliable non-chemical method. About two to three weeks after bloom, when the fruitlets are roughly the size of a marble, you enclose each one in a small paper or nylon bag. This physically blocks moths from laying eggs on the fruit. It’s labor-intensive but highly effective for small trees.
Picking up fallen fruit promptly matters more than most people realize. Larvae that have finished feeding inside a fruit drop to the ground with it, then crawl into the soil or under bark to pupate and emerge as moths the next season. Removing and disposing of dropped apples, rather than leaving them to rot under the tree, breaks this cycle.
Monitoring with pheromone traps helps you time any treatments. These sticky traps lure male codling moths using synthetic versions of the scent female moths release. When you start catching moths, you know eggs will be appearing on fruit within a week or two. For backyard growers, mating disruption products that flood a small area with the same synthetic scent can confuse males enough to significantly reduce the next generation.
Thinning fruit clusters also helps. Codling moths prefer to lay eggs where two fruits touch, because the sheltered crevice protects the egg and gives the larva an easy, hidden entry point. Spacing fruits so they don’t rest against each other removes that advantage.