How to Get Rid of Gnats in the House (Plants, Drains & Kitchen)

As an Amazon Associate I earn from qualifying purchases. Our picks are based on specs, expert guidance and verified owner reviews. Learn more.

How to Get Rid of Gnats in the House (Plants, Drains & Kitchen)

Quick answer: To get rid of gnats in the house, first figure out which kind you have, then remove where they breed. Fungus gnats live in wet houseplant soil (let the top 1 to 2 inches dry out and use yellow sticky cards), fruit flies breed in ripe produce and trash (toss it and set a vinegar trap), and drain flies breed in the slime inside drains (scrub the drain, don’t just pour bleach). Traps catch adults, but only fixing the source ends the problem.

If you’re wondering how to get rid of gnats in house plants, the kitchen or the bathroom, you’re not alone. “Gnats” is a catch-all word for several tiny flies, and each one has a different weak spot.

Spraying the air does very little. Once you know which fly you’re dealing with, most people can clear them in one to three weeks with simple steps and a trap or two.

What causes gnats in the house?

Gnats show up because something in your home gives them a moist, food-rich place to lay eggs. Adults live only a week or two, but each female can lay dozens to hundreds of eggs, so a small source keeps the cycle running. The three usual suspects are below.

TypeWhat it looks likeWhere you see itWhere it breeds
Fungus gnatDark gray or black, long legs, weak flier, looks like a tiny mosquitoAround houseplants and windowsTop 1–2 inches of damp potting soil
Fruit flyTan body, often red eyes, rounder shapeKitchen, fruit bowl, trash, recyclingRipe or rotting fruit, spills, drains, empty bottles
Drain fly (moth fly)Fuzzy, gray, heart-shaped wings held like a roofBathroom and kitchen sinks, tubs, shower wallsSlimy film (biofilm) inside drains and overflows

Quick test: tape a clear plastic cup upside down or put a strip of clear tape over a drain overnight (leave a small gap for air). Flies stuck on it in the morning mean the drain is the source. For soil, lay a slice of raw potato on the surface for a couple of days; fungus gnat larvae (tiny clear worms with black heads) will gather under it.

How to get rid of gnats in house: match the fix to the fly

Every gnat fix below follows the same order: stop the breeding spot, then trap the adults. Jump to the section for the type you found.

Fungus gnats in houseplants

Fungus gnats are the most common gnats in the house in fall and winter, when plants come indoors and dry out more slowly. University extension experts agree the number one cause is overwatering.

  1. Let the soil dry out. Wait until the top 1 to 2 inches of soil is dry before watering again. The larvae need constant moisture, so this alone breaks the cycle for many plants.
  2. Empty saucers and cachepots. Standing water under the pot keeps the soil wet. Pour it out 15 to 30 minutes after watering.
  3. Hang yellow sticky cards. Stick them in the soil or hang them just above the plant. Fungus gnats are strongly attracted to yellow. The cards catch adults so they can’t lay more eggs, and they show you whether the problem is shrinking.
  4. Treat the soil with Bti. Products containing Bacillus thuringiensis israelensis (Bti), sold as mosquito bits or dunks (the same product used to control mosquitoes in the yard), can be soaked in water and used to water plants. Bti targets fly larvae and is considered low risk to people and pets when used as labeled.
  5. Repot badly infested plants. If a plant is soaked and full of larvae, repot it in fresh, bagged potting mix and a pot with drainage holes. Throw the old soil away outside.
  6. Keep it up for three to four weeks. The fungus gnat life cycle is about three to four weeks, so give your routine a full cycle before judging results.

Even low-risk products like Bti are pesticides: read and follow the label, store them out of reach of children and pets, and don’t let pets chew treated plants or granules. If you use a hydrogen peroxide soil drench (a common tip), use only store-bought 3% peroxide diluted about 1 part to 4 parts water, wear gloves and test on one plant first.

Fruit flies in the kitchen

Fruit flies are drawn to fermenting sugar. The fix is to remove every breeding spot, then trap the adults that are left.

  1. Hunt down the source. Check the fruit bowl, potatoes and onions in the pantry, the trash can, recycling bin, compost pail, under the fridge and behind the stove. One forgotten potato can produce a huge number of flies.
  2. Clean up. Take out the trash, rinse bottles and cans before recycling, and wipe spills and sticky spots.
  3. Make an apple cider vinegar trap. Pour a half inch of apple cider vinegar into a jar, add a drop of dish soap to break the surface tension, and cover with plastic wrap poked with a few small holes. Place it where you see the most flies and refresh it every few days.
  4. Store produce in the fridge. Keep ripe fruit refrigerated until the flies are gone.

For a deeper walkthrough, including why flies keep coming back from drains and garbage disposals, see our full guide on how to get rid of fruit flies.

Drain flies in sinks and tubs

