How to Get Rid of Gnats in the House: First, Figure Out Which “Gnat” You Have


Short answer: find where the tiny flies are breeding and take that away. Swatting the adults barely helps, because a new batch is always growing somewhere. Indoors, “gnats” are usually one of three insects. Fungus gnats breed in damp houseplant soil, so let the soil dry out and use yellow sticky traps. Fruit flies breed in overripe produce and drink residue, so remove the source and set a vinegar trap. Drain flies breed in the gunk inside drains, so scrub the pipe walls. Pick the wrong fix and you can spend weeks on it while the flies keep coming.

Step 1: Identify your gnat (60-second guide)

Watch where the flies gather for a minute, and you’ll usually know.

Clue Fungus gnat Fruit fly Drain fly (moth fly)
Where you see them Around houseplants, walking on the soil, near windows Around the fruit bowl, trash, recycling, wine or beer bottles On bathroom or kitchen walls near sinks, tubs and showers
Look Dark, delicate, long legs and antennae, like a tiny mosquito Tan body, often red eyes, compact Fuzzy, moth-like wings held like a roof
How they fly Weak, short hops; often run across soil Hover and circle food Short, jerky hops; often just sit on walls
Where they breed Top inches of moist potting soil Fermenting fruit, juice and beer residue The slimy film inside drains and pipes
Does a vinegar trap work? No Yes Not reliably

The vinegar row matters. University of Wisconsin–Madison Extension notes that vinegar traps used for fruit flies do not work for monitoring fungus gnats. That’s one of the most common reasons people say “nothing works.”

If they’re fungus gnats (houseplants)

Fungus gnats are the most common “gnats in the house,” especially in fall and winter when plants come indoors and get watered on a schedule. Adults are about 1/8 inch long, according to Colorado State University Extension. The adults are mostly a nuisance. The larvae live in the soil and feed on fungi, organic matter and sometimes roots.

Why they keep coming back: a female can lay up to 200 eggs in moist soil, and at room temperature (65–75°F) the life cycle from egg to adult takes about three to four weeks, per Colorado State. Generations overlap, so eggs, larvae and adults are all present at once.

What to do:

  1. Let the soil dry out. This is the main fix. Virginia Cooperative Extension advises letting the top 0.5 inch (13 mm) of soil dry before watering again. Larvae in that layer die without moisture, and females stop finding a good place to lay eggs.
  2. Empty saucers. Standing water under pots keeps soil wet from below.
  3. Put up yellow sticky traps near the plants to catch adults. Washington State University says light infestations may be controlled with sticky traps alone.
  4. Check the soil with a potato slice. Colorado State suggests pushing 1/4-inch slices of raw potato into the soil. Larvae move to the potato within a few days. Flip it over to see whether they’re there.
  5. Repot badly infested plants in fresh, well-draining potting mix, as WSU suggests, and throw the old soil out.
  6. If you still have larvae, look for products made with Bacillus thuringiensis subsp. israelensis (Bti), a soil drench aimed at gnat larvae. Colorado State also lists beneficial nematodes applied as a drench. Follow the label, and skip chemical treatments on edible herbs grown indoors.

Most infestations clear up within a few weeks once the soil stays drier, because the existing adults die off and no new larvae replace them.

If they’re fruit flies (kitchen)

Fruit flies, also called vinegar flies, are tiny, about 2–2.5 mm, according to Colorado State’s guide to flies in the home. They breed in fermenting material: overripe fruit, and residue in the bottom of unwashed beer, wine, soda and juice containers.

What to do:

  1. Remove the breeding sites. Eat, toss or refrigerate ripe fruit. Rinse bottles and cans before they go into recycling. Take out trash and compost often.
  2. Refrigerate produce for a week. Colorado State recommends covering or refrigerating susceptible fruit for at least a week, until the remaining adults die out.
  3. Set a vinegar trap to catch the adults already flying: a jar with a little cider vinegar (or a splash of wine) and a paper cone on top, narrow end down. Flies get in and can’t find their way out.
  4. Look for hidden sources: a forgotten potato or onion in the pantry, a sticky spill under the fridge, a recycling bin that’s never rinsed.

If they’re drain flies (bathroom or kitchen sink)

Moth flies, also called drain flies or filter flies, breed in the bacterial film that coats the inside of drains. Humpbacked (phorid) flies can breed in food waste stuck in drains, too. Colorado State is blunt about the usual quick fix: pouring lye-type drain cleaners or hot water down the drain does a poor job of removing this material and kills few, if any, of the flies developing in plumbing.

What to do:

  1. Scrub the inside of the drain. Remove the stopper and use a long, stiff pipe brush to scrape the walls as far as you can reach.
  2. Use a cleaner made to remove organic buildup (enzyme or gel drain cleaners), following the label.
  3. Find the right drain. Tape a clear plastic cup upside down over each drain overnight. If flies are trapped inside in the morning, that’s your source.
  4. Fix leaks. Colorado State notes drain flies can also breed where plumbing drips or condensation keeps hidden areas wet.

Why “gnats” keep coming back

Mistake Why it fails
Only trapping adults The next generation is still growing in the soil, fruit or drain
Vinegar traps for fungus gnats Fungus gnats aren’t attracted the way fruit flies are
Pouring boiling water or bleach down drains It doesn’t remove the gel film where drain-fly larvae live
Watering plants on a fixed schedule Soil never dries, so larvae keep developing
Bringing outdoor plants in untreated Wisconsin Extension notes fall infestations often start with plants that spent summer outside

FAQ

What attracts gnats to my house?
Moisture and decaying organic matter. Damp potting soil, ripening fruit, drink residue, garbage and slimy drains all give tiny flies a place to lay eggs.

Do gnats bite?
The fungus gnats, fruit flies and drain flies found indoors don’t bite people. They’re a nuisance, though fungus gnat larvae can damage plant roots when there are a lot of them.

How long does it take to get rid of fungus gnats?
Expect a few weeks. The life cycle runs about three to four weeks at room temperature, so you need to keep the soil drier for at least one full cycle.

Does cinnamon or hydrogen peroxide kill fungus gnats?
Both are popular home remedies, but none of the extension sources we reviewed recommends them. Drying the soil, sticky traps and Bti products are the methods they do recommend.

Why do I have gnats in my bathroom with no plants?
They’re probably drain flies breeding in the sink, tub or shower drain. Use the cup test above to find which drain, then scrub it.

Sources

  1. Colorado State University Extension, “Fungus Gnats as Houseplant and Indoor Pests” (life cycle, potato test, biological control).
  2. University of Wisconsin–Madison Extension, “Fungus Gnats on Houseplants” (sticky traps; vinegar traps don’t work).
  3. Virginia Cooperative Extension, “Fungus Gnats,” ENTO-442 (dry top 0.5 inch of soil).
  4. Washington State University PestSense, “Fungus gnats” (sticky traps, repotting).
  5. Colorado State University Extension, “Flies in the Home” (fruit flies, moth flies, humpbacked flies; drain cleaning).