The short answer
- Apple: brown threadlike trails all through the flesh mean apple maggot; a pinkish caterpillar with a dark head in a tunnel to the core, with crumbly reddish-brown frass at the hole, means codling moth; a legless, curled grub in a fruit with a crescent-shaped scar means plum curculio.[3][4][6][8][10][9]
- Cherries and berries: tiny white maggots in ripe fruit are spotted-wing drosophila or, in cherries, cherry fruit fly. Corn and tomatoes: a hairy, striped caterpillar at the ear tip or in a wet cavity by the tomato stem is the same insect, the corn earworm, also called tomato fruitworm.[14][15][16][17][19][21][22]
- Squash and cucumbers: a caterpillar that bored into the fruit points to pickleworm, while squash vine borers live in the stems. Peppers: a pale maggot without a head under the cap is pepper maggot. Southern peas: small round holes with legless grubs in the seeds are cowpea curculio. Dried fruit and nuts in the pantry: Indianmeal moth.[24][25][26][29][30][31][32][36][37]
Profiles of the larvae on this page
Does it have legs and a head? Caterpillar, maggot or grub
Get the worm onto a white plate and look at the front end with a hand lens. Kentucky's guide to larval types starts by asking whether the larva has segmented legs on the three body segments behind the head, and notes that in some larvae a hard or distinct head may be absent or hidden.[1]
Those two features split fruit and vegetable larvae into three groups that come from different insects, and each group points to a different set of suspects in the crop sections below.[1][2]
- Caterpillar (moth larva): three pairs of true legs behind a well-developed head, plus fleshy prolegs on the abdomen, five pairs or fewer. Missouri says prolegs occur only in the caterpillar stage and help it hold on. In produce: codling moth, Oriental fruit moth, corn earworm, pickleworm, European corn borer, Indianmeal moth.[2][1]
- Maggot (fly larva): no legs and no visible head. Kentucky describes fly maggots as cream to white and tapered at the head end, blunt at the rear; UC IPM gives the same pointed-front, blunt-rear shape for seedcorn maggot. In produce: apple maggot, cherry fruit flies, spotted-wing drosophila, pepper maggot, seedcorn maggot.[1][33][30]
- Grub (weevil larva): no legs but a distinct brown head, often curled into a C. Kentucky says weevil grubs turn up in seeds, nuts and plant tips. In produce: plum curculio in tree fruit and cowpea curculio in southern peas.[1][9][32]
- More than five pairs of prolegs means a sawfly larva, not a caterpillar, according to Missouri and Kentucky.[2][1]
Brown trails through my apple, or a tunnel straight to the core?
Cut the apple in half through the core. UC IPM says young apple maggots tunnel throughout the flesh, leaving brown, irregular trails that enlarge as the larvae grow while the fruit decays along them; Wisconsin calls the insect the railroad worm and describes the darkened trails you see in a halved apple. Codling moth larvae instead tunnel to the core and feed on the seeds, according to UMN and Colorado State.[3][4][7][8]
- Apple maggot: cream-colored, legless and up to 1/4 inch long (UC IPM). In Minnesota the adults appear in early July and stay active until September, with a peak from late July through early August, so infested apples show up from mid to late summer.[3][5][4]
- Codling moth: a white to light pink caterpillar with a dark brown head (UC IPM), up to 1/2 inch long (UMN). The entry hole, called a sting, is plugged with reddish-brown, crumbly frass. UC IPM says the same worm attacks pears and walnuts, and Colorado State notes that in pears it enters mainly at the blossom (calyx) end.[6][7][8]
- Plum curculio: a legless, C-shaped grub with a brown head, 1/4 to 1/3 inch long when full grown (Wisconsin; New Hampshire gives 1/3 inch, Penn State 1/4 inch). The clue on the outside is a small crescent-shaped scar where the egg was laid, and Penn State and Wisconsin both say larvae mostly survive in fruit that drops.[10][9][11]
- Oriental fruit moth: a pinkish white caterpillar with a brown head, 1/2 inch long when grown. Kentucky says it attacks apple, plum, cherry and pear as well as peach. UC IPM separates it from look-alike worms by a row of short, stiff bristles (the anal comb) under the last body segment, visible with a hand lens.[13][12]
A worm next to the pit of my peach or plum?
Kentucky calls the Oriental fruit moth one of the most serious peach pests in the state. Its first larvae of the season bore into shoot tips, which wilt as the larva tunnels down the twig; Kentucky and UC IPM both say larvae of later generations move into the fruit.[13][12]
Plum curculio also attacks plum, cherry, peach and apricot. Wisconsin says the egg-laying scars on stone fruit look the same as on apple, but a drop of clear to amber sap may weep from the wound. A legless grub with a brown head near the pit, under a weeping crescent scar, points to curculio rather than a moth.[10][9][11]
Tiny white maggots in cherries or berries that looked fine?
Spotted-wing drosophila is the usual answer in raspberries, blackberries, blueberries and strawberries, and it also infests cherries. UC IPM describes the larvae as tiny, white, cylindrical maggots a little longer than 1/8 inch when grown, and UMN adds that they taper at one end. The flesh around them turns brown and soft, with sunken spots that can leak juice on smooth fruit like cherries and blueberries.[14][15]
What sets it apart from the ordinary vinegar flies is the fruit it uses. UC IPM says other Drosophila mostly attack rotting or fermenting fruit, while spotted-wing drosophila attacks healthy ripening fruit as well as damaged or split fruit. In Minnesota the flies first appear in late June or early July, with the highest numbers in August and September.[14][15]
In cherries, the other candidates are cherry fruit flies, close relatives of the apple maggot. Kentucky says the damage shows as sunken, shriveled areas on nearly ripe and ripe fruit, which often looks normal until the maggots are nearly grown; the Pacific Northwest handbook describes white maggots that cut an exit hole as they leave. Utah State says the females lay eggs under the skin without leaving visible marks.[16][17][18]
Timing differs by region: Kentucky has cherry fruit fly adults emerging from late May to early July, and the Pacific Northwest handbook has western cherry fruit fly adults from mid-May, about five weeks before harvest, until the end of July.[16][17]
Why is there a fat striped caterpillar at the tip of my corn?
A caterpillar chewing the kernels at the tip of a sweet corn ear, under the silks, is most likely the corn earworm; UC IPM says the ears are its preferred feeding site. Kentucky finds the larvae feeding in the ear tips after silking, and UC IPM says young larvae clip the silks. Kentucky says the females lay single eggs on fresh silks.[19][20]
Color is no help, because Kentucky says earworms range from yellow and green to red and brownish black. Look instead for a brown head without markings and a body covered with tiny spines. Grown larvae are about 1 1/2 inches long, according to UC IPM and Clemson.[19][20][22]
Late plantings get the most worms. UC IPM says the earworm is most abundant in August and September because its numbers build as the season goes on, and Kentucky says many more moths are looking for egg-laying sites when late-planted corn silks.[20][19]
Smaller, whitish larvae with a light brown head in damaged or overripe kernels may be sap beetle larvae. UMN says sap beetles drawn in by fermenting produce can also infest undamaged corn and berries, and their larvae feed on the kernels.[23]
A hole by the tomato stem and a wet mess inside?
The tomato fruitworm is the same insect as the corn earworm (and the cotton bollworm), according to UC IPM and Clemson. UC IPM says young larvae enter the stem end of fruit 3/4 to 2 inches across and leave a messy, watery cavity filled with cast skins and droppings.[21][22]
Newly hatched fruitworms are creamy white with a black head and black bristle bases; older ones turn yellowish green to nearly black with fine white lines along the body (UC IPM). Clemson says the larvae are cannibalistic, so a tomato rarely holds more than one. For other kinds of tomato holes, see our tomato damage guides linked below.[21][22]
A worm inside my squash or cucumber, or a vine that wilted overnight?
A caterpillar inside the fruit of squash, zucchini, cucumber or cantaloupe is most often a pickleworm. Clemson and eOrganic say the larvae feed on the blooms first and bore into the developing fruit; eOrganic adds that they often move into fruit when about half grown and leave soft droppings inside.[24][25]
Young pickleworms are thin, white and covered in small black spots. eOrganic says older larvae get plump and darker and lose the spots, and that their color varies with what they ate, from off-white to green, yellow or orange.[25]
Outside the far South the moths have to arrive each year: eOrganic says they overwinter in the U.S. only in south and central Florida and southern Texas, then the moths move north in summer into the Carolinas and as far as Oklahoma and Nebraska. Its relative the melonworm, dark green with two white side stripes as it matures, normally eats leaves but may feed on or burrow into fruit when foliage runs out.[25]
A squash plant whose runner or whole vine wilts suddenly in midsummer has a different worm. Iowa State says the squash vine borer is a white caterpillar inside the stem, usually near the soil line, from June through August; Kentucky says it reaches 1 inch with a brown head and pushes yellow-brown frass out of holes at the wilting point.[26][27][28]
A maggot under the cap of my pepper?
Pepper maggot larvae feed inside otherwise sound peppers. Kentucky says the larva is nearly 1/2 inch long, light yellow when mature, and tunnels under the cap; UMass says the white maggots feed especially in the spongy white tissue that holds the seeds, and grow to about 1/2 inch over roughly two weeks.[29][30]
From the outside, look for small dimples where females inserted eggs into young fruit; UMass notes there can be several on one pepper. Adults emerge from mid-July in Massachusetts and from early summer through mid-August in Kentucky.[30][29]
The European corn borer also tunnels in peppers, and UMass says the damage can be confused. The larva is the giveaway: pepper maggots have no distinct head, while corn borer larvae have a brown head.[30]
Holes in my shelled peas, or bean seeds that never came up?
Small round holes in the seed coats of shelled southern peas, such as pinkeye purple hulls, are the work of the cowpea curculio, according to Mississippi State; it says opening the more mature, yellowed seeds with holes reveals small legless grubs. Clemson describes the grub as pale yellow with a brown head, slightly more than 1/4 inch long when grown, and says the weevil is rarely a problem on snap beans.[31][32]
The outside of the hull shows raised, pimple-like egg punctures (Mississippi State). Clemson says each puncture holds a single egg and the grub feeds on one or more peas before chewing its way out.[31][32]
Bean, corn or melon plantings that come up patchy, with hollowed-out seeds, may have seedcorn maggots. UC IPM describes small, legless white maggots usually less than 0.33 inch that kill germinating seeds and tiny seedlings; UMN lists edible beans and melons among the large-seeded crops it attacks, and Iowa State says injury is worst in cool, wet springs.[33][34][35]
Worms in dried fruit, nuts or dried peppers from the pantry?
A small caterpillar in a bag of dried fruit, nuts or dried peppers, with silk threads holding crumbs together, is usually the Indianmeal moth. Clemson lists dried fruit, nuts, seeds, dried peppers and some beans among its foods, and Kentucky says the caterpillars spin silk webbing throughout the food.[36][37]
Clemson describes the larvae as usually dirty white, sometimes pink to brown with a greenish tinge depending on the food, 1/4 to 3/4 inch long, living in a tunnel-like case of frass and silk for six to eight weeks. Our pantry moth guide covers cleanup.[36]
What does the FDA say about larvae in fruit and corn?
The FDA's Food Defect Levels Handbook sets limits for insects in commercial foods, including corn earworm and corn borer larvae in canned sweet corn, Drosophila fly eggs and maggots in canned tomatoes, larvae in canned and frozen blackberries and raspberries, and maggot rejects in brined cherries. Each of those entries is listed with an aesthetic significance.[38]
The FDA says these action levels are set on the premise that they pose no inherent hazard to health, and that they exist because it is economically impractical to grow, harvest or process raw products totally free of non-hazardous, naturally occurring, unavoidable defects. Mold is treated differently: for figs, the handbook flags insect-infested or moldy fruit as a potential health hazard because the mold may contain mycotoxin-producing fungi.[38]
Common questions
- The fruit looked perfect on the outside. How did a maggot get in?
- The fly put it there as an egg. Utah State says western cherry fruit fly females lay eggs beneath the skin without leaving visible marks, UMN says spotted-wing drosophila inserts eggs into soft fruit, and Kentucky says cherries infested by cherry fruit flies often look normal until the maggots are nearly full grown.[18][15][16]
- Why is there only ever one worm in an ear of corn or a tomato?
- Corn earworm larvae eat each other. Kentucky says they are cannibalistic, so there is rarely more than one per ear, and Clemson says the same of tomato fruitworms in tomatoes.[19][22]
- Is the worm in my peach the same one that gets into apples?
- It can be. Kentucky says the Oriental fruit moth, a major peach pest, also attacks apple, plum, cherry and pear, and plum curculio attacks apples as well as peaches and plums according to New Hampshire.[13][9]
Photo credits
- Apple Maggot: (c) Bex Goreham, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Codling Moth: Stephen James McWilliam, public domain (CC0), via iNaturalist
- Plum Curculio: (c) Justin Williams, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Oriental Fruit Moth: Chrissy McClarren and Andy Reago, public domain (CC0), via iNaturalist
- Spotted-Wing Drosophila: (c) Justin Williams, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Cherry Fruit Fly: (c) Jake McCumber, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Western Cherry Fruit Fly: Steve Wells, public domain (CC0), via iNaturalist
- Corn Earworm (Tomato Fruitworm): (c) Rosario Douglas, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Sap Beetles (Picnic Beetles): Adam Juźwiak, public domain (CC0), via iNaturalist
- European corn borer: (c) SteveM4560, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Pickleworm: kcthetc1, public domain (CC0), via iNaturalist
- Melonworm: Hugo Hulsberg, public domain (CC0), via iNaturalist
- Squash Vine Borer: (c) Zeke Blankenship, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Pepper Maggot: (c) skitterbug, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Cowpea Curculio: (c) Rosario Douglas, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Seedcorn Maggot: (c) Zachary Dankowicz, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Indianmeal Moth: (c) Rosario Douglas, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
Sources
- University of Kentucky Entomology, “ENTFACT-017: Recognizing Insect Larval Types.” entomology.mgcafe.uky.edu/ef017 (accessed 2026-11-20)
- University of Missouri Extension, “IPM1019: Caterpillars in Your Yard and Garden.” extension.missouri.edu/publications/ipm1019 (accessed 2026-11-20)
- University of California Statewide IPM Program, “Apple Maggot (Home and Garden).” ipm.ucanr.edu/PMG/GARDEN/FRUIT/PESTS/applemaggot.html (accessed 2026-11-20)
- University of Wisconsin-Madison Extension, Wisconsin Horticulture, “Apple Maggot: Scourge of Home Apple Production.” hort.extension.wisc.edu/articles/apple-maggot-scourge-of-home-apple-production/ (accessed 2026-11-20)
- University of Minnesota Extension, “Apple maggot.” extension.umn.edu/yard-and-garden-insects/apple-maggot (accessed 2026-11-20)
- University of California Statewide IPM Program, “Pest Notes: Codling Moth.” ipm.ucanr.edu/home-and-landscape/codling-moth/ (accessed 2026-11-20)
- University of Minnesota Extension, “Codling moths.” extension.umn.edu/yard-and-garden-insects/codling-moths (accessed 2026-11-20)
- Colorado State University Extension, “Codling Moth Control in Home Plantings (5.613).” extension.colostate.edu/topic-areas/insects/codling-moth-control-in-home-plantings-5-613/ (accessed 2026-11-20)
- University of New Hampshire Extension, “Plum Curculio [fact sheet].” extension.unh.edu/resource/plum-curculio-fact-sheet (accessed 2026-11-20)
- University of Wisconsin-Madison Extension, Wisconsin Horticulture, “Plum Curculio.” hort.extension.wisc.edu/articles/plum-curculio/ (accessed 2026-11-20)
- Penn State Extension, “Tree Fruit Insect Pest - Plum Curculio.” extension.psu.edu/tree-fruit-insect-pest-plum-curculio (accessed 2026-11-20)
- University of California Statewide IPM Program, “Oriental Fruit Moth (Home and Garden).” ipm.ucanr.edu/PMG/GARDEN/FRUIT/PESTS/orientfrmoth.html (accessed 2026-11-20)
- University of Kentucky Entomology, “ENTFACT-212: Oriental Fruit Moth.” entomology.mgcafe.uky.edu/ef212 (accessed 2026-11-20)
- University of California Statewide IPM Program, “Pest Notes: Spotted-Wing Drosophila.” ipm.ucanr.edu/home-and-landscape/spotted-wing-drosophila/ (accessed 2026-11-20)
- University of Minnesota Extension, “Spotted wing drosophila.” extension.umn.edu/garden-and-home/yard-and-garden/yard-and-garden-insects/spotted-wing-drosophila (accessed 2026-11-20)
- University of Kentucky Entomology, “ENTFACT-217: Cherry Fruit Flies.” entomology.mgcafe.uky.edu/ef217 (accessed 2026-11-20)
- Pacific Northwest Pest Management Handbooks (Oregon State, Washington State and University of Idaho Extension), “Cherry-Western cherry fruit fly.” pnwhandbooks.org/insect/tree-fruit/cherry/cherry-western-cherry-fruit-fly (accessed 2026-11-20)
- Utah State University Extension, Utah Plant Pest Diagnostic Lab, “Western Cherry Fruit Fly.” extension.usu.edu/planthealth/ipm/notes_ag/fruit-west-cherry-ff.php (accessed 2026-11-20)
- University of Kentucky Entomology, “ENTFACT-318: Corn Earworm Management in Sweet Corn.” entomology.mgcafe.uky.edu/ef318 (accessed 2026-11-20)
- University of California Statewide IPM Program, “Corn Earworm (Corn Pest Management Guidelines).” ipm.ucanr.edu/agriculture/corn/corn-earworm/ (accessed 2026-11-20)
- University of California Statewide IPM Program, “Tomato Fruitworm (Tomato Pest Management Guidelines).” ipm.ucanr.edu/agriculture/tomato/tomato-fruitworm/ (accessed 2026-11-20)
- Clemson Cooperative Extension, Home & Garden Information Center, “Tomato Insect Pests.” hgic.clemson.edu/factsheet/tomato-insect-pests/ (accessed 2026-11-20)
- University of Minnesota Extension, “Sap beetles.” extension.umn.edu/yard-and-garden-insects/sap-beetles (accessed 2026-11-20)
- Clemson Cooperative Extension, Home & Garden Information Center, “What Is It Wednesday? Pickleworm.” hgic.clemson.edu/what-is-it-wednesday-pickleworm/ (accessed 2026-11-20)
- eOrganic (University of Georgia authors), “Biology and Management of Pickleworm and Melonworm in Organic Cucurbit Production Systems.” eorganic.org/node/5320 (accessed 2026-11-20)
- Iowa State University Extension and Outreach, Yard and Garden, “Squash Vine Borer.” yardandgarden.extension.iastate.edu/encyclopedia/squash-vine-borer (accessed 2026-11-20)
- University of Kentucky Entomology, “ENTFACT-314: Squash Vine Borer.” entomology.ca.uky.edu/ef314 (accessed 2026-11-20)
- University of Minnesota Extension, “Squash vine borers.” extension.umn.edu/garden-and-home/yard-and-garden/yard-and-garden-insects/squash-vine-borers (accessed 2026-11-20)
- University of Kentucky Entomology, “ENTFACT-316: Pepper Maggot in Kentucky.” entomology.mgcafe.uky.edu/ef316 (accessed 2026-11-20)
- UMass Amherst Extension Vegetable Program, “Pepper Maggot.” www.umass.edu/agriculture-food-environment/vegetable/fact-sheets/pepper-maggot (accessed 2026-11-20)
- Mississippi State University Extension Service, “Cowpea Curculio (Bug's Eye View, Vol. 4, No. 12).” extension.msstate.edu/newsletters/bugs-eye-view/2018/cowpea-curculio-vol-4-no-12 (accessed 2026-11-20)
- Clemson Cooperative Extension, Home & Garden Information Center, “Bean & Southern Pea Insect Pests.” hgic.clemson.edu/factsheet/bean-southern-pea-insect-pests/ (accessed 2026-11-20)
- University of California Statewide IPM Program, “Seedcorn Maggot (Home and Garden).” ipm.ucanr.edu/PMG/GARDEN/VEGES/PESTS/seedcornmaggot.html (accessed 2026-11-20)
- University of Minnesota Extension, “Seedcorn maggot.” extension.umn.edu/corn-pest-management/seedcorn-maggot (accessed 2026-11-20)
- Iowa State University Extension and Outreach, Integrated Crop Management, “Seedcorn Maggot.” crops.extension.iastate.edu/encyclopedia/seedcorn-maggot (accessed 2026-11-20)
- Clemson Cooperative Extension, Home & Garden Information Center, “Indian Meal Moth.” hgic.clemson.edu/factsheet/indian-meal-moth/ (accessed 2026-11-20)
- University of Kentucky Entomology, “ENTFACT-612: Stored Product Pests in the Pantry.” entomology.mgcafe.uky.edu/ef612 (accessed 2026-11-20)
- U.S. Food and Drug Administration, “Food Defect Levels Handbook.” www.fda.gov/food/current-good-manufacturing-practices-cgmps-food-and-dietary-supplements/food-defect-levels-handbook (accessed 2026-11-20)