How to Get Rid of Gnats in Your House

If you have gnats in your house, the first thing to know is that “gnats” is not one bug. It is really three different little flies with three different breeding sources, and you cannot win until you identify which one you have. Fruit flies breed in rotting produce and drains, fungus gnats breed in overwatered houseplant soil, and drain flies breed in the slimy film inside your pipes. Trapping the adults feels like progress, but it does nothing lasting because the source keeps making more. Find the source for your specific gnat and eliminate it, and the swarm collapses on its own. So before you buy anything, figure out which fly you are actually fighting.

The short version

“Gnats” are three different flies with three different breeding sources, so identify yours first, then kill the source. Trapping adults alone never ends a swarm; the source is what keeps refilling it.

  • Do first (free): Figure out which fly you have by where they swarm, then remove that source: bin rotting produce, let plant soil dry out, or clear the gunk in the drain.
  • If that fails: Add the matching tool, a vinegar trap for fruit flies, yellow sticky stakes plus drier soil for fungus gnats, or an enzyme drain cleaner for drain flies.
  • Skip: Bug-bomb foggers and pouring bleach down the drain; the fogger misses the source and bleach rinses off the film instead of removing it.
answer-card

Three flies, not one

The reason most gnat advice fails is that it treats every tiny flying bug the same, then hands you a single spray. These three flies look similar at arm’s length but live completely different lives, and where they swarm tells you which one you have. Fruit flies are tan with red eyes and hover around the fruit bowl, the trash, and the kitchen sink. Fungus gnats are dark and mosquito-like and drift up in a little cloud when you water a houseplant. Drain flies are fuzzy and moth-like and sit on the wall right next to a sink or shower drain.

Get the ID right and the rest is easy, because each fly has exactly one thing keeping it alive. If you are not sure which one is in your kitchen, our guide to the types of gnats and how to tell fungus, fruit, and drain flies apart walks the visual differences, and our breakdown of fruit fly versus gnat settles the most common mix-up. Nail the ID and you stop wasting money on the wrong fix.

Find the breeding source

This is the whole game, and it costs nothing. Adults you can see are a tiny fraction of the population; the eggs and larvae are in the source, and that is what you have to find. For fruit flies, the source is anything fermenting: overripe bananas, a forgotten potato, the splash zone under the trash bag, recycling with juice residue, or the organic film in the kitchen drain. Throw out or refrigerate every piece of soft produce, rinse cans and bottles before they go in the bin, and take the trash out.

For fungus gnats, the source is wet potting soil. Their larvae feed on fungus and roots in the top inch of chronically damp soil, so the fix is to stop overwatering. To find a drain fly source, tape a clear cup loosely over the drain overnight; if flies are trapped against the tape in the morning, that drain is breeding them. UC IPM uses the same sanitation-first approach Extension recommends for small filth flies here, because fly management leans on source reduction over spraying. No source, no swarm.

body-1

Kill the source for each fly

Once you know the fly, the fix is specific. Match the tool to the breeding site, not to the biggest bottle on the shelf, because a trap that works on fruit flies does nothing for the larvae living in your drain or your plant soil.

Your gnat Where it breeds What actually clears it
Fruit fly Rotting produce, trash, drain film Remove produce and clean drains, then a vinegar trap for stragglers
Fungus gnat Overwatered houseplant soil Let the top inch dry, sticky stakes, BTI in the water
Drain fly Organic film inside the pipe Scrub the pipe wall, then an enzyme or bio drain cleaner
Fruit fly
Where it breedsRotting produce, trash, drain film
What actually clears itRemove produce and clean drains, then a vinegar trap for stragglers
Fungus gnat
Where it breedsOverwatered houseplant soil
What actually clears itLet the top inch dry, sticky stakes, BTI in the water
Drain fly
Where it breedsOrganic film inside the pipe
What actually clears itScrub the pipe wall, then an enzyme or bio drain cleaner

For fruit flies, clear the produce and clean the drains first, then set an apple-cider-vinegar trap to mop up the adults still flying: a cup with a splash of vinegar, a drop of dish soap to break the surface tension, covered with plastic wrap and a few pinholes. As UC IPM’s notes on vinegar (fruit) flies explain, the trap is cleanup, not the cure; sanitation is what ends it. Our full walkthrough on getting rid of fruit flies covers the drain-source angle people miss.

For fungus gnats, let the top inch of soil dry completely between waterings, which starves the larvae. UC IPM’s fungus gnat guidance on letting the soil dry is the load-bearing step; add yellow sticky stakes in the pot to catch adults and confirm the count is dropping, and water with a BTI product (mosquito-bits-type Bacillus thuringiensis israelensis) to knock out larvae. Our houseplant fungus gnat guide has the watering schedule in detail.

