The dim interior of a grower's field shed at dusk.

How to Get Rid of Fungus Gnats

Last updated:

Fungus gnats are a soil problem, not an air problem. The flies are a nuisance, but the larvae in the top 2 to 3 inches (5 to 7 cm) of wet potting mix feed on fine roots and seedlings.1,2 To get rid of fungus gnats, let the top layer of soil dry, treat the soil for larvae and trap the adults for three to four weeks.1,6

Is it really fungus gnats?

Three small flies are commonly confused indoors. Getting this right saves weeks of the wrong treatment.1,5

Fungus gnats and the two flies most often mistaken for them. Sources:1,5
FlyWhat it looks likeWhere you see it
Fungus gnat (Bradysia, Sciara)Thin, dark gray, long legs and antennae, weak zigzag flight, like a tiny mosquitoWalking on the soil surface, flying up when you water
Fruit fly (Drosophila)Tan body, red eyes, stockyKitchen, fruit bowl, trash, drains
Shore fly (Scatella)Dark, stout, short antennae, light spots on the wings, strong flierGreenhouses, algae on wet benches and pots

The potato test: push a few 1 inch (2.5 cm) slices of raw potato onto the soil surface. After two days, lift them. Fungus gnat larvae are clear to white with a shiny black head capsule, about 1/4 inch (6 mm) long, and they gather on the underside of the slice.2,4

Why you have them

  • Constantly wet soil. It is the single biggest cause: females lay eggs in moist organic matter.1
  • Peat-rich or compost-rich mixes that hold water near the surface.1
  • Pots without drainage, or saucers left full of water.5
  • Bagged potting mix stored open or damp, which can arrive with eggs already in it.5
  • Low light and cool rooms in winter, where soil stays wet for days after watering.2

The life cycle, and why one treatment is never enough

At about 75°F (24°C), fungus gnat eggs hatch in about three days, larvae feed for about ten days, and adults emerge about four days after that, so one generation takes roughly 17 days; warmer rooms speed it up.1 Adults live 7 to 10 days, and a female may lay up to 200 eggs.2

Generations overlap, so anything that only removes flying adults leaves the next generation in the soil. That is why a plan has to cover soil and air together for at least one full cycle, and extension advice is to expect numbers to fall over four to five weeks.6

Step-by-step plan

  1. Dry the top layer. Let the top 1 to 2 inches (2.5 to 5 cm) of mix dry between waterings.2 Water from below (set the pot in a tray for 15 to 20 minutes, then drain) so the surface stays dry, and empty saucers.5
  2. Trap and monitor adults. Place yellow sticky cards just above the soil, one per pot or one per square yard (meter) of bench.4 Count catches weekly; falling numbers tell you the plan is working.
  3. Treat the soil for larvae with one of the options in the next section, and repeat it as its label directs.1
  4. Repot heavy cases. If larvae are under every potato slice, repot into fresh, well-draining mix and discard the old soil sealed in a bag, because adults can still emerge from discarded mix.3
  5. Keep going for four weeks, even after the flies seem gone, to catch the last larvae.6

Which soil treatments reach the larvae?

  • Bacillus thuringiensis israelensis (Bti) applied as a soil drench. It acts on fly larvae only, works best on young larvae and has to be repeated at short intervals for three to four weeks.1,4,8 Use a Bti product whose label lists fungus gnats, and check the label before using any Bti product on plants. See Do mosquito dunks work on fungus gnats? and Mosquito dunks vs bits.
  • Beneficial nematodes (Steinernema feltiae) watered into moist soil. They work between 60 and 90°F (16 to 32°C) in moist media and can give lasting control after several applications.1
  • Soil-dwelling predatory mites (Stratiolaelaps scimitus, sold as Hypoaspis), widely used in greenhouses.3,4

What works less well than people hope

  • Vinegar and wine traps catch fruit flies far better than fungus gnats.
  • Cinnamon on the soil has little evidence behind it.
  • Hydrogen peroxide drenches reach only the larvae they contact and break down within minutes.6 See Hydrogen peroxide for root rot and fungus gnats.
  • A top-dressing of sand or grit is a common tip, but in studies sand and diatomaceous earth layers did not stop egg laying or adult emergence.3,4
  • Sprays aimed at adults do nothing for the larvae doing the root damage.7

Greenhouse and commercial growers

In propagation, fungus gnat larvae damage cuttings and seedling roots, and research links heavy infestations with the spread of root pathogens such as Pythium.3 Commercial programs rely on monitoring with sticky cards (counts per card per week), sanitation of benches and floors, media moisture management, and biological controls applied at sticking or sowing.4 Shore flies often appear alongside them; algae control on benches reduces both.1

Our fungus gnat pest profile and integrated pest management basics cover the monitoring side in more detail.

Prevention

  • Store potting mix sealed and dry.5
  • Use pots with drainage holes and a mix with perlite or bark for air space.1,5
  • Water less often in winter; check soil moisture with a finger before watering.2
  • Quarantine new plants for two weeks with a sticky card next to them.

Key takeaways

  • Fungus gnat damage comes from the larvae in wet potting mix, not from the flying adults.
  • Letting the top 1 to 2 inches of mix dry between waterings is the step that makes every other treatment work.
  • A generation takes about 17 days at 75°F and generations overlap, so plan on three to four weeks or longer.
  • Treat the soil for larvae with Bti, beneficial nematodes or predatory mites, and follow the product label.
  • Yellow sticky cards and potato slices show whether the plan is working.

References

  1. Pest Notes: Fungus Gnats (UC ANR Publication 7448)University of California Statewide Integrated Pest Management Program, UC Agriculture and Natural Resources · 2013 · University extension publication
  2. Fungus Gnats as Houseplant and Indoor Pests (Fact Sheet 5.584)Colorado State University Extension · 2003, reviewed 2025 · University extension publication
  3. Ecology of Fungus Gnats (Bradysia spp.) in Greenhouse Production Systems Associated with Disease-Interactions and Alternative Management StrategiesInsects (MDPI), 6(2):325 to 332 · 2015 · Review article · DOI 10.3390/insects6020325
  4. Managing Fungus Gnats in the GreenhouseUConn Extension, Integrated Pest Management Program · 1999, revised 2023 · University extension publication
  5. Fungus Gnats: Tiny Pests in Houseplants and How to Control ThemN.C. Cooperative Extension, Beaufort County Center (NC State Extension) · 2025 · University extension publication
  6. A Spooky Houseplant Pest: Fungus GnatsCornell Cooperative Extension Allegany County · 2024 · University extension publication
  7. Fungus Gnats: Tiny Flies Around Your HouseplantsUniversity of Wisconsin-Madison Insect Diagnostic Lab, Department of Entomology · 2020 · University extension publication
  8. Bti for Mosquito ControlU.S. Environmental Protection Agency · 2026 · Government guidance

Frequently asked questions

Do fungus gnats bite people or pets?

No. Adult fungus gnats do not bite and do not feed on people or animals.2

How long does it take to get rid of fungus gnats?

Plan on three to four weeks, about one and a half life cycles. Adult numbers usually drop within the first week of drying the soil and trapping; the soil treatment handles the generation still developing, and the last adults can take four to five weeks to disappear.1,6

Why do fungus gnats come back?

Almost always because the soil stays wet, or because a new bag of potting mix or a new plant brought eggs in. Fix watering first.1,5

Do fungus gnats harm plants?

Mature, healthy houseplants usually tolerate them. Seedlings, cuttings and young plants can be set back seriously because larvae feed on fine roots and root hairs.1,3