Pests
How to Get Rid of Gnats (Fungus Gnats in Houseplants)
Get rid of gnats by finding the source: dry out houseplant soil, bottom water, use sticky traps and BTI, clean drains, and repot when needed.
Those tiny black flies drifting around your houseplants or bumping into the window are almost always fungus gnats. They don't bite and they're not dangerous, but they multiply quickly and they're hard to ignore. The key is that the flies you see aren't really the problem — their larvae are, living in the top layer of damp potting soil.
Before you do anything, make sure you're dealing with the right fly. If the "gnats" are clustering around fruit or the trash, you probably have fruit flies instead — see our guide on how to get rid of fruit flies.
Fungus gnats vs fruit flies vs drain flies
| Fly | How it looks | Where you see it | Where it breeds | Main fix |
|---|---|---|---|---|
| Fungus gnat | Dark gray to black, slender, long legs; weak flier | Around houseplants, running across soil, near windows | Top inch or two of damp potting soil | Dry the soil, sticky traps, BTI, repot |
| Fruit fly | Tan body, red eyes, about 1/8 inch | Around fruit, trash, recycling, sinks | Fermenting produce and sticky spills | Remove produce; vinegar traps |
| Drain fly | Fuzzy, gray, moth-like with rounded wings | Resting on bathroom and kitchen walls | Slimy film in drains and overflows | Scrub drains; enzyme drain gel |
You can have more than one at the same time. If your plants are fine but the bathroom is full of fuzzy flies, focus on the drains first.
Why it takes a few weeks
Fungus gnats go from egg to adult in roughly three to four weeks at typical indoor temperatures. Sticky traps catch adults, and BTI and dry soil wipe out larvae, but eggs already laid will keep hatching for a while. That's why it's important to keep going even after the number of adults drops.
Yellow sticky traps are the simplest way to track progress: if each new trap catches fewer gnats than the last, you're winning. For the larvae, BTI products like mosquito bits are a common, label-guided option for houseplants.
Watering habits that keep gnats away
- Water when the top of the soil is dry, not on a calendar.
- Use pots with drainage holes and empty saucers after watering.
- Bottom water plants that tolerate it to keep the surface dry.
- A thin top layer of coarse sand or fine gravel can make the surface less inviting for egg-laying, though it can also hide how wet the soil is — check moisture with a finger or skewer.
- Give plants enough light; plants in dim spots dry out slowly and stay wet longer.
Step by step
- 1
Figure out which gnat you have
Watch where the tiny flies gather. Dark, slender gnats that run across soil and hover around houseplants are fungus gnats. Tan flies with red eyes around fruit and trash are fruit flies. Fuzzy, moth-like flies resting on bathroom walls are drain flies. Each one breeds in a different place, so this step decides everything else.
- 2
Check the soil
For fungus gnats, look at the top inch of soil in each plant. Larvae are tiny, clear-to-white worms with shiny black heads. You can push a slice of raw potato into the soil for a day or two, then lift it to see whether larvae have gathered underneath.
- 3
Let the soil dry out
Fungus gnat larvae need constantly damp soil. Let the top inch or two dry out between waterings, as long as your plant tolerates it. Empty saucers so pots aren't sitting in water. This alone often cuts the population sharply.
- 4
Switch to bottom watering
Set pots in a tray or saucer of water for 15–30 minutes so the soil soaks up water from below, then let them drain fully. The surface stays drier, which makes it much less inviting for egg-laying adults.
- 5
Set yellow sticky traps
Push yellow sticky traps into the soil or hang them just above the plants. They catch adult gnats before they lay more eggs and show you how bad the problem is. Replace them when they're covered. Keep them away from pets' fur and kids' hands.
- 6
Treat the soil with BTI
BTI (Bacillus thuringiensis israelensis) is a bacterium that kills fly larvae in soil and water. It's sold as mosquito bits or dunks. Follow the product label — a common method is soaking the granules or dunk in water and using that water for your plants. Repeat as the label directs for several weeks to catch each new hatch.
- 7
Test and clean the drains
If the gnats hang around sinks or showers instead of plants, tape a piece of clear tape loosely over each drain overnight. Flies stuck to it mean that drain is a source. Scrub the inside of the drain with a stiff brush and hot tap water, then use an enzyme drain gel per its label to break down the film.
- 8
Repot heavily infested plants
If a plant is swarming and drying it out isn't enough, repot it outdoors or over newspaper. Remove as much old soil as you gently can, throw it away in a sealed bag, rinse the pot well, and repot in fresh bagged potting mix. Don't reuse soil from an infested pot.
- 9
Prevent a comeback
Store opened bags of potting mix sealed, since gnats can breed in damp bags. Check new plants before bringing them inside, water only when needed, and keep up with sticky traps for a few weeks after the last gnat to make sure the cycle is broken.
Common mistakes
- Treating fungus gnats like fruit flies with vinegar traps, which won't touch larvae in the soil.
- Watering on a fixed schedule so the soil never dries out.
- Leaving water standing in saucers and cachepots.
- Stopping BTI or traps after a week while eggs are still hatching.
- Reusing old potting soil from an infested plant.
- Pouring boiling water into PVC drains, which can damage pipe joints.
Frequently asked questions
What's the fastest way to get rid of gnats?
For fungus gnats, combine everything at once: let the soil dry, use yellow sticky traps for adults, and treat the soil with BTI for larvae. You'll see fewer adults within days, but it usually takes three to four weeks to break the full life cycle.
Where do gnats come from?
Fungus gnats usually arrive in potting soil or new plants and thrive in damp, organic soil. They can also fly in from outdoors. Drain flies breed in the slimy film inside drains, and fruit flies breed on ripe produce and in trash.
Is BTI safe for pets and people?
BTI targets the larvae of certain flies like mosquitoes and fungus gnats, and is widely considered low risk for people, pets and plants when used as directed. Still, follow the label, store it out of reach, and keep pets from eating the granules.
Do fungus gnats harm plants?
Adults are mostly a nuisance, but larvae feed on organic matter and fine roots. Large numbers can damage seedlings, cuttings and young plants. Established, healthy houseplants usually recover once the soil dries out and the gnats are gone.
Will a vinegar trap catch gnats?
A vinegar trap is great for fruit flies but much less effective for fungus gnats, which aren't drawn to fermenting fruit in the same way. Yellow sticky traps work better for fungus gnats.
Related guides
- GuideHow to Get Rid of Fruit FliesGet rid of fruit flies for good: find and remove where they breed, set simple vinegar traps that work, clean drains safely, and stop them coming back.
- GuideHow to Get Rid of Ants in the HouseGet rid of ants for good: identify the type, follow the trail, use slow-acting baits the right way, seal entry points, and know when to call a pro.
- GuideHow to Unclog a DrainClear a slow or stopped sink or tub drain with hot water, a plunger, a drain snake or by cleaning the P-trap — plus what not to pour down it and how to tell when the problem is the main line.