fungus gnatsplant pestshouseplant carepest treatmentplant careindoor plants

How to Get Rid of Fungus Gnats in Houseplants

Elena Torres •
Yellow sticky trap covered in fungus gnats standing in potting soil next to a green houseplant

You notice small black flies hovering near your plant pots. They scatter when you move a pot or water a plant. A week later there are twice as many, and they’ve spread to every room with a houseplant.

That’s fungus gnats, and the infestation is almost certainly bigger than what you can see. Roughly 80 to 85% of the population is underground at any given time as eggs and larvae. The adults flying around are a small fraction of the problem.

Quick answer: To get rid of fungus gnats in houseplants, let the top 2 inches of soil dry completely between waterings, then treat the soil with a 1:4 hydrogen peroxide drench or BTi (Mosquito Bits) to kill existing larvae. Yellow sticky traps reduce the adult population while the soil treatment works. Expect 2 to 4 weeks to clear the infestation fully.

What Are Fungus Gnats?

Fungus gnats (Bradysia spp.) are small dark flies, 1 to 3mm long, that breed in moist, organically rich potting soil. They look like tiny mosquitoes and are common on indoor plants year-round.

Fungus gnats (Bradysia spp.) complete their full lifecycle in 3 to 4 weeks at typical indoor temperatures of 60 to 75°F. A female adult lives 7 to 10 days and lays 100 to 200 eggs in moist soil, depositing them just below the surface in clusters of 20 to 30. Eggs hatch in 4 to 7 days, producing translucent larvae with shiny black heads that reach 3 to 5mm at maturity. The larvae pass through four instars over 10 to 14 days, feeding on soil fungi, decaying organic matter, and fine root hairs. Pupation takes 3 to 7 days in the soil before the next adult generation emerges. At any given time, approximately 80 to 85% of the population is in the egg or larval stage underground. Adults live only 7 to 10 days. This is why trapping adults alone rarely ends an infestation: you’re catching 15 to 20% of the problem while the remaining 80 to 85% feeds and reproduces in the soil beneath your pots.

On established, healthy plants, larval feeding causes minor damage. On seedlings, cuttings, and plants already stressed by root problems, a heavy larval load causes visible wilting and stunted growth.

How to tell them apart from fruit flies: Fungus gnats hover near pots and soil. Fruit flies congregate around fruit bowls, compost bins, and drains. If the flies are near your plants and nowhere else, they’re fungus gnats.

Why Killing Adults Alone Doesn’t Work

The core mistake with fungus gnat control is treating the symptom rather than the source.

Sticky traps and contact sprays knock down the visible adult population, which looks like progress. But the next generation is already in the soil as eggs and early-instar larvae, 7 to 10 days from emerging as new adults. Without soil treatment, the population recovers faster than the adults can be trapped.

Effective control requires two things working together: removing the breeding conditions (consistently wet soil) and actively killing the larvae already underground.

Step 1: Dry Out the Soil

Fungus gnats can’t successfully lay viable eggs in dry soil. Cutting off consistent moisture is the first and cheapest step.

Let the top 2 inches of soil dry out completely before watering again. For most houseplants, this extends the usual watering interval by 3 to 5 days. Most tropical varieties tolerate this without visible stress; succulents and cacti already live under these conditions.

Switch to bottom watering where possible. Set the pot in 1 to 2 inches of water for 20 to 30 minutes and let the roots soak from below. The soil surface stays dry, cutting off the gnats’ preferred egg-laying zone. If you’re unsure whether your plant looks underwatered or overwatered, our guide on overwatered vs underwatered plant symptoms helps read the difference.

If the soil stays soggy despite extending the watering interval, check drainage. A pot without adequate drainage holes or compacted soil that holds water will keep conditions favorable for gnats regardless of what else you try.

Step 2: Kill the Larvae in the Soil

This step is what actually ends the infestation. You have two highly effective options, and combining both gives the fastest results.

Hydrogen peroxide soil drench

Mix 1 part 3% hydrogen peroxide (standard drugstore bottle) with 4 parts water. Water your plant normally with this solution, saturating the soil from the top. The peroxide reacts with organic matter on contact and releases oxygen, killing larvae on the spot.

At this dilution it’s harmless to roots and breaks down into water and oxygen within a day. Apply once, wait 5 to 7 days, then repeat. Two rounds typically clears the active larval population.

BTi (Bacillus thuringiensis israelensis)

BTi is a naturally occurring soil bacteria with a single biological target: the larvae of flies and mosquitoes. Sold as Mosquito Bits (granules) or Gnatrol (liquid concentrate), it’s safe for plants, beneficial soil organisms, pets, and people.

