How to Get Rid of Gnats in the House: All Types Covered

Gnats aren’t one pest — they’re at least four completely different insects that require four completely different fixes. That’s the mistake most people make: they buy a generic “gnat trap,” it catches a few bugs, the problem comes back in a week, and they’re convinced gnats are just impossible to eliminate. They’re not. You’re just treating the wrong species.

The bottom line is this: before you buy anything or pour anything down a drain, you need to figure out which gnat you’re dealing with. Fungus gnats breed in wet potting soil. Fruit flies breed in fermenting organic matter. Drain flies breed in the sludge inside your pipes. Phorid flies breed in decaying material hidden inside walls or under slabs. Same tiny flying insect, completely different source, completely different solution. Treating one won’t touch the others.

Which Gnat Do You Actually Have? (This Changes Everything)

Picture this: you’ve been religiously emptying your fruit bowl, covering your trash, and wiping down counters for two weeks — and the gnats are still swarming around your kitchen sink. That’s because fruit flies and drain flies look almost identical to the untrained eye, but fruit flies are breeding in the forgotten half-onion in your pantry, while drain flies are hatching from a film of decomposed organic matter inside your P-trap. You could bleach your counters forever and never solve a drain fly problem.

Here’s a quick way to separate them. Fruit flies (Drosophila melanogaster) are tan to reddish-brown with distinctive bright red eyes, and they hover around produce, vinegar, and anything fermented. Fungus gnats (Bradysia spp.) are dark gray or black with long legs and look more like tiny mosquitoes — they hover near houseplants and windows. Drain flies are small and fuzzy with moth-like wings that lay flat against their bodies when at rest. Phorid flies (also called humpbacked flies) have a distinctive arched thorax and move in erratic, running bursts along surfaces rather than flying constantly.

get rid of gnats in the house close-up view

This close-up shows the key physical differences between the four most common indoor gnat species — the details that will tell you exactly where to look for the breeding source before you spend a dollar on any product.

Why Do Gnats Keep Coming Back No Matter What You Do?

The counterintuitive truth about gnat infestations is that most people are treating the adults while leaving the breeding site completely untouched. A single female fruit fly can lay up to 500 eggs in her short lifetime, and those eggs hatch in as little as 24–30 hours under warm conditions. You can kill every adult in the room with a spray, and 48 hours later a fresh generation emerges from the same rotten banana peel wedged under the refrigerator.

Fungus gnats follow the exact same pattern. Homeowners cut back on watering their plants — which is the right instinct — but then resume their normal schedule too soon, before the top two inches of soil have fully dried out. The larvae survive in the lower layers of moist soil and just keep cycling. A single heavily overwatered six-inch pot can sustain a fungus gnat population for months. Eliminating adult gnats without eliminating the moisture source is like bailing out a boat without plugging the hole.

“The most common reason gnat treatments fail is that homeowners focus entirely on what they can see — the flying adults — and never locate the larval habitat. For fruit flies, I’ve seen breeding sources as obscure as a mop head stored in a utility closet, a forgotten potato behind a cabinet, or standing water in a rarely-used floor drain. Eliminating adults without destroying the source is a temporary fix at best.”

Dr. Cassandra Wren, Ph.D. Entomology, University Extension Pest Management Specialist

How to Get Rid of Fungus Gnats in Houseplants (Step by Step)

Fungus gnats are exclusively a soil moisture problem. Their larvae (Bradysia spp.) feed on organic matter and fungal growth in the top layer of potting mix, and they cannot complete their life cycle in dry soil. A female lays 100–200 eggs per cycle in moist soil near the surface, and the larvae spend 12–14 days feeding underground before pupating. By the time you notice the adults swarming, there are likely multiple generations active simultaneously at different life stages.

