Fungus gnats are tiny, dark, delicate flies that hover around the top of a worm bin and crawl over the bedding. They’re often confused with fruit flies, but they’re a different insect with a different cause. Fungus gnats breed in moist, fungus-rich bedding, which means a worm bin is an ideal nursery if it gets too wet.
They don’t harm worms, but they’re annoying, especially indoors. This guide shows how to identify fungus gnats, why they appear, and how to clear them in about two weeks.
Quick answer
- Identify: small, dark grey to black, long legs, weak fliers that stay low. Fruit flies are tan with red eyes.
- Cause: wet bedding and a moist surface layer.
- Fix: dry the top layer, add dry cardboard, use yellow sticky traps, cover the surface.
- Time: about 2–3 weeks to break the life cycle.
Fungus gnats vs fruit flies
- Fungus gnats: slim, dark grey or black, long legs and antennae, look like tiny mosquitoes. Fly weakly and stay near the bedding surface. Larvae are translucent with black heads, living in the top few centimetres of moist bedding.
- Fruit flies: tan or light brown, rounder, red eyes. Fly up and hover around food. Breed in fermenting fruit.
If you have fruit flies, see our fruit fly guide. Many bins have both.

Why fungus gnats love worm bins
Fungus gnat larvae feed on fungi, algae and decaying organic matter in damp soil and bedding. A worm bin with:
- Wet, compacted bedding
- A moist surface layer
- Lots of fungal growth on food
- Standing liquid in a drip tray
is perfect for them. Adults lay eggs in the moist surface. Eggs hatch in a few days, larvae feed for about two weeks, then pupate and emerge as adults. The full cycle takes about three to four weeks.

Related guideHow to Get Rid of Fruit Flies in a Worm BinHow to get rid of fungus gnats
1. Dry out the surface
The most effective step. Mix several handfuls of dry, shredded cardboard into the top 5 cm (2 in) of bedding. Leave the lid ajar for a few hours each day under a light so the surface dries. Larvae die in dry conditions.
2. Cover the bedding
Lay a sheet of dry newspaper or cardboard flat across the whole surface. It stops adults from reaching moist bedding to lay eggs. Replace it when it gets damp.
3. Use yellow sticky traps
Fungus gnats are attracted to yellow. Hang or stand yellow sticky cards just above the bedding to catch adults. This reduces egg-laying and shows whether numbers are falling.
4. Empty drip trays
Standing liquid in a reservoir is a gnat nursery. Drain it and dry it out. See worm bin leachate.
5. Bury food deeper
Bury food at least 5 cm under bedding, and cover it with a handful of dry cardboard.
6. Check nearby houseplants
Fungus gnats are very common in houseplant soil. If your plants are infested, gnats will keep moving to the bin. Let houseplant soil dry between waterings and use sticky traps there too.
A two-week plan
- Day 1: add dry cardboard to the top layer, drain any tray, lay a dry sheet on top, set out sticky traps.
- Days 2–7: leave the lid ajar for a few hours daily under a light. Replace the top sheet if damp. Feed very lightly, buried deep.
- Day 7: do a squeeze test. If bedding drips, add more dry carbon. See worm bin moisture.
- Days 8–14: keep the surface dry and covered. Watch the traps. New adults should drop off.
- Day 14+: resume normal feeding with carbon. Keep a dry top sheet as a habit.
What not to do
- Don’t use insecticides or sprays. They can kill worms.
- Don’t add vinegar traps directly in the bin. Use them nearby for fruit flies only.
- Don’t flood the bin to “drown” larvae. That makes things worse.
- Don’t dig the whole bin up. Focus on the top layer, where larvae live.
Fungus gnats in stacking trays and outdoor bins
Stacking tray systems have a reservoir at the bottom and several layers of moist bedding, so fungus gnats can breed in more than one tray. Treat the top tray as described above and check the reservoir often. Outdoor bins rarely have serious gnat problems, because predators and weather keep numbers down. Indoor bins are where gnats really take hold.
Biological controls
Some worm keepers use Bacillus thuringiensis israelensis (BTI), a bacterium that targets fly larvae, or beneficial nematodes sold for fungus gnats. These are generally considered safe for worms, but they’re rarely necessary if you dry the surface. Follow product directions carefully.
Preventing fungus gnats
- Add dry carbon with every feeding.
- Keep a dry sheet of cardboard on top of the bedding.
- Avoid adding water unless the squeeze test shows it’s needed.
- Keep drip trays empty.
- Don’t overfeed. See overfeeding worms.
Further reading: Oregon State University Extension’s Composting with Worms (EM 9034) covers flies and other bin visitors, and NC State Extension’s Worms Can Recycle Your Garbage explains moisture control to prevent fungus gnats.
Frequently asked questions
Do fungus gnats hurt worms?
No. They compete for some food but don’t harm worms.
Why do fungus gnats keep coming back?
The bedding surface is still moist, or houseplants nearby are a source.
Will sticky traps alone fix the problem?
They catch adults but don’t kill larvae. Drying the surface is the real fix.
Can fungus gnats live in castings?
They can breed in moist stored castings. Let castings dry slightly before storage and keep them in breathable containers.


