
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
Updated October 15, 2026. We added safety guidance: for each product, how dangerous it is for cats, dogs, kids, pregnancy, fish and birds, how to protect your household, and what to do if someone is exposed.
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 one to three weeks. 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.
- Small, humpbacked, running in short bursts → phorid flies, usually from a hidden moisture or sewage source; see "When to call a professional."
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. UC IPM also suggests pushing a few raw potato slices, cut side down, into the soil of suspect pots: after a few days, fungus gnat larvae (clear worms with shiny black heads) gather underneath. More detail is on the main gnats page.
Houseplant gnats (fungus gnats)
Fungus gnat larvae live in the top 2 to 3 inches of soil that stays wet, and a full generation takes about 17 days at 75 °F (UC IPM). No single method hits both larvae and adults, so use several together.
- Let the soil dry. Colorado State University calls this the main strategy: let the top 1 to 2 inches dry between waterings. Most houseplants tolerate it easily; the eggs and larvae do not. Empty saucers and cachepots. Bottom watering keeps the surface drier.
- Put yellow sticky cards in every affected pot. They catch egg-laying adults and show you whether numbers are dropping. They do nothing for larvae, so they are a tool, not a cure.
- Drench the soil with Bti. Products with Bacillus thuringiensis subsp. israelensis (Mosquito Bits, Mosquito Dunks, Gnatrol) kill fly larvae and nothing else. Soak bits in your watering can (houseplant growers commonly use about 2 tablespoons per gallon of lukewarm water for 30 minutes), then water from the top so it reaches the larvae near the surface. UC IPM notes Bti does not persist indoors, so repeat about every 5 days for 3 to 4 weeks, and treat every plant at once. Bt sold for caterpillars does not work on gnats.
- Or use beneficial nematodes. Steinernema feltiae, sold as a powder you mix into water, kill larvae within 3 to 4 days according to Colorado State and can keep working for weeks. They are alive and perishable, need moist soil and 60–90 °F, and must be used right away.
- 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, pasteurized mix. Old, broken-down soil holds more water and attracts more gnats.

Systemic insecticides for houseplants (such as imidacloprid granules) also kill larvae, but Colorado State notes that since July 2024 many neonicotinoid products there are restricted-use, and UC IPM says insecticides are rarely warranted in homes. Bti, nematodes, and drier soil handle nearly every home infestation. Neem oil sprayed on leaves does little, because the larvae are in the soil, not on the plant.
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, including the underside of the rubber splash guard; 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. Too much soap masks the smell; one drop is enough. Cover with plastic wrap and poke a few holes, or roll a paper funnel into the mouth.
- Keep a trap out for two weeks after the last fly to catch late hatchers.
Bathroom gnats (drain flies)
Bleach or a single kettle of boiling water 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. Test the sink overflow and any unused drains too.
- 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 a biological or enzyme drain gel down the drain at night for a week or more; Washington State University recommends these over insecticides.
- Run water in rarely used drains (guest shower, basement floor drain) weekly so traps do not dry out.
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, every ~5 days | kills fungus gnat larvae |
| Beneficial nematodes | kill fungus gnat larvae, keep working for weeks |
| Brushing out drains + enzyme gel | removes drain fly larvae |
| Does not work well | Why |
|---|---|
| Foggers and room sprays | larvae survive; adults return in days (UC IPM advises against indoor fogging) |
| Bleach or boiling water alone down drains | slips past slime on the pipe walls |
| Neem or soap sprays on leaves | larvae live in the soil |
| Cinnamon or matches stuck in soil | no reliable evidence |
| Bug zappers indoors | gnats are not strongly drawn to them |
| Vinegar traps for fungus gnats | they are not attracted to vinegar |
How dangerous are these products
Most of the gnat plan is close to harmless: Bti and nematodes only affect fly larvae and soil insects. The real risks are the extras people reach for: imidacloprid granules in houseplant soil (a problem for bees and for pets that chew plants), foggers, and bleach down drains. Sticky cards are a hazard only for small animals that can get stuck.
Comparison table
































Notes
- Bti and nematodes are the safest pest products in the house. No waiting time, fine around kids, pets and aquariums.
- Imidacloprid granules: the insecticide moves into the whole plant, including flowers and leaves. Keep treated pots away from cats that nibble plants and never set them outside where bees visit. Check the label for current restrictions in your state.
- Bleach: only in a ventilated room, and never with vinegar traps or ammonia cleaners nearby; the mix releases toxic gas.
- Foggers don't fix gnats anyway. If one is used, everyone leaves with pets, tanks are covered and the air pump turned off, and pilot lights are out.
If something goes wrong
- On skin or in eyes. Wash skin with soap and water; rinse eyes with running water for 15 minutes.
- Swallowed (granules, peroxide, bleach). Don't induce vomiting. Call Poison Control at 1-800-222-1222.
- A pet ate treated soil or plant, or got stuck on a card. For a stuck animal, loosen glue with vegetable oil, not by pulling. For poisoning, call your vet or ASPCA Animal Poison Control at (888) 426-4435. See pet-safe pest control.
What people who dealt with it say
The r/houseplants community fights fungus gnats constantly, and its biggest threads agree on a lot:
- Nematodes are the most upvoted answer, again and again, especially for edible herbs. People who had tried everything else for months reported them working within days to a couple of weeks.
- Bti works if used right. Growers who failed with mosquito bits often sprinkled them on top or watered from the bottom; those who succeeded soaked the bits, watered from the top, treated every plant on the same day, and kept going for 6 to 8 weeks. One grower with hundreds of plants says a quarter of a mosquito dunk soaked in water treats the whole collection for about a month.
- A sand layer is a cheap win. Several people put about 2 cm of fine sand on top of the soil and said the gnats died out because adults could not lay eggs or emerge.
- Hydrogen peroxide and diatomaceous earth have fans, but results are mixed; one person found peroxide damaged new leaves. These are not extension-recommended methods, so test on one plant first.
- Carnivorous plants help at the edges. Sundews and butterworts catch a lot of adults but do not fix the soil.
- Check beyond the pots. When plants were already treated, the source turned out to be drains, a forgotten bag of potatoes, or gnats breeding in the dirt of window tracks.
- It takes weeks. People who stuck to drier soil plus Bti or nematodes plus sticky cards usually reported success in 2 to 6 weeks; those who rotated through one method at a time struggled for months.
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 that can be miles away; Iowa State University says controlling them is not practical and advises against fogging. Repellent, light 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 leaking toilet seal, a leak in a wall, the drip pan under the fridge, or rotting debris in a crawl space. A plumber or pest professional can find it. Renters should ask the landlord for a plumbing inspection rather than another spray. 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?
Do mosquito bits work on fungus gnats?
How do I get rid of gnats in the kitchen?
How do I get rid of gnats outside?
Sources and real-world experience
Built from the expert sources and real discussions below — we read each one. How we research.
- UC IPM: Fungus Gnats (Pest Notes)
- Colorado State University Extension: Fungus Gnats as Houseplant and Indoor Pests
- University of Kentucky Entomology: Fruit Flies (ENTFACT-621)
- Washington State University Pestsense: Moth flies (drain flies)
- Iowa State University Yard and Garden: Black Flies Reported, Already
- Reddit r/houseplants: TRUTH: No single fungus gnat control method attacks adults and larvae simultaneously
- Reddit r/houseplants: My Fungus Gnats are Invincible - Please Let Me Know What Worked for You!
- Reddit r/houseplants: I am this close to buying a gun and shooting at the fungus gnats