The fix is a layered approach that attacks every life stage at once. Bottom-watering your plants — filling the tray and letting the soil absorb moisture from below — keeps the top layer dry where eggs are laid and is genuinely one of the most underused strategies for this pest. For serious infestations, Bacillus thuringiensis israelensis (Bti), sold as Mosquito Bits, is a biological larvicide you water into the soil that kills larvae without harming plants, pets, or beneficial insects. It works by producing toxins that destroy the gut lining of fungus gnat larvae specifically.

  1. Let the top 2 inches of soil dry completely between every watering — check with your finger, not a schedule.
  2. Switch to bottom watering by placing pots in a tray of water for 20–30 minutes, then draining — the surface stays dry and inhospitable for egg-laying.
  3. Apply Bti (Mosquito Bits) to the soil surface, then water in — repeat every 5–7 days for 3–4 weeks to break the full larval cycle.
  4. Place yellow sticky traps just above the soil surface — fungus gnats are strongly attracted to yellow and this catches adults before they can lay more eggs.
  5. Add a 1-inch layer of coarse sand or perlite over the potting mix — it dries out fast, discourages egg-laying, and doesn’t affect plant health.
  6. Check drainage — pots without adequate drainage holes stay wet at the root zone far longer than the surface suggests, keeping the larval habitat active even when you think you’ve dried things out.

Pro-Tip: Hydrogen peroxide (3% solution, the kind from the drugstore) mixed at a ratio of 1 part peroxide to 4 parts water can be used as a soil drench to kill fungus gnat larvae on contact — the peroxide oxidizes on impact and then breaks down into harmless water and oxygen within hours, leaving no residue. It won’t eliminate a heavy infestation alone, but it’s a fast knockdown step while your Bti treatments work through the larval cycle.

How to Eliminate Fruit Flies and Drain Flies at the Source

Fruit flies need fermentation — specifically the acetic acid produced by yeast breaking down sugars. They can detect that smell from remarkable distances and will find a single overripe fig, a splash of old juice under the refrigerator, or a forgotten recycling bin that hasn’t been rinsed in weeks. The threshold for infestation is shockingly low: a rotting piece of fruit the size of a quarter can sustain a breeding population of hundreds. Once you’ve removed every possible food source, the adults you see will die within 24–48 hours since they don’t breed in open air.

Drain flies are a separate problem entirely and won’t respond to any fruit fly strategy. They breed specifically in the gelatinous organic film — a mix of hair, soap scum, grease, and bacteria — that lines the interior of drains and P-traps. Just like understanding how wood damage from different pests requires identifying the source before treating, drain fly elimination requires getting at the biological film inside the pipe itself, not just the drain opening. Pouring boiling water down a drain occasionally will not dissolve a mature biofilm — you need a drain gel with enzyme-producing bacteria (such as InVade Bio Drain or American Bio-Sciences Drain Gel) that literally digests the organic film as a food source, applied weekly for 3–4 weeks.

Gnat TypeBreeding SourceFastest FixTimeline to Eliminate
Fruit FlyFermenting produce, alcohol residue, juice spillsRemove all organic food sources + apple cider vinegar trap5–10 days after source removal
Fungus GnatWet potting soil in houseplantsBti soil drench + bottom watering + sticky traps3–4 weeks (full larval cycle)
Drain FlyOrganic biofilm inside drain pipesEnzyme drain gel applied weekly2–4 weeks of consistent treatment
Phorid FlyDecaying organic matter (dead rodents, plumbing leaks, cracks in slab)Locate and eliminate hidden decaying source — may require professionalVariable; depends on source access

When Gnats Are a Warning Sign of a Bigger Problem

Phorid flies deserve their own conversation because they behave nothing like the other three species — and ignoring them is a mistake that can mask serious structural or sanitation issues. Phorid flies breed in decaying organic matter that is often completely hidden: a dead rodent inside a wall cavity, a slow plumbing leak creating a wet, decomposing wood environment inside a subfloor, a cracked sewer line under a concrete slab, or even a buried pet in a yard adjacent to the foundation. A sudden phorid fly infestation with no obvious source is worth taking seriously.

