How to Get Rid of Gnats in the House: Find the Source First
Traps catch the adults you can see. The gnats keep coming because the eggs are somewhere else. Here is how to find that somewhere else and shut it down, for each of the four flies people call gnats.
“Gnats” in a house are almost always one of four flies: fungus gnats from overwatered potting soil, fruit flies from produce and sticky residue, drain flies from the film inside a drain, or phorid flies from garbage, drip pans or, in bad cases, a broken sewer line. Vinegar traps and sprays only kill adults; the fix is finding and removing the spot where the larvae live. Identify the fly by where it hangs out, confirm the source with clear tape over suspect drains overnight, then dry the soil, clear the produce and residue, or scrub the drain film. Because a new generation takes one to three weeks to develop, expect stragglers for a couple of weeks after you fix the source. Insecticides are rarely warranted, and bleach down the drain does not remove the film drain flies breed in.
Local help: We do not sell a gnat service, and most gnat problems do not need one. If the tape test points at a drain you cannot reach, or the “gnats” turn out to be winged ants or termite swarmers, text a photo to (626) 409-1584 and we will tell you what you are looking at. Identification from photos is free.
On this page
- How to get rid of gnats: the 5-step method
- Which gnat do you have? The four small flies, side by side
- Gnats in the bathroom, kitchen, bedroom or houseplants: what the location tells you
- Where are the gnats coming from? Find the breeding site first (the tape test)
- How long do gnats live?
- How to get rid of fungus gnats in houseplants
- How to get rid of fruit flies
- How to get rid of drain flies
- How to get rid of phorid flies (and when they mean a plumbing problem)
- How to make a gnat trap (and which gnats it catches)
- How to get rid of gnats outside: eye gnats and patio swarms
- What does not work on gnats
- Do you need an exterminator for gnats?
- Sources
- Quick answers
How to get rid of gnats: the 5-step method
To get rid of gnats, identify which of the four small flies you have, find and remove the spot where it breeds, trap the adults that are left, and recheck after two to three weeks. Skipping straight to traps or sprays is why gnats keep coming back.
- Identify the fly. Where you see it and how it moves tells you which of the four it is: fungus gnats at houseplants and windows, fruit flies at food, drain flies on bathroom walls, phorid flies scuttling near drains and trash.
- Find the breeding site. Press clear tape over suspect drains overnight, push a finger an inch into houseplant soil, and check the produce, trash, recycling and appliance drip pans.
- Remove or dry out the source. Let the top inch or two of potting soil dry, clear the produce and residue, scrub the film out of the drain and overflow, or remove what is decaying. This is the step that ends it.
- Trap the adults while the last generation hatches. Use a vinegar trap for fruit flies and yellow sticky cards for fungus gnats. Traps mop up and measure; they do not end an infestation.
- Wait two to three weeks and recheck. Adults keep emerging from eggs laid before the fix. A clean tape test and an empty sticky card mean you are done.

