Your guide to household and yard pests Urgent? When to call a pro
What bug is this?
Fruit Flies & Gnats

How to Get Rid of Gnats

How to get rid of gnats in your house: find the breeding source, trap adults with vinegar or sticky cards, and kill larvae with Bti. Plus what fails and why.

harmlessdoes not biteleaves once you fix the cause updated October 11, 2026
Glass jar trap with vinegar, sugar and dish soap on a kitchen counter, with caught fruit flies floating inside
Step 1
identify: fungus gnat, fruit fly, or drain fly
Step 2
remove the breeding source
Step 3
trap adults for 1–2 weeks
Larvae in soil
Bti soil drench or let soil dry
Time to clear
3–7 days (fruit flies), 2–4 weeks (fungus gnats)
Cost
about $0–$20 DIY

To get rid of gnats, find and remove what they breed in (wet potting soil, overripe produce, trash residue, or drain slime), then trap the remaining adults for a week or two. Sprays alone do not work, because larvae keep hatching from the source after every spray.

The catch is that "gnats" are three different insects, and each one needs a different fix. Spend two minutes identifying yours before buying anything.

Step 1: Figure out which gnat you have

  • Black, slender, around houseplants and windows → fungus gnats. Go to the houseplant plan below.
  • Tan with red eyes, around fruit, trash, sink → fruit flies. See the kitchen plan, or the full fruit fly guide.
  • Gray, fuzzy, moth-shaped, on bathroom walls → drain flies. See the drain plan, or how to get rid of drain flies.

Not sure? Put out a vinegar trap and a yellow sticky card side by side for a day. Fruit flies end up in the vinegar, fungus gnats on the card. More detail is on the main gnats page.

Houseplant gnats (fungus gnats)

Fungus gnat larvae live in the top inch or two of soil that stays wet. Kill the larvae and the adults disappear within two to three weeks.

  1. Let the soil dry. Do not water until the top inch or two is dry to the touch (deeper for large pots). Most houseplants tolerate this easily; the larvae do not. Empty saucers and cachepots.
  2. Put yellow sticky cards in every affected pot. They catch adults before they lay eggs and tell you whether numbers are dropping. Replace when covered.
  3. Drench the soil with Bti. Products containing Bacillus thuringiensis subsp. israelensis (sold as mosquito bits or as a liquid labeled for fungus gnats) kill larvae in the soil. Soak bits in your watering can for 30 minutes, water as usual, and repeat weekly for 3 to 4 weeks. It is a biological larvicide with very low risk to people, pets, and plants.
  4. Top-dress with sand or fine gravel (about 1/2 inch) so the surface dries fast and females cannot lay eggs.
  5. Repot badly infested plants in fresh mix, and bottom-water afterward.

Systemic insecticides for houseplants (such as imidacloprid granules) also kill larvae, but Bti plus drying is enough for nearly every home and is the gentler choice around kids and pets.

Yellow sticky card in a houseplant pot with black fungus gnats stuck to it, sand on the soil surface
Sticky cards catch adults; a dry soil surface stops new eggs.

Kitchen gnats (fruit flies)

  1. Remove every food source. Put ripe fruit in the fridge, toss anything soft, check potato and onion bins, wipe the inside of the trash can lid, rinse recycling.
  2. Clean the sink drain and garbage disposal with a brush and dish soap; fruit flies breed there too.
  3. Set two or three vinegar traps. A small jar, 1/2 inch of apple cider vinegar, a teaspoon of sugar, one drop of dish soap. The soap breaks the surface tension so flies sink. Too much soap masks the smell; one drop is enough. Covering the jar with plastic wrap and poking a few holes helps, as users on cooking forums report.
  4. Keep a trap out for two weeks after the last fly to catch late hatchers.

Bathroom gnats (drain flies)

Boiling water or bleach poured down the drain rarely works because the slime coats the pipe walls. Instead:

  1. Tape a strip of clear tape over the drain overnight. Flies stuck to it confirm the drain is the source.
  2. Remove the stopper and scrub as deep as you can with a long, stiff pipe brush. Clean the P-trap under the sink if you can take it off.
  3. Pour an enzyme or bacterial drain gel down the drain at night for a week.
  4. Run water in rarely used drains (guest shower, basement floor drain) weekly.

What kills gnats, and what does not

WorksWhy
Removing the sourcestops new generations
Vinegar + dish soap trapfruit flies only
Yellow sticky cardsfungus gnats, monitors progress
Bti soil drenchkills fungus gnat larvae
Brushing out drainsremoves drain fly larvae
Does not work wellWhy
Foggers and room sprayslarvae survive; adults return in days
Bleach or boiling water down drainsslips past slime on the pipe walls
Cinnamon or matches stuck in soilno reliable evidence
Bug zappers indoorsgnats are not strongly drawn to UV
Vinegar traps for fungus gnatsthey are not attracted to vinegar

How to get rid of gnats outside

Outdoor gnats come from damp soil, compost, mulch, and standing water. Cut back on irrigation, turn compost, clear clogged gutters, and empty buckets and saucers. A box fan on the porch keeps weak fliers away from people. Biting black flies breed in streams miles away; repellent clothing and a hat help more than spraying the yard. See gnat bites.

When to call a professional

If gnats persist after three to four weeks of real source control, the breeding site is probably hidden: a broken drain under the floor, a leak in a wall, or rotting debris in a crawl space. A pest professional or plumber can find it. Expect roughly $150 to $300 for an inspection and treatment (approximate, varies by region).

FAQ

What kills gnats instantly?
A household flying-insect spray or a quick swat kills the adults you see, but more emerge from the source within a day or two. For a lasting result, combine traps with removing what they breed in.
What is a good home remedy for gnats?
For fruit flies, a jar of apple cider vinegar with a drop of dish soap. For fungus gnats, let the soil dry out and use yellow sticky cards. For drain flies, scrub the drain with a pipe brush. Each remedy only works on its own gnat.
How do I get rid of gnats in the house quickly?
Within an hour: throw out soft produce, take out the trash, set two or three vinegar traps, and put sticky cards in plant pots. You will see most adults gone in 2 to 4 days if you also removed the source.
How do I catch gnats?
Fruit flies go for a vinegar or wine trap; fungus gnats stick to yellow sticky cards; drain flies are caught by clear tape laid sticky side down over the drain overnight. Place traps where you see the most gnats.
How do I get rid of gnats outside?
Outdoor gnats are hard to control. Remove standing water and soggy mulch, avoid overwatering lawns and beds, and use fans on patios since gnats are weak fliers. For biting black flies, wear long sleeves and a hat; area spraying rarely helps.

Sources and real-world experience

This article draws on real stories from forums and reviews, not generic advice. We quote what worked and what didn't.

  1. Colorado State University Extension: Fungus Gnats as Houseplant and Indoor Pests
  2. Washington State University Pestsense: Fungus gnats
  3. University of Kentucky Entomology: Fruit Flies
  4. Washington State University Pestsense: Moth flies (drain flies)
  5. Hungry Onion forum: Fruit flies galore (reader trap experiences)
Nothing working? When it is time to call an exterminator