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 and how it moves, confirm the source with clear tape over suspect drains overnight, then dry the soil, clean the produce area, or scrub the drain film. Because each fly takes two to three weeks to go from egg to adult, 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
- Which gnat do you have? The four small flies, side by side
- Where are the gnats coming from? Find the breeding site first (the tape test)
- 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 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
Which gnat do you have? The four small flies, side by side
Nobody has a gnat problem. They have a fungus gnat, fruit fly, drain fly or phorid fly problem, and the four breed in completely different places. Spend two minutes on the ID and the rest of this page gets short.
| Fly | What it looks like | Where you see it | Where it breeds | The fix |
|---|---|---|---|---|
| Fungus gnat | 1/16 to 1/8 inch, dark, thin and mosquito-like, with antennae longer than its head; a weak flier that runs across soil | Around potted plants and at windows, drawn to light | Moist potting mix, compost, mulch; larvae eat fungi, organic matter and root hairs | Let soil dry between waterings, Bti drench, sticky cards |
| Fruit (vinegar) fly | About 1/8 inch, tan to brown, red eyes in the common species; hovers and lands | Fruit bowl, sink, trash, recycling, bar area | 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, 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 | Under 5 mm, dark, with a humped back; runs in a stop-start scuttle rather than flying off | Kitchens, bathrooms, basements, anywhere near garbage or drains | Garbage can bottoms, disposals, drip pans, decaying matter, dead animals, sewage under a slab | Remove the organic material; many flies on a ground floor can mean a broken sewer line |
Two more that 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.
Where are the gnats coming from? Find the breeding site first (the tape test)
Every extension entomologist says the same thing in different words: eliminate the larval habitat, and use insecticide, if ever, as a last resort. So before you buy anything, find the habitat.
- Tape the drains. Press clear tape sticky side down over each suspect drain (sink, shower, tub overflow, floor drain, rarely used guest bath) and leave it overnight. Flies stuck to the tape mean that drain is the nursery. Virginia Tech also suggests an inverted clear cup 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. UC IPM’s trick: lay chunks of raw potato cut side down on the soil and look for larvae on them a few days later.
- Walk the kitchen. Fruit bowl, the bottom of the trash can, the recycling bin, the disposal splash guard, the mop bucket, under the fridge, behind the dishwasher kick plate, the drip pan.
- Check the appliances. Condensate drip pans under refrigerators, air conditioners and dehumidifiers are classic drain-fly and phorid-fly sites.
- Hang a yellow sticky card. It tells you where the adults are densest, which points at the source, and later it tells you the source is gone.
How to get rid of fungus gnats in houseplants
Fungus gnats live in wet potting mix. Adults do not damage plants or bite; the larvae eat fungi and organic matter in the soil, and in heavy infestations they chew root hairs and stunt seedlings. At 75°F a generation takes about 17 days, so this is a two-to-three-week project.
- Let the surface dry. UC IPM’s first recommendation is to avoid overwatering and let the soil surface dry between waterings. Bottom-watering helps. Improve drainage by adding perlite or sand to the mix.
- Bti drench. Bacillus thuringiensis subsp. israelensis is a bacterial larvicide sold at garden centers for fungus gnat and mosquito larvae. It does not persist indoors, so UC IPM suggests repeating about every five days for a few rounds. The caterpillar strain of Bt does not work on fly larvae.
- Beneficial nematodes. Steinernema feltiae is the most effective species available; apply to moist soil at 60 to 90°F. Mail order, use promptly.
- Sticky cards. Cut yellow sticky traps into squares and mount them on skewers in the pots to catch adults.
- Quarantine and discard. Do not move an infested plant to a new room. Toss plants that are badly infested, and buy pasteurized potting mix stored off the ground in a closed bag.
- Skip the spray. UC IPM: “Insecticides are rarely warranted to control these flies in and around homes.” If you must, a pyrethrin on the soil surface is temporary at best; never fog indoors.
How to get rid of fruit flies
Fruit flies are a sanitation problem with wings. They breed in fermenting residue: the soft spot on a banana, the film in the bottom of a recycling bin, the disposal, a damp mop head, the drain water in a refrigerator drip pan. Extension sheets are blunt that trapping is far less effective than kitchen hygiene and that sprays are not worth using against a fly that breeds this fast.
- Refrigerate or discard ripe produce; wipe the bowl.
- Rinse every can and bottle before it goes in recycling; take the bin out.
- Run ice and a little dish soap through the disposal, then scrub under the splash guard.
- Wash or replace mop heads and sponges; empty the drip pan.
- Set a vinegar trap (an inch of cider vinegar, a drop of dish soap, plastic wrap with pinholes) to mop up adults and to tell you when they stop coming.
- Fit 16-mesh or finer screens if they are coming in from a fruit tree or compost outside.
How to get rid of drain flies
Drain flies breed in the sludgy film that coats the inside of a drain, an overflow pipe or a drip pan. The water is not the problem; the film is. Virginia Tech calls scrubbing the drain opening with a stiff brush, removing all the slime, 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.
- 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, a toilet nobody flushes. Run water in them weekly.
- 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)
Phorid flies are the small dark fly with the humped back that runs across the counter in quick bursts instead of flying away. They breed in a wide range of decaying matter: the gunk in a trash can, a disposal, a drip pan, a dead rodent in a wall. The case that matters is the ground floor of a slab house with very large numbers of them and no obvious source. 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 expansion joint. That is a plumber’s job, and insecticides are of little or no use until the break is fixed.
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 the patio in the San Gabriel Valley are usually fungus gnats from the beds, not anything that needs treatment.
What does not work on gnats
- Bleach down the drain: does not remove the film.
- Spraying the adults: a day of relief while the larvae keep developing.
- 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 the small flies themselves, our fly guide covers house flies and the rest of the family.
Sources
- UC IPM Pest Notes: Fungus Gnats (University of California)
- Virginia Cooperative Extension ENTO-414: Drain Fly
- University of Kentucky Entomology ENTFACT-615: Drain Flies
- Virginia Cooperative Extension ENTO-433: Phorid Flies
- University of Maryland Extension: Phorid (Humpbacked) Flies
- Mississippi State University Extension, Bug’s Eye View: Phorid Flies
- Ohio State University Extension: Vinegar Flies (fact sheet)
- University of New Hampshire Extension: Fruit (Vinegar) 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 run in a quick stop-start scuttle instead of flying away. Each one breeds somewhere different, which is why the ID matters.
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.
How long does it take to get rid of gnats?
About two to three weeks after you remove the source. Fungus gnats take roughly 17 days from egg to adult at room temperature, drain flies one to two weeks, so adults keep emerging for a while after the breeding site is gone. Traps shorten the annoyance, not the timeline.
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?
They catch adult fruit flies and some fungus gnats, which helps you measure the problem and reduces the cloud. They do not touch the eggs and larvae, so a trap by itself never ends an infestation. Extension entomologists rank sanitation far above trapping.
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.
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 and screens. Neither is nocturnal in the way rodents are; you are just seeing them where the light is.
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.
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.
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 to mop up 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.
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.
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.
