How to Get Rid of Fungus Gnats

Why those tiny flies keep appearing around your plants, and the most effective ways to eliminate them for good

Home / Guides

At a glance

  • What they are: Small black flies whose larvae live in moist soil and eat roots
  • Why they appear: Overwatered soil with decaying organic matter
  • Most effective fix: Let the top 2 inches of soil dry out completely between waterings
  • Kill larvae: Hydrogen peroxide drench (1 part 3% H2O2 to 4 parts water) or BTi (Bacillus thuringiensis israelensis)
  • Catch adults: Yellow sticky traps placed at soil level
  • Timeline: 2 to 4 weeks to fully break the life cycle

What are fungus gnats?

Fungus gnats (family Sciaridae) are small flies, roughly 2mm long, with dark bodies and long legs. They are attracted to moist potting soil rich in organic matter, where females lay eggs in the top layer of soil. The larvae that hatch are pale, almost transparent, with a shiny black head. They live in the top 2 to 3 inches of soil, feeding on decaying plant material and, when populations are high, on plant roots.

Adults live only 3 to 7 days. In that time, a single female can lay up to 200 eggs. The life cycle from egg to adult takes about 3 to 4 weeks, which is why infestations can build quickly and why treatment needs to continue for several weeks to fully eliminate them.

How to confirm it is fungus gnats

The clearest signs are small black flies hovering close to the soil surface and scattering when you disturb the plant or its pot. Unlike fruit flies, which are attracted to fruit and food, fungus gnats stay near plants and soil. If you place a yellow sticky trap near the soil surface, fungus gnats will be caught on it within 24 to 48 hours if they are present.

To check for larvae, take a small slice of raw potato and press it cut-side down on the soil surface. Leave it for 24 to 48 hours, then lift it: if fungus gnats are present, you will see small pale larvae clinging to the underside. This confirms active larvae in the soil, not just adult flies that may have drifted in from elsewhere.

Why they are harmful

Adult fungus gnats are primarily a nuisance; they do not bite and cause no direct harm to healthy, large plants. The larvae are the problem. They eat decaying organic matter, which is harmless, but at high population densities they also chew on roots, root hairs, and lower stem tissue. For seedlings, cuttings, and small plants with limited root systems, this feeding can be fatal. For large established plants, root damage slows growth and weakens the plant, making it more susceptible to other stress.

Treatment: let the soil dry out

The single most effective thing you can do is reduce how frequently you water. Fungus gnat larvae require moist soil to survive; they cannot complete their life cycle in dry conditions. Allowing the top 2 inches of soil to dry out completely between waterings disrupts the breeding cycle and kills many larvae directly. Most houseplants, except moisture-loving ferns and calatheas, tolerate this adjustment without any negative effects.

If your plant is in a pot without drainage holes, or in a saucer that keeps the bottom perpetually wet, address that first. Chronic moisture at the bottom of the pot provides an inexhaustible breeding ground that no surface treatment will eliminate.

Treatment: hydrogen peroxide drench

A solution of hydrogen peroxide and water kills fungus gnat larvae on contact without harming the plant or its roots. Mix 1 part 3% hydrogen peroxide (standard pharmacy concentration) with 4 parts water. Water the plant with this solution as you normally would, letting it drain through the pot. The fizzing reaction kills larvae in the soil. The hydrogen peroxide breaks down rapidly into water and oxygen, leaving no residue.

Repeat every 5 to 7 days for 3 to 4 weeks to catch larvae hatching from eggs laid before treatment began. Do not use higher concentrations of hydrogen peroxide; the 1:4 ratio with 3% solution is effective and safe.

Treatment: BTi biological control

Bacillus thuringiensis var. israelensis (BTi) is a naturally occurring soil bacterium that is highly effective against fungus gnat larvae and harmless to plants, pets, and humans. It is the active ingredient in products sold as Gnatrol, Mosquito Bits, and similar. The bacteria produce proteins that are toxic specifically to larvae in the Diptera family (which includes fungus gnats and mosquitoes).

To use: soak Mosquito Bits in water for 30 minutes, then use the water to drench the soil. Or apply Gnatrol according to label directions. BTi remains effective in the soil for several days. Repeat every 1 to 2 weeks for a month. This is considered one of the most reliable treatments because it targets larvae specifically without disrupting beneficial soil biology.

Treatment: yellow sticky traps for adults

Yellow sticky traps placed at or just above the soil surface catch adult gnats and reduce egg-laying significantly. They do not eliminate an infestation on their own (they do not reach larvae in the soil) but they reduce the adult population and help monitor whether the treatment is working. As the infestation clears, the number of flies caught on the traps will drop visibly each week.

Place traps flat on the soil surface or hang them just above it. Replace them when the sticky surface is full. Traps are inexpensive and work best combined with soil treatment.

Prevention

Fungus gnats appear wherever moist soil and organic matter are present. Preventing them comes down to watering practices: