How to Get Rid of Gnats Indoors (and Stop Them Breeding)

Learn how to get rid of gnats indoors: tell fungus gnats from fruit flies and drain flies, dry out plant soil, use BTi and sticky traps, and clean drains.

By

·

·

8–12 minutes
Tiny fungus gnats hovering over the damp soil of a potted houseplant on a sunny windowsill

Tiny flies are drifting around your houseplants, hovering over the fruit bowl or sitting on the bathroom wall, and swatting them doesn’t seem to make a dent. In fall the problem often gets worse, as potted plants come in from the patio and windows close up for the season.

“Gnats” is a catch-all name for three different small flies, and each one breeds somewhere different. This guide shows you how to tell fungus gnats, fruit flies and drain flies apart, then how to stop each one at the source with drier soil, sticky traps, BTi, better kitchen habits and a properly cleaned drain.

Quick answer: First work out where the gnats gather. Around houseplants, let the top of the soil dry out between waterings, catch adults on yellow sticky traps and drench the soil with a BTi product to kill larvae. Around fruit or trash, remove the fermenting source and set a vinegar trap. Around sinks and floor drains, scrub the slime out of the drain, because traps and sprays alone won’t stop flies that keep hatching there.

Which gnat do you have?

Where the flies hang out is the fastest clue. Use this table to match what you’re seeing to the right fix.

TypeWhat it looks likeWhere you see itWhere it breedsMain fix
Fungus gnatDark, delicate, mosquito-like, about 1/16 to 1/8 inch, long antennaeAround houseplants and nearby windowsDamp potting soilDry the soil, BTi, sticky traps
Fruit flyAbout 1/8 inch, red eyes, tan front and dark rearKitchen, fruit bowl, trash and recyclingFermenting produce, spills, drains, mopsRemove the source, vinegar trap
Drain flyAbout 1/10 inch, fuzzy moth-like wingsBathroom and basement walls, sinks, tubsSlime inside drains and little-used toiletsScrub the drain clean

It’s common to have more than one type at once, especially in a kitchen with both houseplants and a slow drain. Work through each source you find.

How to get rid of fungus gnats

Fungus gnats are weak fliers that stay close to potted plants and often show up at the nearest window. According to University of California IPM, a full generation can take about 17 days at 75 degrees F. The larvae live in damp potting soil, feeding on fungi, organic matter and fine root hairs. Adults don’t bite or harm plants, but large numbers of larvae can damage roots of seedlings and young plants.

Check for larvae with a potato slice

Press a chunk of raw potato, cut side down, into the soil surface of each suspect pot. After a few days, lift it and look for tiny, legless, whitish larvae with shiny black heads. Pots with larvae need treatment; pots without them may just be collecting adults from elsewhere.

Let the soil dry out

This is the most important step, because larvae can’t survive in dry soil. Let the top inch or two of potting mix dry before you water again, and empty saucers so pots never sit in water. Watering from the bottom keeps the surface drier, and mixing extra perlite into potting soil improves drainage. Plants that need constant moisture are the exception, so lean more on BTi and traps for those.

Trap adults with yellow sticky cards

Yellow sticky traps catch adults before they lay more eggs. Stick small cards on stakes just above the soil, or lay them flat on the pot rim. Replace them when they fill up, and use the catch count to see whether your other steps are working.

Treat larvae with BTi

BTi (Bacillus thuringiensis subspecies israelensis) is a bacterial product that’s toxic only to the larvae of certain flies, including mosquitoes and fungus gnats. It’s sold as granules and dunks at garden centers, usually marketed for mosquitoes. Mix it with water as the label directs and use it to water your plants. UC IPM notes that BTi doesn’t persist indoors, so repeat applications about every five days may be needed. Regular Bt sold for caterpillars won’t work on gnats.

Other options

  • Replace the top layer of soil: scoop out the top couple of inches and replace it with fresh, pasteurized potting mix.
  • Repot badly infested plants into fresh, bagged potting mix, and store open bags sealed and off the floor.
  • Beneficial nematodes: Steinernema feltiae nematodes are sold by mail order and work well in moist soil, but must be used right away.
  • Insecticides: rarely needed. If you use one, take the plant outside to treat it, follow the label and never fog indoors.

Pro tip: Before you bring patio plants inside for winter, let the soil dry out, check each pot with a potato slice and treat with BTi if you find larvae. It’s far easier to stop fungus gnats at the door than after they spread to every plant in the house.

Yellow sticky trap and a potato slice on houseplant soil used to catch fungus gnats and check for larvae

How to get rid of fruit flies

Fruit flies breed in a thin film of fermenting material, so the fix is finding every source. Check ripe fruit and vegetables, onion and potato bins, trash and recycling cans, empty bottles and cans, mops and rags, and sticky spills under the refrigerator. Refrigerate ripe produce, rinse recyclables, and take out the trash daily until the flies are gone.

Catch the adults with a small jar of cider vinegar topped with a rolled paper funnel. If the flies keep coming after the kitchen is clean, tape a clear plastic bag over the sink drain or disposal overnight; flies inside the bag in the morning mean the drain is the source. Our full guide on how to get rid of fruit flies covers every step in detail.

How to get rid of drain flies

Drain flies, also called moth flies, are fuzzy little flies that rest on walls and make short, hopping flights when disturbed. Their larvae live in the gelatinous slime that builds up inside drains. The University of Kentucky notes that the life cycle takes roughly 10 to 15 days at about 70 degrees F, and that a few flies after a vacation often disappear once you use the drains normally again. Lots of flies over several weeks point to a lasting breeding site.

Find the drain they’re coming from

Coat the inside of a clear plastic cup with a light film of petroleum jelly or vegetable oil, then turn it upside down over a drain and leave it for a few nights. Flies stuck inside show you which drain is breeding them. Check bathroom and kitchen sinks, tub drains, basement floor drains, sink overflows, little-used toilets and the drip pan under the refrigerator.

Clean the drain properly

  1. Put on gloves and eye protection, then remove the drain stopper or strainer.
  2. Scrub inside the drain opening and as far down the pipe as you can reach with a stiff, flexible drain brush.
  3. For sinks, place a bucket underneath, remove the P-trap and clean the slime out of it, then reinstall it.
  4. Scrub the overflow opening, which often hides a slime layer too.
  5. Follow up with a bacterial or enzyme drain product as the label directs to break down remaining buildup.
  6. Run water in little-used sinks, tubs and floor drains weekly, and flush unused toilets.

Pouring hot water down the drain gives only short-term relief, because it doesn’t remove the slime. If the drain is slow as well, our guide to unclogging a drain without chemicals can help. Swat or trap the adults that remain; they stop appearing once the breeding site is gone.

Safety note: Never pour insecticides down a drain to kill drain flies, and never mix drain cleaners, bleach, ammonia or vinegar, which can release toxic gases or cause dangerous reactions. If you’ve already used a chemical drain opener, flush it thoroughly before removing the trap, and wear gloves and eye protection.

Tools and materials

  • Yellow sticky traps and stakes
  • BTi granules or dunks labeled for fungus gnat larvae
  • A raw potato for checking soil
  • Fresh, bagged potting mix and perlite
  • Glass jar, cider vinegar and paper for a fruit fly trap
  • Clear plastic cups and petroleum jelly for drain checks
  • Stiff, flexible drain brush, bucket and adjustable pliers
  • Enzyme or bacterial drain cleaner
  • Rubber gloves and safety glasses

How to keep gnats from coming back

  • Water houseplants only when the top of the soil is dry, and never leave water in saucers.
  • Use fresh, bagged potting mix rather than garden soil or homemade compost for indoor plants.
  • Keep ripe produce in the refrigerator and wipe up juice spills promptly.
  • Rinse bottles and cans before they go into the recycling bin.
  • Clean sink drains and overflows every few months, and run water in unused drains.
  • Wash mops and kitchen rags often and let them dry fully.
  • Check window and door screens for gaps.

When to call a pro

Gnats are almost always a DIY fix, but call a plumber or pest control company if:

  • Drain flies keep appearing after you’ve cleaned every drain, which can point to a broken pipe under a slab or in a crawl space.
  • Flies come from a floor drain that smells of sewage or drains slowly.
  • You can’t find any source despite checking plants, food and drains.
  • Flies are breeding in damp areas inside walls or under floors after a leak.

Bob Vila’s exterminator cost guide puts a one-time general pest control visit at about $100 to $350, with the national average for exterminator services around $176. A plumber’s fee for finding a broken drain line depends on access and inspection method, so get a written quote before work starts.

Frequently asked questions

Why do I suddenly have gnats in my house?

Most sudden outbreaks follow a change: overwatered houseplants, plants brought in from outside, a bag of potting soil, fruit left out on the counter, or a drain that hasn’t been used for a while. Find what changed and you’ve usually found the source.

Are gnats harmful?

Fungus gnats, fruit flies and drain flies don’t bite people. They’re mainly a nuisance, though fruit flies and drain flies can carry bacteria from the material they breed in onto kitchen surfaces.

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

Plan on a few weeks. Because a new generation can develop in under three weeks, keep drying the soil, trapping adults and applying BTi for at least a full cycle after you stop catching gnats.

Do vinegar traps work on all gnats?

Vinegar traps work best on fruit flies. They catch some fungus gnats and drain flies, but they never reach the larvae, so use them alongside drying soil or cleaning drains, not instead of it.

Can gnats come up from the drain?

Yes. Drain flies breed in drain slime, and fruit flies can breed in drains and disposals too. A plastic bag or oiled cup over the drain overnight tells you for sure.

The bottom line

To get rid of gnats, identify the type first, then remove the place it breeds. Dry out houseplant soil and treat it with BTi for fungus gnats, clear out fermenting food for fruit flies, and scrub drains clean for drain flies. Traps help you track progress, but the source is what you have to fix.

About this guide: CozyFixer guides are researched from manufacturer instructions and trusted public sources and reviewed with safety in mind. They are general information, not professional advice. How we create our guides · Disclaimer