Which gnat do you have? The four small flies, side by side
Most gnats in a house are one of four small flies, and each breeds somewhere different: fungus gnats in wet potting soil, fruit flies in fermenting food, drain flies in the film inside drains, and phorid flies in decaying matter. Two minutes on the ID makes the rest of this page short.
| Fly | What it looks like | Where you see it | Where it breeds | The fix |
|---|---|---|---|---|
| Fungus gnat | 1/16 to 1/8 inch, dark and thin like a tiny mosquito, antennae longer than its head; a weak flier that runs across the soil | Around potted plants and at windows, since adults are drawn to light | Moist potting mix, compost and mulch; larvae eat fungi, organic matter and root hairs | Let the top inch or two of soil dry, yellow sticky cards, a Bti drench |
| Fruit (vinegar) fly | 1/8 to 1/5 inch, tan to brownish, red eyes in the common species; hovers, then lands | Fruit bowl, sink, trash, recycling, open wine and soda | Overripe produce, residue in bins and drains, a dirty disposal, damp mops | Refrigerate or discard produce, rinse recyclables, clean the disposal |
| Drain (moth) fly | 2 to 3 mm, gray-brown and fuzzy, wings held roof-like; rests on walls and makes short hops | Bathroom and kitchen walls, over sinks and showers, more active at night | The gelatinous film on the walls of drains, overflow pipes and drip pans | Scrub the drain and overflow, clean the trap; bleach does not do it |
| Phorid (humpbacked) fly | Fruit-fly size, dark eyes, humped back; runs in jerky stop-start bursts before it flies | Kitchens, bathrooms, ground floors, near trash and drains | Garbage, disposals, drip pans, old cut flowers, anything decaying, sewage under a slab | Remove the decaying material; many flies on a ground floor can mean a broken sewer line |
Two more get the name outdoors: eye gnats, the shiny black flies that go for your eyes on a patio, and the mosquito-like midges that swarm over lawns at dusk. Neither breeds in your house; they are covered below.
Gnats in the bathroom, kitchen, bedroom or houseplants: what the location tells you
Gnats in a bathroom are usually drain flies, gnats around houseplants or a sunny window are fungus gnats, and gnats at the fruit bowl, trash or recycling are fruit flies. Where you keep seeing them is the fastest clue to where they breed.
| Where you see them | Most likely | Do this first |
|---|---|---|
| Around houseplants, or at a window near plants | Fungus gnats | Push a finger an inch into the soil; if it is wet, let it dry and set a yellow sticky card at the pot |
| Fruit bowl, trash, recycling, counters | Fruit flies | Refrigerate ripe produce, rinse and empty the recycling, check under the fridge for a spill |
| Kitchen sink and garbage disposal | Fruit flies or drain flies | Scrub under the disposal’s splash guard; tape the drain overnight |
| Bathroom walls, shower, sink | Drain flies | Tape each drain overnight; scrub the one that catches flies, including the sink overflow |
| Guest bath, rarely used toilet or floor drain | Drain flies | Scrub the slime film from the bowl, tank or drain, then run water in it weekly |
| Bedroom | Strays from a houseplant, an attached bath, or food and drinks left out | Check the nearest plant, the en-suite drains, and any cups, cans or wastebasket |
| Garage or laundry floor drain | Drain flies or phorid flies | Tape and scrub the floor drain; check appliance drip pans |
| Ground floor of a slab house, many scuttling flies, no source found | Phorid flies | Call a plumber about a possible broken drain or sewer line under the slab |
| Patio, at your eyes and nose | Eye gnats | Use a repellent for now; stop working fresh organic matter into the beds |
| Over the lawn or beds at dusk | Fungus gnats or midges | Shorten the sprinkler run and let the mulch dry out |
Where are the gnats coming from? Find the breeding site first (the tape test)
To find where gnats are coming from, check the four places they breed: drains, potting soil, the kitchen’s produce and trash, and appliance drip pans. The tools are clear tape, a raw potato and a yellow sticky card. Every extension sheet on these flies says the same thing: eliminate the breeding site, and use insecticide, if ever, as a last resort.
- Tape the drains. Press clear tape sticky side down over each suspect drain (sink, shower, tub overflow, floor drain, the garbage disposal, a rarely used guest bath) and leave it overnight. Flies stuck to the tape mean that drain is the nursery. Ohio State and Virginia Tech both use this test; Virginia Tech also suggests an inverted clear cup lined with a thin film of oil or petroleum jelly.
- Check the plants. Push a finger into the soil. If it is wet an inch down, fungus gnats have what they need. Colorado State’s check: press quarter-inch slices of raw potato into the soil and turn them over a few days later to look for larvae underneath.
- Walk the kitchen. Fruit bowl, the bottom of the trash can, the recycling bin, the disposal splash guard, the mop bucket. The University of New Hampshire’s list of forgotten sources is worth reading twice: the rotting onion or potato in the cupboard, spilled juice in the tray under the refrigerator, apple cores in a child’s wastebasket.
- Check the appliances. Condensate drip pans under refrigerators, dishwashers, air conditioners and dehumidifiers are classic drain-fly and phorid-fly sites.
- Hang a yellow sticky card. It shows where the adults are densest, which points at the source, and later it shows the source is gone.
How long do gnats live?
Gnats live short lives and breed fast, which is why the ones you kill are replaced until the source is gone. Adult fungus gnats live about seven to ten days, and a female can lay up to 200 eggs in that time, according to Colorado State University Extension. A female fruit fly can lay up to 2,000.
| Fly | Egg to adult | What that means |
|---|---|---|
| Fungus gnat | About 17 days at 75°F (UC IPM); adults live 7 to 10 days (Colorado State) | Plan on two to three weeks after you dry the soil; Cornell notes a Bti program can take four to five weeks to show |
| Fruit fly | 8 to 15 days depending on temperature (Ohio State), as little as 8 days at 85°F (Penn State) | Clear the source and they fade within one to two weeks |
| Drain fly | About 10 to 15 days at 70°F (Kentucky); a week or two (Virginia Tech) | Expect stragglers for up to two weeks after scrubbing; re-tape the drain to confirm |
| Phorid fly | Continuous for as long as the decaying source lasts | Ends when the source is removed, which may take a plumber |
How to get rid of fungus gnats in houseplants
To get rid of fungus gnats, dry out the top of the potting soil and treat the larvae; the adults are only the symptom. The larvae live in the top inches of wet potting mix and eat fungi, organic matter and root hairs; adults do not damage plants or bite. Colorado State notes fungus gnats are most noticeable in late fall and winter, when plants grow slower, use less water and leave the soil wet longer, and when plants that summered outdoors come back inside carrying them.
- Water less. Let the top one to two inches of soil dry between waterings (Colorado State and Cornell). Bottom-water plants that sulk when dry, empty the saucers, and add perlite or sand to the mix for drainage (UC IPM).
- Set yellow sticky cards. Adults are drawn to yellow and to light. Place cards under the leaves or at the edge of the pot, or cut them into squares on skewers pushed into the soil.
- Top-dress with sand or fine gravel. A layer of coarse sand or fine gravel on the soil surface works as a barrier to egg-laying, according to N.C. State Extension. It supports drier watering; it does not replace it.
- Drench with Bti. Bacillus thuringiensis subsp. israelensis is a bacterial larvicide sold at garden centers as mosquito granules or dunks, and it kills only fly larvae. It does not persist indoors, so UC IPM suggests repeating about every five days. Because it kills larvae and not the adults already flying, Cornell notes the drop can take four to five weeks to show. The caterpillar strain of Bt does not work on fly larvae.
- Or use beneficial nematodes. Steinernema feltiae is the most effective species available; apply to moist soil at 60 to 90°F, and use it promptly after it arrives.
- Hydrogen peroxide, honestly. Cornell Cooperative Extension suggests one part 3 percent hydrogen peroxide to four parts water, poured over the soil, then letting the soil dry. It is not among the controls UC IPM or Colorado State list, and there is little published testing behind it for houseplants, so treat it as a supplement to drier watering, not the fix. Keep it off the leaves.
- Repot or discard. Old potting mix breaks down and holds water, and Colorado State recommends repotting when it has. Use pasteurized mix stored in a closed bag, do not move an infested plant to a new room, and toss plants that are badly infested.
- Insecticide last. UC IPM: “Insecticides are rarely warranted to control these flies in and around homes.” Colorado State reserves them for problems that persist several weeks after watering has been adjusted. Never fog indoors.
How to get rid of fruit flies
To get rid of fruit flies, remove what they breed in; the University of New Hampshire puts it bluntly that trapping is nowhere near as effective as kitchen sanitation. Females lay their eggs on moist, fermenting food: the soft spot on a banana, the residue in a recycling bin, the disposal, a damp mop head, the drain water in a refrigerator drip pan. Penn State adds that fogs and sprays kill adults but leave the larvae, so the source has to go.
- Refrigerate or discard ripe produce; wipe the bowl.
- Rinse every can and bottle before it goes in recycling; take the bin out.
- Scrub under the disposal’s splash guard and run the disposal with plenty of water.
- Wash or replace mop heads and sponges; empty and clean the refrigerator drip pan.
- Set a vinegar trap (below) next to the source to mop up adults and to tell you when they stop coming.
- Fruit flies pass through standard window screen, so Penn State suggests 16-mesh or finer screening where they are coming in from fruit trees or compost outside.
How to get rid of drain flies
To get rid of drain flies, scrub the film off the inside of the drain and the sink overflow with a stiff brush; that film, not the water, is where they breed. Virginia Tech calls scrubbing the drain opening and removing all the slime and sludge the most effective cleaning method. Pull and clean the trap under a badly clogged sink, and snake a shower drain that holds hair.
- Hot water kills larvae on the surface only; it is short-term control. The larvae can trap air bubbles and survive under water for a day or more, so flooding the drain does not drown them.
- Bleach and vinegar are not very effective and will not penetrate the material to kill all the larvae; wrong dilutions can also damage pipes. Never mix bleach with ammonia.
- Insecticide down the drain is a no, from every source: it does not reach the film and it ends up in the sewer.
- Rarely used fixtures are the usual culprit: a guest bath, a floor drain in the garage, the slime film in a toilet bowl or tank nobody flushes. Run water in them weekly.
- Drip pans under the refrigerator, dishwasher, air conditioner and dehumidifier breed them too.
- Give it two weeks. Adults emerge one to two weeks after eggs are laid, so flies after a cleaning are not proof the cleaning failed. Re-tape the drain to be sure.
How to get rid of phorid flies (and when they mean a plumbing problem)
To get rid of phorid flies, find and remove the decaying material they breed in; Mississippi State is direct that in most cases insecticides are of little or no use. Phorid flies are fruit-fly size but have dark eyes instead of red, a humped back, and a jerky, erratic run before they fly, which is why they are also called scuttle flies. If you are finding them inside, Mississippi State notes, they are almost surely breeding inside: in trash, a disposal, a drip pan, a vase of cut flowers left too long, a pot with a dead plant, a dead animal in a wall, or the gunk under kitchen equipment.
The case that matters is the ground floor of a slab house with very large numbers of them and no obvious source. The University of Maryland and Mississippi State both flag that pattern as a possible broken drain or sewer line under the structure, where sewage-contaminated soil supports a heavy, persistent population and the flies follow light up through a crack or joint. That is a plumber’s job, and spraying does nothing until the break is fixed.
How to make a gnat trap (and which gnats it catches)
A homemade trap catches adults and tells you whether the fix is working, but it never ends an infestation on its own. Match the trap to the fly.
| Fly | Trap that works | How to make or use it |
|---|---|---|
| Fruit flies | Vinegar jar trap | A jar with a few ounces of cider vinegar (or a splash of wine), one drop of dish soap so they sink, and a paper funnel rolled from notebook paper, or plastic wrap with a few small holes. Set it beside the source and empty it every few days. |
| Fungus gnats | Yellow sticky cards | Cards under the leaves or at the pot’s edge, or squares on skewers in the soil. Vinegar traps are built for fruit flies, which go for fermenting food; for fungus gnats the extension sources point to yellow cards. |
| Drain flies | Oiled cup over the drain | A clear plastic cup with a thin film of oil or petroleum jelly inside, upside down over the drain overnight. It is a test for which drain, not a cure. |
| Phorid flies | Tape over drains and openings | Clear tape over drains, the disposal and any floor crack overnight shows where they emerge. |
How to get rid of gnats outside: eye gnats and patio swarms
Eye gnats are the tiny shiny black flies, 1/16 to 1/8 inch, whose females persistently go for your eyes, nose and any scrape. They do not bite. In Southern California they breed in moist, sandy soil with lots of fresh organic matter and are mostly a desert and farm-edge problem, worst after heavy rains. UC IPM’s advice: stop digging fresh organic matter into beds, cut surface irrigation, use a DEET or picaridin repellent for temporary relief, and hang bottle traps with an egg-and-water bait two to three feet off the ground away from doors. Treating the soil for larvae does not work.
Midges that swarm over the lawn at dusk and fungus gnats rising out of a freshly mulched, over-irrigated bed are both moisture problems. Let the mulch dry out and shorten the sprinkler run. The gnats on a San Gabriel Valley patio are usually fungus gnats from the beds, not anything that needs treatment.
What does not work on gnats
Bleach, boiling water, sprays, essential oils and foggers all fail for the same reason: none of them removes the place the larvae live.
- Bleach down the drain: does not remove the film drain flies breed in.
- Boiling or hot water: kills larvae at the surface for a day.
- Spraying the adults: a day of relief while the larvae keep developing.
- Vinegar traps for fungus gnats: the wrong bait; use yellow cards.
- Candles, bug zappers and essential-oil sprays: no evidence they end an infestation; zappers mostly kill harmless insects.
- Coffee grounds or cinnamon on the soil: no documented effect on larvae; drying the soil has one.
- Foggers: never indoors for this, and they reach none of the breeding sites.
Do you need an exterminator for gnats?
Usually no, and we would rather tell you that than sell you a visit. There is no product that solves gnats while the breeding site remains, so a good company’s real value is finding the source. If the tape test comes up empty everywhere, phorid flies are pouring out of a slab, or the “gnats” are actually winged termites or flying ants, that is when a photo to (626) 409-1584 is worth your time. For bigger flies, our fly guide covers house flies and the rest of the family, and the pest identifier sorts any bug by what you saw.
Sources
- UC IPM Pest Notes: Fungus Gnats (University of California; Bethke and Dreistadt)
- Colorado State University Extension Fact Sheet 5.584: Fungus Gnats as Houseplant and Indoor Pests (Cranshaw and Cloyd; reviewed 2025)
- Cornell Cooperative Extension Allegany County: A Spooky Houseplant Pest, Fungus Gnats (2024)
- N.C. Cooperative Extension, Beaufort County: Fungus Gnats, Tiny Pests in Houseplants (2025)
- Ohio State University Extension Fact Sheet HYG-2109: Vinegar Flies
- Penn State Extension: Vinegar Flies
- University of New Hampshire Extension: Fruit Flies
- Virginia Cooperative Extension ENTO-414: Drain Fly
- University of Kentucky Entomology ENTFACT-615: Drain Flies
- Mississippi State University Extension, Bug’s Eye View: Phorid Flies (2022)
- University of Maryland Extension: Phorid (Humpbacked) Flies
- UC IPM Pest Notes: Eye Gnats (University of California)
Common Questions
Quick Answers.
Why do I suddenly have so many gnats in my house?
Something started breeding: a plant that is being watered too often, fruit left out, a bin of recycling with residue, or a drain that is not used much and has built up a film. Adults live only a week or two, so a sudden cloud means a nearby source has just produced a generation. Find the source and the cloud stops a couple of weeks later.
What is the difference between gnats and fruit flies?
Fruit flies are tan with red eyes and hover over fruit, drinks and the sink. Fungus gnats are darker, thinner and mosquito-like, and they fly weakly near potted plants and windows. Drain flies are fuzzy and moth-like and sit on bathroom walls. Phorid flies have dark eyes and run in a quick stop-start scuttle instead of flying away. Each one breeds somewhere different, which is why the ID matters.
What attracts gnats?
Moisture and decay. Fungus gnats are drawn to damp potting soil and to light, fruit flies to fermenting produce and drinks, and drain flies and phorid flies to the organic film in drains, drip pans and trash. A house with none of those has nowhere for gnats to breed, so the adults that wander in die off within a week or so.
How long do gnats live?
Adult fungus gnats live about seven to ten days, and a female can lay up to 200 eggs in that time, according to Colorado State University Extension. A full fungus gnat generation takes about 17 days at 75°F (UC IPM), fruit flies 8 to 15 days (Ohio State), and drain flies about 10 to 15 days at 70°F (University of Kentucky). Short lives and fast generations are why the adults you kill keep being replaced until the source is gone.
How long does it take to get rid of gnats?
About two to three weeks after you remove the source, because adults keep emerging from eggs laid before the fix. A heavily infested houseplant can take longer: Cornell notes a Bti program can take four to five weeks to show. Traps shorten the annoyance, not the timeline.
How do I get rid of gnats fast?
Nothing is instant, but the fastest route is the right one: identify the fly, remove or dry out the breeding site today, and set a vinegar trap or sticky card, or run a vacuum hose over the adults, while the last generation emerges. Spraying the cloud buys an afternoon; the eggs keep hatching. With the source gone, most gnat problems fade within two weeks.
Do gnats bite?
The four house flies people call gnats do not bite: fungus gnats, fruit flies, drain flies and phorid flies feed on decaying matter, not people. Outdoor eye gnats do not bite either, though the females crawl at eyes and noses. Biting midges and black flies exist near water but are not what you find in a kitchen.
Does hydrogen peroxide kill fungus gnats?
It is a popular remedy with some extension support: Cornell Cooperative Extension suggests one part 3 percent hydrogen peroxide to four parts water, poured over the soil, then letting the soil dry. It is not among the controls UC IPM or Colorado State list, and there is little published testing behind it for houseplants, so treat it as a supplement to drier watering, not the fix. Keep it off the leaves.
Does sand on top of the soil stop fungus gnats?
It helps. A layer of coarse sand or fine gravel on the soil surface acts as a barrier to egg-laying, according to N.C. State Extension, and it keeps the surface drier. It works alongside letting the top inch or two dry between waterings, not instead of it.
Why are there gnats in my house in winter?
Those are almost always fungus gnats in houseplants. Colorado State University Extension notes they are most noticeable in late fall and winter: plants grow slower and use less water, so potting soil stays wet longer, and plants brought in from a summer outdoors often carry them. Water less, let the top inch or two dry, and set yellow sticky cards at the pots.
Why are there gnats in my bedroom?
Bedrooms rarely breed gnats; they are where the adults end up. Check the nearest houseplant, even one in the next room, the drains of an attached bathroom, and any cups, cans, fruit or wastebasket. Fungus gnats are drawn to light, which is why you see them at the bedroom window.
Why are there gnats in my bathroom when I have no plants?
Bathroom gnats are usually drain flies breeding in the sink overflow, a slow shower drain or a rarely used toilet, or phorid flies from a drain or drip pan. Put clear tape sticky side down over each drain overnight; the drain that catches flies is the source.
Does bleach kill drain flies?
Not reliably. Drain fly larvae live in the gelatinous film on the pipe walls, and Virginia Tech notes bleach and vinegar do not penetrate that material to kill all the larvae. Scrubbing the drain and overflow with a stiff brush and cleaning the trap removes the film, which is what works. Never pour insecticide down a drain.
Do vinegar traps work for gnats?
For fruit flies, yes: they catch adults, which helps you measure the problem and reduces the cloud. Fungus gnats are better caught on yellow sticky cards. Either way a trap does not touch the eggs and larvae, so it never ends an infestation by itself; the University of New Hampshire calls trapping nowhere near as effective as sanitation.
Can gnats lay eggs in drains?
Yes. Drain flies and phorid flies both lay eggs in the organic film inside drains and overflow pipes, and fruit flies will breed in a dirty garbage disposal. That is why the tape test is step one: it tells you which drain, and it tells you when the drain is clean.
Why do gnats come out at night?
Drain flies are more active after dark and hover over sinks and drains at night, resting on walls by day. Fungus gnats are attracted to light, so you notice them at windows, screens and lamps. Neither is nocturnal in the way rodents are; you are just seeing them where the light is.
What smell do gnats hate?
No scent has been shown to end a gnat problem. Essential-oil sprays, cinnamon and coffee grounds have no documented effect on the larvae, which live in soil, drains or produce and never smell the room. Extension entomologists put sanitation and moisture control far above any repellent; spend the effort on the source.
Can an exterminator get rid of gnats?
A professional can find a source you cannot, but there is no spray that fixes gnats while the breeding site remains, and we do not sell a gnat-only service. The cases that need a pro are usually plumbing: a broken sewer line under a slab producing phorid flies, or a drain nobody can reach. If the tiny flies are not gnats at all, winged ants or termite swarmers for example, that is a different job, and we will say so.
Keep Reading
About the Author
Think you just found termite evidence?
Bag a few wings or pellets, snap a photo, and text it to (626) 409-1584 — quotes from photos are free, and your job stays under licensed ExterMetro oversight from inspection through follow-up.
