How to get rid of gnats
Indoors, gnats are a watering habit rather than an infestation. Change the habit and the problem ends — but it takes a generation, not a weekend.
By Ryder M.Published Updated

Swat & Snap earns a commission from qualifying purchases made through the links on this page, at no extra cost to you. It does not change which products we pick — see how we pick and our affiliate disclosure.
Check you have gnats and not something else
"Gnat" gets used for any small flying insect, and the three common indoor candidates need three different fixes.
- Fungus gnats — dark, slender, long-legged, weak fliers drifting up off plant soil and gathering at windows. This page.
- Fruit flies — rounded, tan, often red-eyed, hovering around fruit and bins. Different page.
- Drain flies — fuzzy, moth-like, sitting still on a wall near a sink. Different page again.
Gnats vs fruit flies vs drain flies sorts it in a minute. If the insects are coming off your houseplants, read on.
What is actually happening
Fungus gnat larvae live in the top inch or two of potting soil and eat fungus and decaying organic matter. They need that layer to be consistently damp. The adults you see are short-lived, largely harmless, and are a symptom rather than the problem.
The cause, nearly every time, is overwatering — or more precisely, keeping the surface of the soil wet.
That is good news and bad news. Good, because the fix costs nothing. Bad, because it takes a full generation to work through: eggs hatch in a few days, larvae feed for a couple of weeks, pupation takes several days. Three weeks is a realistic timeline, and anyone promising two days is selling something.
Step 1 — change how you water
This is the whole treatment. Everything else is acceleration.
- Let the top inch dry completely between waterings. Push a finger in. If it is damp at the first knuckle, wait. Larvae cannot survive a dry surface layer.
- Water from the bottom where the plant tolerates it: stand the pot in a tray, let it take up what it needs for twenty minutes, then pour off the rest. The roots drink; the surface stays dry.
- Empty the saucers. A pot standing permanently in water keeps the mix saturated regardless of what you do above.
- Check the drainage. A pot with a blocked hole or no hole at all is a bog with a plant in it.
Most houseplants tolerate this comfortably. The ones that genuinely want constant moisture — some ferns, carnivorous plants — are the ones to manage differently, and for those, a surface barrier is the better tool.
Step 2 — kill the larvae that are already there
BTI. Bacillus thuringiensis israelensis is a bacterium lethal to fungus gnat larvae and mosquito larvae, and to essentially nothing else. It is the same active in mosquito dunks and bits, and the granule form is the practical one here: sprinkle on the soil surface, or steep in water and use it to water the plants for a week or two.
It is the one genuinely effective, genuinely low-risk larval treatment for houseplants, and the fact that the same product also handles a rain barrel outdoors is a small bonus. Mosquito dunks vs bits covers the difference between the formats.
A sand or grit top dressing. Half an inch of coarse sand, horticultural grit or perlite on the surface dries fast and gives the adults nowhere to lay. It works well alongside the watering change, particularly on plants that must stay moist.
Hydrogen peroxide solution. Widely recommended online, and it does kill larvae on contact. It is also indiscriminate, short-lived, and hard on soil life. We would use BTI instead.
Quick picks
| # | Product | Best for | Mechanism | Price |
|---|---|---|---|---|
| 1 | Our pickSafer Brand Houseplant Sticky StakesYellow sticky cards on a stake, pushed into the pot. They catch the adults while you fix the watering, which is the part that actually ends a gnat problem. | Gnats in potting soil | Yellow adhesive card | |
| 2 | Summit Mosquito BitsThe same BTI in granules. Releases faster than a dunk and doubles as the correct treatment for fungus gnats in houseplant soil. | Fast knockdown and fungus gnats | BTI granules | |
| 3 | Katchy Indoor Insect TrapUV light, a small fan and a sticky pad. The fan is what makes it work on gnats — they are weak fliers and get pulled in. | Fungus gnats around plants | UV light + suction fan + glue board | |
| 4 | Zevo Flying Insect TrapA plug-in that pairs blue and UV light with a sticky cartridge. It runs quietly in the background, which is exactly what people want from a fly problem. | Rooms you want handled passively | Blue + UV light, sticky cartridge |
#ad — every price link goes to Amazon and Swat & Snap earns a commission on qualifying purchases. No price is shown until it can be pulled live from the retailer.