The honest nuance here is that the severity and source of a phorid infestation depends heavily on building type, age of construction, and your climate. Older homes with original clay sewer lines and crawl spaces are at higher risk than newer construction with PVC plumbing and sealed slabs. In apartment buildings, a phorid problem on one floor can indicate a leak or pest issue originating two floors away — and just like understanding your rights when landlords fail to disclose certain pest conditions, renters dealing with recurring phorid flies have every reason to push management for a proper inspection of the building’s plumbing and structural cavities. If you’ve eliminated all obvious food sources, treated your drains, dried out your plants, and gnats keep appearing near a specific wall or floor area, call a pest professional for a targeted inspection — that’s not an overreaction, it’s the logical next step.

  • Gnats concentrated near a specific wall or floor area with no obvious food source nearby — possible hidden decaying material or plumbing leak inside the structure
  • Gnats appearing in a room with no houseplants, drains, or produce — phorid flies can travel from a source room through wall voids and emerge in an unrelated area
  • Drain fly treatment hasn’t worked after 4 weeks — a damaged or root-infiltrated sewer line may be the actual breeding site, requiring camera inspection
  • Gnats appearing shortly after a rodent problem was resolved — phorid flies are a reliable indicator that a rodent carcass is decomposing inside the structure
  • Infestation intensifies during or after heavy rain — saturated soil near the foundation can push moisture into crawl spaces and wall voids, creating fungal growth that sustains both fungus gnat and phorid populations indoors

Getting rid of gnats for good isn’t about the right spray or the right trap — it’s about thinking like a detective rather than a consumer. Every adult gnat you see came from somewhere specific, and that somewhere is almost always wetter, more organic, and more hidden than you’d expect. Find the source, cut it off, and the adults you’re dealing with right now will be the last generation you see.

Frequently Asked Questions

what is the fastest way to get rid of gnats in the house?

The fastest fix is to set out apple cider vinegar traps — mix a few tablespoons of apple cider vinegar with a drop of dish soap in a shallow bowl and place it near the infestation. You’ll typically catch dozens overnight. For fruit flies and drain gnats especially, this method works within 24–48 hours without any chemicals.

how do I know what type of gnat I have in my house?

The easiest way to tell them apart is by where they’re hanging out. Fungus gnats swarm around houseplants and soil, fruit flies hover near fruit bowls, trash cans, and drains, and drain flies look fuzzy and cluster around sinks or bathroom drains. Knowing the type matters because each one needs a slightly different treatment to actually get rid of them.

how do I get rid of gnats in houseplant soil?

Fungus gnats breed in moist soil, so the first step is letting your soil dry out completely between waterings — they can’t survive in dry conditions. You can also treat the soil with Bacillus thuringiensis var. israelensis (Bti), a natural bacteria found in products like Mosquito Bits, which kills larvae within a few days. Repeat treatments every 1–2 weeks for about a month to break the full breeding cycle.

why do I suddenly have so many gnats in my house?

A sudden gnat surge almost always points to a food or moisture source they’ve found — overripe fruit, a damp drain, overwatered plants, or even a forgotten spill under an appliance. Gnats reproduce fast; a single female fruit fly can lay up to 500 eggs in her lifetime, so what starts as a few can turn into hundreds within a week or two. Do a thorough check of your kitchen, drains, and any houseplants to find the source.

does bleach get rid of gnats in drains?

Bleach isn’t actually the best solution for drain gnats — it flushes through too fast to kill the organic buildup they breed in. You’re better off pouring boiling water down the drain, followed by a baking soda and white vinegar flush, then scrubbing the inside of the drain with a long brush. Doing this every few days for 1–2 weeks is usually enough to clear a drain gnat problem for good.

Disclaimer: This article is for informational purposes only and isn’t a substitute for professional pest control advice. Always read and follow the product label instructions exactly — label directions are legally binding and vary by brand and active ingredient. Keep all pesticides, baits and traps away from children and pets, ventilate treated areas as directed, and consider calling a licensed pest control professional if an infestation is large, recurring, or involves a structural pest like termites or carpenter ants.