Drain flies breed in the gunk that coats the inside of drain pipes. Pouring bleach or boiling water down usually just rinses past it, which is why the flies return.

  1. Remove the stopper and look. Pull out pop-up stoppers and hair catchers and clean them. They’re often coated in slime.
  2. Scrub the pipe. Use a stiff, long drain brush or a pipe brush to scrub the inside of the drain as far down as you can reach, including the sink overflow hole.
  3. Use an enzyme or bacterial drain gel. These products digest the organic film. Apply at night when the drain won’t be used, and repeat for a week.
  4. Check the forgotten drains. Unused guest bathrooms, floor drains and tub overflows dry out or grow film. Run water in them weekly.

Wear gloves and eye protection when using drain cleaners. Never mix bleach with ammonia, vinegar or other drain products, which can release toxic gases, and never follow one chemical drain cleaner with another. Ventilate the room and keep kids and pets away.

If flies keep coming from a floor drain, a damp, musty basement or a spot with no drain at all, you may have a broken pipe or a moisture problem under the floor. That’s a job for a plumber.

The equipment that helps

Traps catch adults and show you whether your fixes are working. They don’t stop breeding by themselves, so use them alongside the steps above.

Best all-around indoor trap

Zevo Plug-In Flying Insect Trap

Best for: catching adult fruit flies, fungus gnats and other small flyers in the kitchen or near plants, without spray.

Why we picked it

  • Uses blue and UV light to lure flies onto a hidden sticky pad
  • No insecticide or odor
  • Plugs into an outlet near the problem area

Keep in mind

  • Refill cartridges are an ongoing cost
  • Works best in a darker room at night; less effective in bright rooms

Check price on Amazon

Best for fruit flies

Safer Home Plug-In Fruit Fly Trap

Best for: kitchens and fruit bowls where fruit flies are the main problem.

Why we picked it

  • UV LED light and glue card designed for small flies
  • Low profile, easy to place on a counter outlet
  • Chemical-free

Keep in mind

  • Needs a source cleanup to work well
  • Glue cards must be replaced when full

Check price on Amazon

Honest note: light traps get strong owner ratings overall, but they catch adults only. If the soil stays wet or the drain stays slimy, new gnats will keep hatching. For plant pots, cheap yellow sticky cards often outperform any plug-in trap.

How to keep gnats from coming back

  • Water plants only when the top inch or two is dry, and use pots with drainage holes.
  • Use fresh, bagged potting mix and store open bags sealed.
  • Keep ripe fruit in the fridge in late summer and fall.
  • Empty the trash and compost pail often, and rinse recycling.
  • Clean sink stoppers and brush drains once a month.
  • Fix leaks and keep indoor humidity in check. High humidity helps gnats and mold alike; our guide on reducing humidity in the house can help.

Gnats are one of the easier pests to beat once you find the source. For bigger pest problems around the home, start with our complete guide on how to get rid of mice, which also links to all our pest guides.

When to call a professional

Call a plumber if flies keep coming from a drain after a week of scrubbing, from a floor drain or from under the floor, since a broken or leaking pipe can be feeding them. Call a licensed pest control pro if you can’t find the source after two to three weeks, if flies appear in several rooms at once, or if you see lots of flies near walls or ceilings, which can point to a hidden moisture problem, a dead animal or mold. If you spot mold, see our guide on how to get rid of mold.

Frequently asked questions

Why do I suddenly have gnats in my house?

A sudden gnat problem usually means something new is feeding them: a plant you just brought inside or overwatered, fruit left out, a trash can that wasn’t emptied, or a drain that hasn’t been used in a while. Gnat populations grow fast, so a small source can turn into a cloud of flies within a couple of weeks. Find and remove the source first.

Does apple cider vinegar get rid of gnats?

An apple cider vinegar trap works well for fruit flies and catches some other gnats, but it won’t fix fungus gnats in potting soil or drain flies in pipes. Add a drop of dish soap so flies sink instead of landing and leaving. Use it as one part of the plan, alongside removing the breeding source.

How long does it take to get rid of gnats?

Fruit flies often drop off within a week once the food source is gone. Fungus gnats take about three to four weeks, because eggs and larvae already in the soil need to finish their life cycle. Drain flies usually clear in one to two weeks after the pipe is scrubbed and treated. Keep traps up until you see no new catches for a week.

Are gnats harmful?

Most household gnats are a nuisance rather than a health threat. They don’t bite. Fungus gnat larvae can damage the roots of seedlings and young plants, and fruit flies can carry bacteria from trash to food. If you’re seeing large numbers, clean up the source quickly and keep food covered.

Do gnats come from drains?

Some do. Drain flies and sometimes fruit flies breed in the organic film that coats sink, tub and floor drains. Tape a clear cup or a strip of clear tape over the drain overnight to check. If you catch flies, scrub the pipe with a drain brush and use an enzyme drain gel for a week.

Next up: if the tiny flies are mostly in your kitchen, our guide on how to get rid of fruit flies goes step by step.