To get rid of gnats, first identify which gnat you have, then kill the breeding source rather than chasing the adults. For fungus gnats, let the top inch of potting soil dry out and treat it with a BTI (Bacillus thuringiensis subsp. israelensis) or hydrogen peroxide drench; for fruit flies, remove ripe produce and set…
To get rid of gnats, first identify which gnat you have, then kill the breeding source rather than chasing the adults. For fungus gnats, let the top inch of potting soil dry out and treat it with a BTI (Bacillus thuringiensis subsp. israelensis) or hydrogen peroxide drench; for fruit flies, remove ripe produce and set an apple cider vinegar trap; for drain flies, scrub the pipe. Expect a full fix to take roughly two to four weeks because you have to outlast the insect’s egg-to-adult life cycle.
What are gnats, and why identifying the type matters first
“Gnat” is a catch-all word, not a species. The three tiny flying insects people call gnats indoors are usually fungus gnats, fruit flies, or drain flies, and they breed in completely different places. This is the single most important thing to understand, because a trap that wipes out fruit flies will do almost nothing for fungus gnats living in your houseplant soil. Treating the wrong source is the number-one reason people say “I tried everything and the gnats came back.”
Spend sixty seconds identifying the culprit before you buy or mix anything. Watch where the insects congregate and rest. If they rise in a little cloud when you water a potted plant, they are fungus gnats. If they hover over the fruit bowl, the compost bin, or a glass of wine, they are fruit flies. If they sit on the bathroom wall near a sink or shower and barely fly, they are drain flies. Get this right and the rest of the plan practically writes itself.
How to tell fungus gnats, fruit flies, and drain flies apart
| Feature | Fungus gnats | Fruit flies | Drain flies |
|---|---|---|---|
| Looks like | A tiny, delicate mosquito with long legs and antennae | A small tan-to-brown fly with a rounded body and bright red eyes | A fuzzy, moth-like fly with a gray, hairy body |
| Where it breeds | Damp potting soil and decaying organic matter | Rotting fruit, spills, fermenting liquids, recycling bins | Slime and gunk inside drain pipes |
| Where you see it | Around plant pots, crawling on soil | Kitchen counters, fruit bowls, trash | Bathroom and kitchen walls near drains |
| Flying style | Weak, erratic, drifts upward when soil is disturbed | Quick and hovering | Short, clumsy hops; rarely flies far |
| What actually fixes it | Dry the soil, larvicide drench, sticky traps | Remove food source, vinegar trap, clean surfaces | Physically scrub the drain |
A quick shortcut from pest-control technicians: check the eyes and body. Fruit flies have noticeable red eyes and a round body; fungus gnats are skinnier and more mosquito-like. None of these three bites humans, so if something is actually biting you outdoors, you are likely dealing with biting midges (“no-see-ums”) or black flies, which are a different problem covered near the end of this guide.
What causes gnats in the house?
Gnats are a symptom of excess moisture and decaying organic material. They do not appear randomly; something in your home is giving them a damp, food-rich place to lay eggs. Pinpoint that and you have found your target.
- Overwatered houseplants. This is the leading cause of fungus gnats. Constantly wet potting mix is a perfect nursery for their larvae, which feed on fungi and organic debris in the top layer of soil. Pots that never dry out, or that sit in a saucer of standing water, are the usual offenders.
- Ripe or rotting produce. Fruit flies are drawn to the acetic acid and ethanol given off by fermenting sugars. A single overripe banana, a forgotten potato, or a splash of juice behind the trash can is enough to start a population.
- Drain and pipe buildup. The organic film that coats the inside of a seldom-used drain is exactly where drain flies breed. A guest bathroom sink or a basement floor drain is a classic hotspot.
- Damp organic matter you forgot about. Think recycling bins with sticky residue, a wet mop left in a bucket, soggy bags of onions, or the moist bottom of a kitchen compost pail.
Those tiny flying gnats in the house are almost always tied to one of these four moisture sources. New potting soil is a frequent surprise culprit, too, because bagged mix often arrives already carrying fungus gnat eggs or larvae that hatch once the bag warms up at home.
How do I get rid of gnats? A step-by-step plan
Here is a sequence that works for the most common indoor case, fungus gnats from houseplants, and adapts easily to fruit flies and drain flies. Work through it in order; skipping the source-removal step is why quick fixes fail.
- Confirm the gnat type using the table above. Do not proceed until you know whether you are fighting a soil problem, a food problem, or a drain problem.
- Stop watering and let the soil dry. Allow the top one to two inches (about 3 to 5 cm) of potting soil to dry out completely between waterings. Fungus gnat larvae and eggs cannot survive in dry soil, so this one change quietly kills the next generation. Empty any water sitting in the saucer underneath.
- Hang yellow sticky traps flat or low, right at the soil surface. The color attracts adult fungus gnats, and the traps give you a live count of how bad the infestation is and whether it is shrinking.
- Treat the soil with a larvicide. Use a BTI product (sold as Mosquito Bits or in mosquito dunks) or a diluted hydrogen peroxide drench, both detailed in the sections below. This targets the larvae living in the soil, which traps alone never reach.
- Repeat weekly for three to four weeks. You are deliberately outlasting the life cycle. Eggs that were already laid will keep hatching for a couple of weeks, so one treatment is never enough.
- Remove or isolate the worst plants. If one pot is the epicenter, move it away from the others or, in a severe case, repot it into fresh, sterile mix after rinsing the roots.
- Verify and prevent. When sticky traps stop catching adults for several days, you have won. Switch to the prevention habits at the end of this guide so it does not recur.
For fruit flies, replace steps 2 and 4: remove and bag all ripe produce, wipe down counters and the inside of bins, then set an apple cider vinegar trap and keep it fresh. For drain flies, the fix is mechanical, which is covered in its own section.
How do I get rid of fungus gnats in houseplants?
Fungus gnats in houseplants are a soil problem, so every effective method comes back to the soil. The adults flying around are a distraction; the larvae in the top layer of potting mix are the real target. Attack on two fronts at once: make the soil inhospitable, and apply a larvicide.
The dry-out method
Letting the top few centimeters of soil dry between waterings is the most reliable free fix and the foundation of everything else. Larvae live in that moist upper layer; when it dries, they die and the adults have nowhere to lay new eggs. Many houseplants tolerate this easily, and it also fixes the overwatering that caused the problem in the first place. Bottom-watering, where you let the pot soak up water from below, keeps the surface drier and discourages egg-laying.
BTI (Mosquito Bits and mosquito dunks)
BTI is a naturally occurring soil bacterium that is lethal to fungus gnat larvae but, according to university extension guidance, safe for plants, pets, and people. It is the most targeted option available to a homeowner. You can sprinkle the granules on the soil surface and water them in, or steep them in your watering can first; soaking times suggested in the field range from about 30 minutes up to overnight, then you water your plants with the strained “mosquito bit tea.” Apply with each watering for several weeks. BTI works slowly and specifically, so pair it with sticky traps to mop up the adults while the larvae die off.
Hydrogen peroxide soil drench
A diluted hydrogen peroxide drench kills larvae on contact and fizzes harmlessly into water and oxygen. Cornell Cooperative Extension suggests mixing one part 3% hydrogen peroxide with four parts water (a 1:4 ratio) and pouring it over the soil, then letting the soil dry out afterward. Other growers use a slightly weaker 1:5 mix. Use only the common 3% household strength; stronger concentrations can damage roots, and that is the main caution attached to this method. You may repeat it weekly for about three weeks. Expect some fizzing at the surface, which is normal.
Sticky traps and a soil barrier
Yellow sticky traps will not end an infestation by themselves, because they only catch adults, but they are excellent as monitors and as a supplement. For extra insurance, some growers top their soil with a half-inch layer of coarse sand, fine gravel, or horticultural grit; the dry, inhospitable surface discourages females from laying eggs.
What kills gnats instantly?
Be realistic here: nothing makes an entire infestation vanish instantly, because the eggs and larvae you cannot see are the real population. That said, a few things kill the gnats in front of you quickly.
- A soapy water spray. A spray bottle with water and a few drops of dish soap kills adult gnats on contact by breaking the surface tension on their bodies. Useful for knocking down a cloud of them, but it does nothing to the larvae.
- An apple cider vinegar trap. This lures and drowns adult fruit flies within hours. Details below.
- A vacuum. Sucking up resting adults off a wall or hovering over a pot is oddly effective for instant relief.
Treat these as symptom control. The “instant” kill buys you comfort while the real work, drying the soil or cleaning the source, does the permanent job over the following weeks.
How to make an apple cider vinegar trap that actually works
This is the go-to for how to get rid of fruit gnats, or more accurately fruit flies, in the kitchen. The vinegar’s acetic acid and ethanol mimic fermenting fruit and draw the flies in; the dish soap breaks the liquid’s surface tension so they sink and drown instead of landing and flying off.
- Pour a small amount of apple cider vinegar into a cup or jar, roughly a quarter cup. Adding a pinch of sugar can boost the lure.
- Add just a drop or two of dish soap. This is the step people get wrong: too much soap can actually keep the trap from working, so resist the urge to overdo it.
- Either leave it open, or cover the jar with plastic wrap and poke a few small holes so flies enter but struggle to leave.
- Place traps near the fruit bowl, trash, and sink. Refresh the bait every couple of days until the catch stops.
Important: this trap targets adult fruit flies. If your problem is fungus gnats rising from plant soil, a vinegar trap on the counter will barely help, because the larvae live in the pots. Put your effort into the soil instead.
How do I get rid of drain gnats (drain flies)?
Drain flies are the exception to the trap-and-bait playbook. Because they breed in the organic slime coating the inside of a pipe, the fix is physical: you have to remove that film. A quick confirmation test is to tape a clear plastic cup upside-down over the drain overnight; if flies are caught under it in the morning, that drain is the source.
- Pour near-boiling water down the drain to loosen debris, then scrub inside the pipe with a long, stiff drain brush to physically scrape off the breeding film.
- Follow with an enzyme-based drain cleaner that digests organic buildup, or a baking-soda-and-vinegar flush followed by hot water. Household bleach pours are sometimes recommended but tend to rinse straight past the clinging film without removing it.
- Keep seldom-used drains flushed. Running water through a guest bathroom weekly prevents the gunk from rebuilding.
What works vs. gnat myths
The internet is full of gnat “hacks,” and some are genuinely useful while others are wishful thinking. Here is an honest sorting.
What genuinely works
- Drying out the soil. The backbone of fungus gnat control, and it is free.
- BTI and 3% hydrogen peroxide drenches. These actually reach and kill larvae, which is where the population lives.
- Removing the food or moisture source. Tossing the rotting produce or scrubbing the drain ends the breeding, full stop.
- Yellow sticky traps. Reliable for catching adults and tracking progress, as long as you treat them as a supplement, not a cure.
- Apple cider vinegar traps. Effective specifically against adult fruit flies.
Myths and overrated fixes
- Cinnamon as a larvicide. Cinnamon has antifungal properties and may slow surface mold, but evidence that it reliably kills gnat larvae is limited and mostly anecdotal. Do not count on it as your main weapon.
- A vinegar trap for fungus gnats. It catches a few adults but ignores the soil-dwelling larvae, so the problem persists. Right tool, wrong pest.
- “One treatment and done.” Because eggs keep hatching for one to two weeks, any single-shot method will seem to fail. Persistence over several weeks is what wins.
- Letting a houseplant stay soaked while you “treat” the gnats. As long as the soil stays wet, you are feeding the next generation faster than you can kill it.
- Dumping strong (9% or higher) hydrogen peroxide on the soil. It can burn roots. Stick to the 3% household product.
How long does it take to get rid of gnats?
Plan on two to four weeks of consistent effort for a typical indoor infestation. The reason is biology, not product weakness. Fungus gnats cycle through egg, larva, pupa, and adult stages; eggs hatch in roughly three to six days, and the whole cycle can run about one to three weeks depending on temperature. Warmth speeds it up, a cool basement slows it down. Even after you kill every larva today, adults will keep emerging from pupae already in the soil for a couple of weeks. That is normal and not a sign of failure. Keep treating and watch the sticky-trap count fall. When traps catch nothing new for several days running, you are done.
A quick gnat-fighting checklist
- Identify the gnat: soil (fungus gnat), food (fruit fly), or drain (drain fly).
- Stop overwatering; let the top inch of soil dry out.
- Empty standing water from plant saucers.
- Hang yellow sticky traps at soil level to monitor adults.
- Apply a BTI or 3% hydrogen peroxide (1:4) soil drench, weekly.
- For fruit flies: remove ripe produce and set an apple cider vinegar trap with one or two drops of soap.
- For drain flies: scrub the pipe physically, then flush with hot water.
- Repeat for three to four weeks to outlast the life cycle.
- Switch to prevention habits once the catch hits zero.
How do I get rid of gnats outside?
Outdoor gnats split into two camps: non-biting swarms (often fungus gnats or midges breeding in damp soil and mulch) and biting gnats such as no-see-ums and black flies. The strategy overlaps but the expectations differ.
- Eliminate standing water. This is the single biggest lever. Empty and refresh birdbaths, unclog gutters, drain old tires and toys, tip over saucers and buckets, and fix low spots that pool after rain. Standing water is where biting midges and many nuisance gnats breed.
- Run a fan on patios and decks. Biting gnats are weak fliers, so a simple oscillating outdoor fan keeps them off you better than almost anything else. Pest-control pros recommend this as a frontline tactic for outdoor seating areas.
- Manage damp organic matter. Keep mulch from staying soggy against the house, turn compost, and let overwatered garden beds dry between waterings, the same principle that works indoors.
- Treat repellents as secondary. Personal repellents help somewhat but are generally less effective against biting gnats than against mosquitoes, so lean on fans and water removal first.
One caveat: if the biting gnats are black flies breeding in a nearby fast-moving stream, you cannot drain their habitat, and the standing-water advice applies less. In that case fans, protective clothing, and timing outdoor activity away from dawn and dusk are your realistic defenses.
How do I prevent gnats from coming back?
Prevention is simply denying gnats the moisture and decaying food they need to breed. Once you have cleared an infestation, these habits keep it from returning.
- Water plants correctly. Let the top inch of soil dry before watering again, and never let pots sit in a full saucer. This alone prevents most fungus gnat problems.
- Quarantine new plants and bagged soil. Bagged potting mix often carries eggs or larvae. Keep new plants separate for a couple of weeks and watch for gnats before mixing them in with the rest.
- Deal with produce promptly. Refrigerate ripe fruit, take out the trash and recycling regularly, and wipe up spills and sticky residue around bins.
- Keep drains clean. Flush seldom-used drains weekly and periodically scrub them so organic film never builds up.
- Control humidity. Fix leaks, run a dehumidifier in damp basements, and dry out wet mops and buckets. Lower ambient moisture makes the whole house less hospitable.
- Keep a couple of sticky traps up. Leaving one or two yellow traps near plants gives you an early warning long before a new population gets established.
Gnats feel overwhelming because the adults are visible while the real problem hides in soil, fruit, or a pipe. Once you identify the type, kill the breeding source, and stay consistent through the insect’s life cycle, they go away and stay away. The methods that last are never the flashy instant kills; they are the unglamorous ones, drier soil, a scrubbed drain, a cleared counter, repeated patiently for a few weeks.
Frequently Asked Questions
What is the fastest way to get rid of gnats?
The fastest relief comes from an apple cider vinegar trap for fruit flies or a soapy water spray that kills adult gnats on contact. However, lasting results take two to four weeks because you must also kill the hidden eggs and larvae. For fungus gnats, that means drying the soil and using a BTI or hydrogen peroxide drench alongside the quick fixes.
What is the difference between fungus gnats, fruit flies, and drain flies?
Fungus gnats are skinny and mosquito-like and breed in damp potting soil. Fruit flies are rounder with bright red eyes and breed in rotting produce. Drain flies are fuzzy and moth-like and breed in the slime inside drain pipes. Each needs a different fix, so identifying the type first is essential.
How do I get rid of fungus gnats in houseplants?
Let the top one to two inches of soil dry out between waterings to kill larvae and stop egg-laying. Then treat the soil with a BTI product like Mosquito Bits or a 1:4 mix of 3% hydrogen peroxide and water, and hang yellow sticky traps for the adults. Repeat weekly for three to four weeks to outlast the life cycle.
What causes gnats in the house?
Gnats are a symptom of excess moisture and decaying organic matter. The main causes are overwatered houseplants, ripe or rotting produce, organic buildup inside drains, and damp items like wet mops or sticky recycling bins. New bagged potting soil can also arrive already carrying fungus gnat eggs.
How long does it take to get rid of gnats?
Plan on two to four weeks of consistent effort. Fungus gnat eggs hatch in about three to six days and the full cycle runs roughly one to three weeks, so adults keep emerging even after you kill the larvae. Keep treating until your sticky traps stop catching new gnats for several days.


