
How to identify it
- Adults are robust black flies about 5/8 inch long, with smoky black wings held flat over the back at rest.[2][3]
- The first abdominal segment has clear, see-through patches, which is a quick way to recognize the adult.[2][3]
- Mature larvae are about 1 inch long, legless, flattened and dark brown, with a tough, leathery skin and a small head narrower than the body.[1][2]
- Young larvae are grayish white and very active before darkening as they mature.[2]
Look-alikes
| Look-alike | How to tell them apart |
|---|---|
| Wasps | Adult soldier flies are often mistaken for black wasps, but they have no stinger and don't bite.[2][3] |
| House fly maggots | Soldier fly larvae are much tougher, flatter and darker, with a leathery skin; Texas A&M notes they can even survive for weeks in a jar without food or water.[1] |
Where it lives
Widespread across North America, and especially common wherever the flies can reach wet, rotting food or garbage.[2]
Biology and life cycle
Larvae feed on decaying organic matter, including manure, food scraps and very moist, rotting vegetable material, and they are common in compost piles.[1][2]
Adults live only about two days, mating and laying eggs on moist organic matter.[2]
Fully grown larvae stop feeding and wander, sometimes several yards, looking for a drier place to pupate.[1][3]
Adults are sluggish until disturbed, may come to lights, and don't seem attracted to food.[1]
Damage and signs
Health risk
Both larvae and adults are harmless to people, and adults don't bite or carry disease. Texas A&M notes rare reports of larvae swallowed with contaminated food causing an intestinal infestation.[1][2][3]
Control
Prevention
In compost, bury kitchen scraps well and cover them with 2 to 4 inches of dry, carbon-rich material such as leaves, dry grass or shredded paper.[2]
Keep them out
Cover holes in compost bins with window screen sealed in place with waterproof caulk to keep egg-laying adults out.[2]
Sanitation
Find and remove the breeding source, whether that's wet garbage, decaying vegetable matter, a dead animal, or a leaky plumbing spot that keeps organic debris moist.[1][3]
Traps and physical control
If larvae get abundant, turn the pile and mix in dry material so it heats up; the larvae can't survive above 113°F.[2]
Indoors, pick up wandering larvae by hand or with a tissue and swat adults.[1]
Pesticides
If adults become numerous indoors, an aerosol insect spray containing pyrethrins will kill most of them.[1]
Common questions
- Are the big maggots in my compost bin harmful?
- Usually they are soldier fly larvae, which won't harm you or the compost. They break down food scraps, and Oregon State notes they don't harm worms or their eggs in worm bins.[2]
- Why are soldier fly larvae crawling across my floor?
- Full-grown larvae leave their food source to find a drier spot to pupate. Look for a nearby source such as a dead animal, wet organic debris from faulty plumbing, or an old bee nest in a wall.[1][3]
- Do black soldier flies sting?
- No. They resemble wasps but have no stinger and are harmless.[3][2]
Sources
- Texas A&M AgriLife Extension Service, Insects in the City, “Soldier Flies (ENT-2005).” citybugs.tamu.edu/factsheets/household/flies-house/ent-2005/ (accessed 2026-10-06)
- Oregon State University Extension Service, “Soldier fly larvae: Beneficial compost helpers (July 2025).” extension.oregonstate.edu/news/soldier-fly-larvae-beneficial-compost-helpers (accessed 2026-10-06)
- Texas A&M AgriLife Extension Service, Department of Entomology, “Soldier fly, Hermetia illucens (Field Guide to Common Texas Insects).” texasinsects.tamu.edu/soldier-fly/ (accessed 2026-10-06)
- iNaturalist, “Hermetia illucens taxon page (order and family).” www.inaturalist.org/taxa/82177 (accessed 2026-10-06)