
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.

- 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.
- 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.
- 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.
- 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.
- Top-dress with sand or fine gravel (about 1/2 inch) so the surface dries fast and females cannot lay eggs.
- 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.

Kitchen gnats (fruit flies)
- 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.
- Clean the sink drain and garbage disposal with a brush and dish soap; fruit flies breed there too.
- 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.
- 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:
- Tape a strip of clear tape over the drain overnight. Flies stuck to it confirm the drain is the source.
- 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.
- Pour an enzyme or bacterial drain gel down the drain at night for a week.
- Run water in rarely used drains (guest shower, basement floor drain) weekly.
What kills gnats, and what does not
| Works | Why |
|---|---|
| Removing the source | stops new generations |
| Vinegar + dish soap trap | fruit flies only |
| Yellow sticky cards | fungus gnats, monitors progress |
| Bti soil drench | kills fungus gnat larvae |
| Brushing out drains | removes drain fly larvae |
| Does not work well | Why |
|---|---|
| Foggers and room sprays | larvae survive; adults return in days |
| Bleach or boiling water down drains | slips past slime on the pipe walls |
| Cinnamon or matches stuck in soil | no reliable evidence |
| Bug zappers indoors | gnats are not strongly drawn to UV |
| Vinegar traps for fungus gnats | they 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?
What is a good home remedy for gnats?
How do I get rid of gnats in the house quickly?
How do I catch gnats?
How do I get rid of gnats outside?
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.
- Colorado State University Extension: Fungus Gnats as Houseplant and Indoor Pests
- Washington State University Pestsense: Fungus gnats
- University of Kentucky Entomology: Fruit Flies
- Washington State University Pestsense: Moth flies (drain flies)
- Hungry Onion forum: Fruit flies galore (reader trap experiences)