How to Get Rid of Gnats

Updated 2026-06-07

Most “gnats” indoors are fungus gnats — tiny dark flies that breed in the damp soil of over-watered houseplants. (If they’re swarming your fruit bowl instead, those are fruit flies — a different fix.) Getting rid of them for good means hitting both ends at once: trap the flying adults AND kill the larvae in the soil, while letting the soil dry so they can’t breed. Do only one and they come straight back — which is exactly why most people fail.

1. First, which gnat do you actually have?

Fungus gnats hover around houseplants and run across the soil — they breed in moist potting mix. Fruit flies cluster around ripe fruit, drains and recycling. Drain flies (fuzzy, moth-like) sit on bathroom walls near drains.

This matters because the fix is completely different. If yours are around food, not plants, follow our fruit fly guide instead. The rest of this page is for fungus gnats.

2. Let the soil dry out

Fungus gnat larvae live in the top inch or two of damp soil. Let that layer dry completely between waterings — the larvae can’t survive in dry soil, and the adults won’t lay eggs there.

Switch to bottom-watering (water from a tray so the surface stays dry) and empty any saucers of standing water. For most lightly infested plants, drying out the soil alone makes a big dent.

3. Trap the flying adults

Stick yellow sticky traps just above the soil — fungus gnats are strongly drawn to yellow and get caught as they take off and land. This catches the egg-laying adults and lets you see whether numbers are dropping.

A shallow dish of apple cider vinegar with a drop of dish soap works as a cheap backup for adults flying around the room.

4. Kill the larvae in the soil (the step most guides skip)

Trapping adults alone won’t end it — the next batch is already in the soil. Treat the soil with BTI (Bacillus thuringiensis israelensis), the bacteria sold as mosquito bits: steep it in water and use it to water your plants, and it kills the larvae without harming the plant or pets.

A gentler home option is a soil drench of one part 3% hydrogen peroxide to four parts water — it fizzes on contact and kills larvae on the spot. Repeat with each watering for two to three weeks to break the breeding cycle.

5. Prevent them coming back

Don’t over-water, bottom-water when you can, top pots with a layer of coarse sand or grit (adults won’t lay in it), and check new plants and bags of potting soil — store-bought mix is a common way they arrive in the first place.

When to get help

Fungus gnats are a nuisance, not a structural threat, and DIY almost always wins. But if tiny flies persist after a few weeks of drying, trapping and treating the soil, you may be dealing with a moisture problem (a leak or chronically damp area) or a different pest — at which point a licensed local pest pro can take a look.

Dealing with a bigger pest problem than fruit flies? Get free quotes from licensed local pest pros — no obligation.

Frequently asked questions

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

Usually one to three weeks. Drying the soil and trapping adults helps within days, but you have to keep treating the soil for larvae through a full breeding cycle (about two to three weeks) to stop them returning.

Do yellow sticky traps get rid of gnats on their own?

They catch the adults and are great for monitoring, but they don’t touch the larvae in the soil — so on their own they only reduce numbers. Combine them with drying out and treating the soil (BTI or a hydrogen-peroxide drench) for a real fix.

Are gnats harmful?

Fungus gnats don’t bite people and are mostly harmless, though a heavy larvae population can damage the fine roots of seedlings and houseplants.

Does cinnamon or hydrogen peroxide really work on fungus gnats?

A hydrogen-peroxide soil drench (1:4 with water) genuinely kills larvae on contact. Cinnamon has mild anti-fungal properties that can reduce the fungus larvae feed on, but it’s a weak stand-alone fix compared with BTI and drying out the soil.

More DIY pest guides