Safer Brand Houseplant Sticky Stakes
Safer Brand · Gnats in potting soil
Yellow sticky cards on a stake, pushed into the pot. They catch the adults while you fix the watering, which is the part that actually ends a gnat problem.
- Also a diagnostic: a full card in three days tells you the soil is the source
- No chemistry near a plant you might eat from
- Adults only — larvae in the soil need drying out or a BTI product
- Visible yellow cards in a display pot
Check price on Amazon

Summit Mosquito Bits
Summit · Fast knockdown and fungus gnats
The same BTI in granules. Releases faster than a dunk and doubles as the correct treatment for fungus gnats in houseplant soil.
- Scatterable, so it treats a bog or a tray a dunk cannot sit in
- The one product that solves both a yard problem and a houseplant problem
- Shorter residual than a dunk — reapply more often
- Granules wash away in heavy rain
Check price on Amazon

Katchy Indoor Insect Trap
Katchy · Fungus gnats around plants
UV light, a small fan and a sticky pad. The fan is what makes it work on gnats — they are weak fliers and get pulled in.
- The fan catches fungus gnats that simply ignore a light-only trap
- USB power means it can sit on a plant shelf with no socket nearby
- Needs the room dark to compete with a window
- Glue boards fill quickly in a real gnat bloom
Check price on Amazon

Zevo Flying Insect Trap
Zevo · Rooms you want handled passively
A plug-in that pairs blue and UV light with a sticky cartridge. It runs quietly in the background, which is exactly what people want from a fly problem.
- No zapping noise and no insect debris — it is a sticky pad behind a light
- Catches gnats and small flies that a vinegar trap ignores
- Cartridges are an ongoing cost that outruns the unit price fast
- Needs a dark room to compete with daylight
Check price on Amazon
Step 3 — catch the adults
This does not fix the problem, but it lowers the population and makes the room livable while the soil dries.
- Yellow sticky stakes pushed into the pot, just above the soil. They are also a diagnostic: a card covered in three days confirms the soil is the source, and a card that stays clean means look elsewhere.
- A light-and-fan trap for the room. The fan is the important part — fungus gnats are weak fliers and get pulled in rather than having to land.
- A plug-in light trap in a dim corner for ongoing passive control.
- Cider vinegar traps catch some fungus gnats but far fewer than they catch fruit flies. If your vinegar trap is barely filling, that is consistent with gnats rather than evidence the trap is broken.
Step 4 — deal with the source of new ones
- New plants frequently arrive with gnats. Quarantine a new plant away from the others for a fortnight.
- Bags of potting mix stored damp, particularly opened bags kept outdoors or in a garage, are a common origin. Store them sealed and dry.
- Repotting an infested plant into fresh mix works, and is worth it for a plant that is genuinely struggling — remove as much old soil from the roots as the plant tolerates.
The realistic timeline
- Week 1: adults still visible, sticky cards filling. Soil starting to dry.
- Week 2: noticeably fewer. Larvae dying off as the surface stays dry.
- Week 3: effectively clear if the watering change held.
- Week 4 onward: if they are back, something is still wet — a saucer, a pot without drainage, or one plant you are still watering the old way.
Gnats that are not fungus gnats
- Outdoors, biting, in swarms near water: likely blackflies or biting midges. Different problem, and a skin repellent is the practical answer — the CDC-listed actives are here.
- Small flies in a bathroom, sitting still: drain flies. Here.
- Clouds of tiny flies outdoors in the evening, not biting: probably non-biting midges, which are a nuisance rather than a pest and are best waited out.
Frequently asked
Why do I suddenly have gnats in my house?
How long does it take to get rid of fungus gnats?
Does cinnamon get rid of fungus gnats?
Will fungus gnats hurt my plants?
Do gnats bite?
More on fruit flies & gnats
Tiny flies in the kitchen are almost never one problem. Identify which of the three you have, then treat the source — the trap alone never finishes it.
Not sure yet? Read how we pick.
Ryder M.
Ryder M. is the hands-on owner behind Magoo Media Group. He writes Swat & Snap because he got tired of pest-control advice that was either a sales pitch or a scare story.
Related on Swat & Snap
- Fungus gnats in houseplantsDry soil, grit top-dressing, BTI and sticky stakes — the four-part fix and the order to do it in.

- Gnats vs fruit flies vs drain fliesBehavior, not anatomy: the one-minute test that tells you which tiny fly you have.

- The best plug-in fly trapsSilent light traps for whole-room fly control — and the running cost nobody mentions.

- How to get rid of fruit fliesSource first, trap second. The full 48-hour sequence and the hiding places people always miss.

- Mosquito dunks vs bitsSlow-release dunks or fast-release granules — which BTI format suits which water.
