A yellow sticky card on a skewer in a houseplant pot, with a few tiny dark gnats caught on it

Fungus Gnats or Fruit Flies? How to Tell and Get Rid of Them

Small black flies that rest on the soil of a potted plant, then take off in short, wobbly bursts, are most likely fungus gnats. They also gather at the nearest window.

The adults are a nuisance, not a danger. Colorado State University Extension, the university’s extension service, says they do not bite or feed.

Larvae live in the potting mix, and the fix is to stop the mix staying wet.

How to tell fungus gnats from fruit flies

A thin slice of raw potato lying on the potting mix of a houseplant pot

Fungus gnats are easy to mistake for fruit flies. The University of Wisconsin-Madison’s Division of Extension says they are two distinct insects.

North Carolina Cooperative Extension, the joint extension service of NC State University and N.C. A&T State University, says adults resemble fruit flies. It adds that they often swarm up out of a plant when you water it.

A vinegar trap will not show them.

Wisconsin says the methods used to monitor fruit flies, vinegar traps included, do not work for fungus gnats.

Look at the flies themselves. Colorado State describes the adults as delicate, black and about 1/8 inch long, with long legs and antennae.

Then watch how they move:

  • They are weak fliers, flying in short, erratic patterns.
  • They are usually seen near an infested houseplant.
  • They often collect around window frames.

Flies that stay near the pots and fly in short, erratic bursts point to fungus gnats. Up close, Colorado State says the forewings carry a distinct y-shaped pattern.

To confirm, check for larvae. Colorado State says to push 1/4 inch slices or wedges of potato into the mix. The larvae move to the potato and start feeding within a few days.

Turn the slices over after that. The larvae are wormlike and translucent with a black head.

Wisconsin says to check the slices for maggots after three to four days.

If you have several plants, find the source before treating them all. The University of Maryland’s extension service says to cover the plant or drain with screen or cheesecloth.

Then check for flies over the next several days. Drains with moist debris can breed them too.

Why wet potting mix breeds them

Females lay eggs in cracks in the growing mix. Colorado State says one female can lay up to 200 eggs during her seven to 10 day life.

The larvae feed in the top 2 to 3 inches, mostly on fungi, algae and decaying plant matter. They are fully grown in two to three weeks, and adults emerge about a week later.

Moist mix with a lot of peat moss is what egg-laying females are especially drawn to. Mix that has aged and broken down holds even more water.

Winter makes it worse. Colorado State says shorter days and cooler temperatures slow plant growth, so plants use less water.

Water on the summer schedule and the mix stays wet.

Pots that spent the summer outdoors and came inside for winter may already carry gnats. Colorado State says plants kept outdoors in summer are commonly colonized.

Adults live about one week.

Colorado State puts one full cycle from egg to adult at three to four weeks at room temperatures of 65 to 75 degrees Fahrenheit.

Let the top of the mix dry

A finger pressed into the top of the potting mix in a houseplant pot to feel if it is dry

This is the step that matters most. Colorado State says to let the mix dry between waterings, especially the top 1 to 2 inches.

Dry mix lowers the survival of eggs and young larvae, and it is less attractive to egg-laying females.

The University of California’s statewide pest management program (UC IPM) puts it simply: allow the surface of container soil to dry between waterings.

Press a finger a couple of inches down into the soil, and water only when it feels dry.

Repot when the mix has broken down. Colorado State also says to remove containers holding decayed bulbs and roots, which feed the larvae.

The table below shows what each stage responds to.

Stage What works What falls short
Adults Yellow sticky traps Sprays: soaps, oils, neem
Larvae Dry top inch or two, Bti drench Insecticides aimed at the adults
The mix Dry between waterings, repot Keeping it always moist

Yellow sticky traps for the adults

Adults are attracted to yellow, and traps catch them. UC IPM says to cut a trap into smaller squares and attach them to wooden skewers or sticks placed in pots.

Colorado State says traps under the plant canopy or on the edge of the container may catch egg-laying females and so reduce the next generation.

The University of Maryland suggests using them to monitor how many flies there are.

Traps thin out the adults, but they leave the larvae alone. UC IPM says the most effective control methods target the immature stages rather than the short-lived adults.

So use traps as a gauge and a helper while you dry the mix.

Bti, the treatment that reaches the larvae

Bti is short for Bacillus thuringiensis subspecies israelensis, a bacterium found naturally in soil. According to UC IPM, it is toxic only to fly larvae such as mosquitoes, black flies and fungus gnats.

You mix it with water and pour it over the mix as a drench, following the label. The University of Maryland says soil drench products labeled for indoor plants are available through garden centers or online.

UC IPM lists mosquito bits and Gnatrol as Bti products sold at nurseries and garden centers.

Bti does not last indoors, so expect to repeat it. UC IPM says infestations in potting mix might need repeat applications at about five-day intervals.

Check the label before you buy. Bt sold for caterpillars will not work. UC IPM says it is a different subspecies, and bt labeled for caterpillars is not effective against fly larvae.

What not to bother with

Colorado State says the larvae in the mix will not be directly affected by any insecticide applied to kill adults.

It also says soaps, oils, neem and pyrethrins do not give long-term control of adults and need repeating every couple of days.

UC IPM goes further:

  • Insecticides generally are not recommended for fungus gnats in and around the home.
  • Do not fog indoors or try to spray gnats in flight.
  • Heavy numbers of larvae can damage roots, especially in seedlings and young plants.

Other pests need different treatment. Scale, mealybugs, aphids and spider mites call for other houseplant pest treatments.

Put a fresh yellow trap square in the pot now. Put in another fresh one at three to four weeks, about one life cycle at room temperature. Compare how many flies each catches over a few days.

Wisconsin says it may take three to four weeks to bring fungus gnats under control. That is with changed watering plus a half-inch to one-inch layer of coarse sand or fine gravel on the soil.

Scroll to Top
Pits In Pieces

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.