For drain flies, the film clinging to the inside of the pipe is the nursery, and here is the part that trips everyone up: bleach does not remove that film, it just rinses over it. Physically scrub the pipe wall with a long brush, then pour in an enzyme or bacterial drain cleaner that digests the organic gunk over several nights. Boiling water alone or a bleach pour will look like it worked for a day, then the flies return because the film, and the eggs in it, survived.

body-2

Keep them from coming back

Prevention is the same maintenance habits that removed the source, just kept up. In the kitchen, store ripening fruit in the fridge once it softens, rinse recyclables, take trash out before it ferments, and run the garbage disposal with cold water. The kitchen drain is the single most overlooked fruit fly nursery, so give it an enzyme cleaner once a month even when you do not see flies. This is the boring, sanitation-first habit that the EPA’s sanitation-first, IPM approach to indoor pests puts ahead of any chemical, and it is cheaper and more durable than anything in a spray bottle.

For plants, water from the bottom or wait until the soil is dry an inch down, and consider topping pots with a half-inch of coarse sand or grit so the surface the gnats lay in stays dry. For drains you rarely use, like a guest bathroom, run water through them weekly so the trap does not dry out and the pipe does not build film. Keep one yellow sticky stake in your worst plant year-round as a cheap early-warning monitor; a fresh cluster on it tells you a source is starting before you see a swarm.

When to call a pro

Small flies are a DIY problem in almost every home, so you rarely need to pay anyone. Call a licensed pest professional when the swarm survives a correct two-week effort across all three sources, when flies are pouring out of a wall or floor drain you cannot access, or when you suspect a broken or leaking pipe behind a wall is feeding a drain-fly population you cannot reach. A persistent indoor fly with no kitchen, plant, or drain source can also point to a hidden moisture or sewage problem worth a professional’s eyes. That is a plumbing-and-pest call, not a spray-more call.

Common questions

What kills gnats instantly?

A vinegar-and-dish-soap trap or a quick vacuum will knock down the adults you can see right now, and that feels instant. But “instant” only ever applies to the visible flies, which are a small fraction of the population. The larvae in the produce, soil, or drain keep hatching, so without removing the source you are back to a swarm within days. The lasting fix is killing the source, not the stragglers.

Why do I have gnats with no fruit out?

Because produce is not the only source. If the fruit bowl is empty and you still have them, check the kitchen drain for fruit flies, your houseplant soil for fungus gnats, and the bathroom drain for drain flies. The cup-over-the-drain test overnight will tell you fast whether a drain is the breeding site.

Does bleach get rid of drain flies?

Not reliably. Drain flies breed in the organic film stuck to the pipe wall, and bleach mostly runs over that film without removing it, so the eggs survive and the flies come back. You have to physically scrub the pipe, then use an enzyme or bacterial cleaner that actually digests the gunk over several nights.

How long does it take to get rid of gnats?

Once you remove the right source, expect the swarm to drop within a few days and clear in one to two weeks, since you are outlasting the larvae already in the source. Fruit flies usually clear fastest; fungus gnats take a little longer because the soil has to dry across waterings. Sticky stakes and traps showing fewer catches are how you know it is working.

Are gnats harmful?

The common house gnats here are a nuisance, not a danger to a healthy person, and they are not biting you. They can carry bacteria from a drain or trash onto food surfaces, which is reason enough to keep them out of the kitchen, but this is a cleanliness and annoyance problem, not a medical one.

Final verdict

Getting rid of gnats starts with the one step most guides skip: figure out which of the three flies you actually have. Fruit flies live on rotting produce and drains, fungus gnats on overwatered soil, drain flies on the film inside your pipes, and the fix is different for each. Find and eliminate that source for free, then add the matching tool only if you need it: a vinegar trap for fruit flies, drier soil plus sticky stakes and BTI for fungus gnats, a scrub and an enzyme cleaner for drain flies. Skip the foggers and the bleach pour; one misses the source and the other just rinses over it. Trapping adults is cleanup. Killing the source is the cure, and it is what makes the swarm stay gone.

Next steps:

– Pin down which fly you have with our types of gnats identification guide.

– If it is the fruit bowl and the drain, work through our how to get rid of fruit flies guide.

– If it is your plants, follow the watering fix in our houseplant fungus gnat guide.

Reviewed by Daniel Brooks, licensed pest control professional, focused on safe and effective control.

Author

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top