If you're seeing tiny black flies hovering around your plant soil, you have fungus gnats. They breed in the top inch of wet potting mix, and a single female can lay up to 200 eggs in a seven to ten-day lifespan per Colorado State University Extension. The full egg-to-adult cycle is three to four weeks at room temperature per UC IPM, which is why by the time you notice the adults you already have overlapping generations developing in the soil. Most online advice sells you on solutions that don't address the larvae, which is where the damage actually happens.

Quick answer

Fungus gnats are tiny (2 mm) dark flies that breed in moist potting soil and whose larvae feed on plant roots. The adults you see flying are annoying but harmless; the larvae cause real damage to seedlings and young plants. Treatment requires drying out the top inch of soil between waterings and applying Bacillus thuringiensis israelensis (BTi, sold as Mosquito Bits) to the soil surface to kill larvae.

The treatment ladder

Start at step 1. If you don't see results in the timeframe, move to step 2. Most apartment infestations clear at step 2 or 3. Step 5 is for repeat offenders.

01Free

Stop watering. Let the top 2" dry completely.

Fungus gnat larvae need consistently moist soil to survive. If you can let the top two inches of soil go bone-dry for 5–7 days, you'll kill most of the larvae outright. This alone won't end the infestation if it's bad — there are still adults laying eggs — but it knocks the population down 60–70% before you do anything else.
Wait 5–7 days · then assess
02$15

Mosquito Bits — the actual fix.

Active ingredient: Bacillus thuringiensis israelensis (BTi). [Per the EPA](https://www.epa.gov/mosquitocontrol/bti-mosquito-control), BTi produces toxins that specifically affect the larvae of mosquitoes, black flies, and fungus gnats — and has no toxicity to people. Sprinkle a thin layer on top of your soil, water through it. The bacteria release into the wet soil and kill larvae within 24–48 hours. Reapply every 7 days for 3 weeks to cover the full 3–4 week egg-to-adult cycle.

I use Summit Mosquito Bits (30oz). ~$15 on Amazon, one bag lasts years. This single product clears most apartment fungus gnat problems on its own.

Apply every 7 days · 3 weeks total
03$9

Yellow sticky traps — for monitoring, not killing.

Stick them in the soil near your plants. They catch adult gnats and let you watch the population drop over the 3-week BTi treatment. Don't use these instead of Mosquito Bits — [yellow sticky traps catch adults only](https://ipm.ucanr.edu/home-and-landscape/fungus-gnats/) per UC IPM, and a single missed female lays up to 200 more eggs. Use them with the BTi treatment so you can see your progress.

I use Garsum yellow sticky traps (42-pack). Replace when half-covered.

Replace every 5–10 days
04$5

Sand or grit top-dressing as prevention.

After the infestation clears, top-dress all your plants with a 1/2" layer of horticultural sand or fine grit. It dries out fast and gives gnats no medium to lay eggs in. This is the single best long-term prevention measure. A bag of horticultural sand covers 8–10 plants.
Permanent · refresh annually
05$15

Hydrogen peroxide soil drench (only if BTi failed).

1 part 3% hydrogen peroxide to 4 parts water. Drench the soil thoroughly. The peroxide foams as it kills larvae and oxygenates the root zone. It's harder on the plant than BTi, but it works fast on bad infestations. Use once, not weekly — peroxide alters the soil microbiome with repeated use.

This is also the right move if you suspect root rot has started. See the root rot guide for the full unpot-and-repot protocol.

One drench · then return to BTi maintenance

What doesn't work (and what I wasted time on)

My first three days of fighting gnats, I tried all of these. None of them ended the infestation.

MethodWhat it doesWhy it doesn't end an infestation
Yellow sticky traps aloneCatches adult gnatsDoesn't touch the larvae. The eggs already laid will hatch and continue the cycle.
Apple cider vinegar trapsDrowns some adult gnatsSame problem as sticky traps. Catches a fraction of the adult population. Larvae untouched.
Cinnamon sprinkled on soilMild fungicideFolk remedy. Doesn't kill gnat larvae. May reduce fungal food source slightly.
Dish soap drenchSuffocates some larvaeInconsistent results. Can damage roots at high concentrations. BTi is safer and more effective.
Repotting in fresh soilRemoves current larvaeAdults will lay eggs in the new soil within hours. Doesn't break the cycle without BTi or top-dressing.
Letting soil dry out completelyKills larvae in the dry layerReduces population but stresses the plant. Works best as part of treatment, not alone.

Prevention checklist (after you've cleared an infestation)

Frequently asked

How long until my fungus gnats are completely gone?
With Mosquito Bits applied weekly for 3 weeks, you'll see adult populations drop within the first week as larvae stop hatching. The full cycle ends at 21–28 days because that's the egg-to-adult window at room temperature — you have to outlast any eggs laid before treatment started. Skipping a week of BTi resets the timer.
Are fungus gnats harmful to my plants?
The adults aren't — they don't bite, don't eat leaves, just fly around being annoying. The larvae are the problem. They feed on plant roots and decaying organic matter in the soil, and they spread fungal pathogens that cause root rot. A small population is harmless; a real infestation will weaken seedlings and small plants fast.
Can I use Mosquito Bits on edible plants?
Yes. BTi is approved for use on vegetables and herbs and is widely used in mosquito control. The EPA notes some BTi products are even labeled for use in standing water containers including cisterns and rain barrels. No waiting period before harvest.
Will hydrogen peroxide hurt my plant?
A single 1:4 diluted drench is safe and actually oxygenates the roots. Don't repeat weekly — peroxide kills beneficial soil microbes with repeated use. One drench, then back to BTi maintenance.
My fungus gnats came back after treatment. Why?
Almost always because of a new plant brought in without quarantine, or chronic overwatering that creates the conditions for re-infestation. Top-dress all pots with sand, bottom-water when possible, and quarantine new plants for 2 weeks with a sticky trap nearby.