Home › Fungus gnats
Problem diagnosisHow to get rid of fungus gnats
Method verified against university horticulture extension and RHS guidance on 9 August 2026. Sources linked below.
Fungus gnats feel impossible to beat because most people fight the wrong half of the problem. They swat the flies. The flies come back. The reason is in the soil.
You get rid of fungus gnats by hitting two life stages at once and fixing the cause. The adults you see are the annoying half; the larvae living in the top of the wet soil are the half that keeps the infestation going. Kill only the adults and more hatch within days. Kill the larvae, trap the adults, and dry out the soil, and the cycle breaks.
| Target | What it is | How to hit it |
|---|---|---|
| Adults | The small dark flies around the soil | Yellow sticky traps laid flat on the soil surface |
| Larvae and eggs | In the top few centimetres of wet soil | Let the top of the soil dry out; treat with BTI (a biological larvicide, sold as mosquito bits) |
| The cause | Soil that stays wet | Water less, water from the bottom, and make sure the pot drains |
What are fungus gnats, and are they harmful?
Fungus gnats are small, dark, weak-flying insects that live around the soil of houseplants, and the adults are mostly a harmless nuisance. The damage comes from the larvae. They live in the top layer of moist soil, feed on fungi, organic matter and fine roots, and they can set back seedlings, cuttings and already weak plants.
A strong, established plant usually shrugs off a few gnats. A heavy infestation stresses any plant, and more to the point, it is a sign the soil is staying too wet, which is a problem in its own right. That is why the flies are worth acting on even though the adults themselves do little harm.
How do you know it is fungus gnats and not fruit flies?
You know it is fungus gnats, not fruit flies, by where the insects gather, because the two are easy to confuse and need different fixes. Fungus gnats hover around the soil of plants; fruit flies gather around ripe fruit and the kitchen.
| Clue | Fungus gnats | Fruit flies |
|---|---|---|
| Where they gather | Around plant soil | Around ripe fruit, bins, drains |
| Look | Thin, dark, long legs, weak flyers | Rounder, tan or brown |
| The fix | Treat the soil | Remove the fruit source |
If the flies scatter from the soil when you water, they are fungus gnats, and the rest of this guide is for you.
How do you get rid of fungus gnats?
You get rid of fungus gnats by treating the soil and the adults together over two to three weeks, long enough to outlast the eggs already laid. Do all of these at once, because any one alone leaves a stage of the life cycle running:
- Let the top of the soil dry out. Larvae need moisture in the top few centimetres, so letting it dry between waterings kills them and stops new eggs surviving. This step does the most work.
- Put out yellow sticky traps flat on the soil to catch the adults, which also shows you whether numbers are falling.
- Treat the larvae with BTI (Bacillus thuringiensis israelensis, sold as mosquito bits), a biological larvicide that targets gnat larvae and is harmless to plants and pets. Follow the label to water it in or steep it.
- Water less, and from the bottom. Bottom-watering keeps the top layer dry where the larvae live, while the roots still drink.
Keep all of this going for a few weeks. Stopping the day the flies thin out is how people end up back where they started, because a later batch of eggs is still waiting in the soil.
How long do fungus gnats take to go away?
Fungus gnats take about three to four weeks to clear, because that is roughly one full life cycle from egg to adult. Eggs hatch within a few days, the larvae feed in the soil, and the adults live only about a week, so treatment has to run long enough to catch every batch already in the pot. Sources give slightly different totals (about 2.5 to 4 weeks), so plan for the longer end.
| Stage | Where it lives | What stops it |
|---|---|---|
| Egg | Moist soil surface | Dry topsoil |
| Larva | Top few centimetres of wet soil | Dry topsoil, BTI, nematodes |
| Pupa | In the soil | Dry topsoil |
| Adult | Flying around the plant, about a week | Yellow sticky traps |
Do hydrogen peroxide, sand and nematodes work on fungus gnats?
Hydrogen peroxide, a sand layer and nematodes each work on one part of the problem, so they support the core steps rather than replace them. Each is described below with its limit.
| Option | How it is used | What it does and does not do |
|---|---|---|
| Hydrogen peroxide drench | 1 part 3% peroxide to 4 parts water, poured on the soil in place of a watering; sources advise repeating weekly or at each watering for two to four weeks | Targets larvae in the soil. Keep it off the leaves, where it can cause burn. |
| Coarse sand or fine gravel layer | A 1.2 to 2.5 cm (half to one inch) layer on top of the soil; use coarse or horticultural sand, not fine play sand, which compacts | Prevention only. It does not kill larvae already in the soil. |
| Nematodes (Steinernema feltiae) | Microscopic worms watered into the soil, bought from garden suppliers | Prey on gnat larvae and suit stubborn infestations. Follow the supplier's dose; sources here give no figures. |
These options come mainly from gardening guides rather than extension services, so treat the exact ratios as a starting point and keep the soil-drying step as the main fix.
Why do fungus gnats keep coming back?
Fungus gnats keep coming back for two reasons, and both are about the soil rather than the flies. The first is that killing the adults leaves the eggs and larvae untouched, so a new generation hatches within days. The second is soil that stays wet, which is the exact condition the larvae need to survive.
Fix both and they do not return: treat the soil, not just the air, and change the watering that made the soil hospitable. A gnat problem that never ends is almost always an overwatering problem wearing a disguise; see the overwatering vs underwatering guide to confirm it.
How do you prevent fungus gnats?
You prevent fungus gnats by keeping the top of the soil dry and the pot draining, because gnats cannot establish in soil that dries out between waterings. The habits that prevent them are the same habits that prevent root rot:
- Water only when the top of the soil is dry, and let it dry between drinks.
- Use pots with drainage and empty the saucer, so the soil never stays soggy.
- Bottom-water where you can, keeping the surface dry.
- Check new plants and fresh bags of soil before they join the others, since gnats often arrive that way.
Because the cause is the same wet soil behind so many houseplant problems, the watering guide below is the real long-term fix. If the flies are not the only pest around, check whether it is spider mites or mealybugs instead, both of which look nothing like a fungus gnat and need a different treatment.
FAQ
- Why do fungus gnats keep coming back?
- Because killing the adults does nothing about the eggs and larvae in the soil, which keep hatching, and because the soil stays wet. Dry the top of the soil, treat the larvae, and trap the adults at the same time to break the cycle.
- Are fungus gnats harmful to plants?
- The adults are mostly a harmless nuisance, but the larvae feed on roots and can damage seedlings, cuttings and weak plants. A heavy infestation stresses any plant and signals soil that stays too wet.
- Are fungus gnats the same as fruit flies?
- No. Fungus gnats are thin, dark and hover around soil; fruit flies are rounder, tan, and gather around fruit and the kitchen. Soil means gnats, fruit means fruit flies, and the fix differs.
- How long do fungus gnats last?
- A fungus gnat infestation lasts about three to four weeks if you treat it, because that is one full life cycle. Adults live about a week, so keep treating until the sticky traps stay empty.
- Does hydrogen peroxide kill fungus gnats?
- A drench of 1 part 3% hydrogen peroxide to 4 parts water targets the larvae in the soil. Gardening guides advise repeating it for two to four weeks and keeping it off the foliage.
- Does sand on top of the soil stop fungus gnats?
- A half to one inch layer of coarse sand or fine gravel helps prevent gnats laying eggs in the soil, but it does not kill larvae already there.
Related guides
Sources
- University of Wisconsin Horticulture Extension, Houseplant Care.
- University of Missouri Extension, Caring for Houseplants.
- Royal Horticultural Society, Fungus gnats (sciarid flies).
- Epic Gardening, how to get rid of fungus gnats (peroxide ratio, life cycle; read via search summary 21 October 2026).
- Leafy Place, fungus gnats (sand layer, nematodes; read via search summary 21 October 2026).