Soak a tablespoon of Mosquito Bits in a cup of water for 30 minutes, strain out the granules, and water your plant with the resulting liquid. Alternatively, sprinkle the granules directly on the soil surface before watering. BTi persists in the soil for 2 to 3 weeks, killing larvae as they hatch from any eggs that survived the initial treatment.

For a heavy infestation: use hydrogen peroxide first to knock down the existing larval population fast, then follow up with BTi every 2 weeks to catch new hatch cycles.

Neem oil soil drench

Neem oil works as a supplement to the above methods. Mix 2 tablespoons of cold-pressed neem oil with 1 tablespoon of dish soap per gallon of water. Apply to the soil surface as a drench. The active compound azadirachtin disrupts larval feeding and development. It degrades within 4 to 7 days in soil, so repeat weekly as needed.

One note: neem oil soil drenches smell pungent for 24 to 48 hours. Open a window if you’re treating multiple pots.

How to Get Rid of Fungus Gnats Flying Around

While the soil treatments work on larvae, use these to reduce the adult population and stop more eggs from reaching moist soil.

Yellow sticky traps are the most effective tool for adults. Push one trap per pot into the soil at the base of the plant. Fungus gnats are strongly attracted to yellow. The traps catch adults before they can deposit more eggs, and the build-up on the trap tells you whether the population is declining week over week. Replace when the adhesive fills or dries out, usually every 1 to 2 weeks during an active infestation.

Sand or coarse gravel mulch laid as a 1cm layer on the soil surface acts as a physical barrier to egg-laying. Adult gnats need direct contact with moist organic soil to deposit eggs. A layer of inorganic material on top disrupts this without harming the plant. Pair it with sticky traps for faster results.

Cinnamon on the soil surface has antifungal properties. Since fungus gnat larvae depend on soil fungi as a food source, reducing the fungal content makes the soil less hospitable. Apply a thin layer after watering, weekly.

If you’re dealing with multiple pests at the same time, check our guides on how to get rid of thrips on houseplants and how to get rid of whiteflies on indoor plants for the treatment approaches specific to those insects.

How PlantlyAI Helps

If you’re not certain those flies are fungus gnats rather than shore flies, root aphids, or another soil-dwelling pest, treating for the wrong insect means weeks of wasted effort.

PlantlyAI identifies plant pests from a single photo. Snap a picture of the affected plant or the insects near the soil surface, and the app confirms the pest and gives you a step-by-step treatment plan with organic, biological, and chemical options specific to that problem. It works across houseplants, vegetables, garden plants, and herbs.

Two free diagnoses per day, no account needed. Download on iOS or Android.

Frequently Asked Questions

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

With consistent treatment (soil drying plus hydrogen peroxide or BTi plus sticky traps), most infestations clear in 2 to 4 weeks. The full lifecycle runs 3 to 4 weeks, so you need to maintain treatment long enough to work through at least one complete generation of eggs, larvae, and adults.

Can hydrogen peroxide kill fungus gnats?

Yes. A 1:4 mix of 3% hydrogen peroxide and water kills fungus gnat larvae on contact when applied as a soil drench. It’s safe for roots at this dilution and breaks down into water and oxygen within 24 hours. Repeat once a week for 2 to 3 weeks to catch any larvae hatching from eggs that survived the first treatment.

How do I use neem oil for fungus gnats?

Apply neem oil as a soil drench, not a foliar spray. Mix 2 tablespoons of cold-pressed neem oil with 1 tablespoon of dish soap per gallon of water. Pour it over the soil to reach larvae below the surface. Reapply every 7 to 10 days for 3 to 4 weeks. Neem won’t act as quickly as hydrogen peroxide on existing larvae, but it disrupts larval development across multiple application cycles.

Will fungus gnats eventually go away on their own?

Only if the soil happens to dry out on its own. If conditions stay moist and fungal matter stays available in the soil, populations don’t resolve without intervention. A single female lays 100 to 200 eggs in her 7 to 10 day lifespan, so even a small surviving population rebounds quickly. Consistent dry-out cycles are the minimum required to see natural decline.

How do I know if my plant has fungus gnat larvae in the soil?

Scrape back the top 1 to 2 inches of moist soil right after watering and look for small translucent worms, 3 to 5mm long, with a shiny black head. For a more reliable test, press a small piece of raw potato against the soil surface and check underneath after 24 hours. Fungus gnat larvae are drawn to the starch and gather under the potato slice, making them easy to spot and confirm.

Not sure what's wrong? Diagnose your plant free

Upload a photo to our free plant disease identifier and get an instant diagnosis.

PlantlyAI app icon

Diagnose Your Plant in Seconds

Snap a photo and PlantlyAI tells you what's wrong and how to fix it, step by step.

✓ Free ✓ 2 daily scans ✓ Disease + treatment ✓ iOS & Android