Getting rid of small flies in your house starts with figuring out what type you have, because each one breeds in a different spot. The three most common culprits are fruit flies, drain flies, and fungus gnats. Kill the adults all you want, but the infestation won’t stop until you find and eliminate the breeding source. Once you do, most infestations clear up within one to two weeks.
Identify Which Fly You Have
Small indoor flies look similar at first glance, but a few details will tell them apart quickly. Fruit flies are about 1/8 inch long with stout, round bodies and distinctive red eyes. They hover around kitchens, trash cans, and anywhere there’s ripe or rotting produce. A less common variety, the dark-eyed fruit fly, has black eyes and tends to show up near drains and bathrooms instead of fruit bowls.
Drain flies are fuzzy, moth-like flies that rest on walls near sinks and showers. They hold their large, leaf-shaped wings flat over their bodies and don’t fly far when disturbed. You’ll almost always find them near a drain or other source of standing water with a slimy film.
Fungus gnats are the smallest of the group, just 1/16 to 1/8 inch, with slender bodies, long legs, and dark wings. They look like tiny mosquitoes but don’t bite. If you see small flies hovering around your houseplants or drifting in front of your computer screen, fungus gnats are the most likely answer. Their larvae live in moist potting soil.
Eliminating Fruit Flies
Fruit flies reproduce fast and can locate a food source almost immediately, so the first step is removing everything they could breed in. That means more than just tossing the brown banana on your counter. Check for bags of potatoes or onions in the pantry, overripe tomatoes, and any produce that’s starting to soften. Move what you want to keep into the refrigerator.
Then tackle the less obvious spots. Fruit flies breed in any moist, fermenting organic matter:
- Trash cans, especially the wet bottom underneath a leaking liner
- Recycling bins with unrinsed wine, beer, or soda containers
- Damp mops, sponges, and cleaning rags left sitting wet
- Spills under appliances or behind counters
- Open containers of vinegar, wine, beer, or cider
Wipe down all surfaces, rinse your recycling, wring out mops and rags thoroughly, and take out garbage frequently. Fruit flies are small enough to pass through standard window screens, so keeping doors and windows closed helps prevent new arrivals.
While sanitation does the real work, a simple trap speeds things up by catching adults still flying around. Fill a glass or jar with a splash of apple cider vinegar, add a drop of dish soap to break the surface tension, and cover the top with plastic wrap poked with small holes. The flies crawl in and can’t get back out. A clear container lets you see when it’s working and when to swap it for a fresh one.
Sprays containing pyrethrum will kill adult fruit flies on contact, but they won’t touch eggs or larvae. They’re a supplement to sanitation, not a replacement.
Eliminating Drain Flies
Drain fly larvae live inside the slimy microbial film that builds up on the inner walls of pipes. This is why the most common DIY remedies don’t work. Pouring bleach, baking soda, vinegar, or boiling water down the drain is ineffective because the larvae are protected by that sticky biofilm layer, which is extremely difficult to simply wash away. Boiling water and harsh chemicals can also damage your pipes over time.
What does work is physically removing or breaking down the slime. Use a stiff drain brush to scrub inside the pipe, then follow up with an enzymatic drain cleaner or a foaming drain treatment. These products use enzymes or bacteria that digest the organic film where the larvae live, reaching deeper into the pipe than you can with a brush alone.
Don’t stop at the obvious drains. Drain flies also breed in air conditioner drip pans, refrigerator condensate trays, the tracks of sliding glass doors, and anywhere water pools with a film of organic buildup. Check for cracked or damaged tile where moisture could collect underneath, and fix any plumbing leaks, since even a small, slow drip creates a perfect breeding habitat.
Eliminating Fungus Gnats
Fungus gnat larvae feed on fungi and decaying organic matter in potting soil, so the fix centers on your houseplants. The single most effective strategy is letting the top 1 to 2 inches of soil dry out completely between waterings. Dry soil kills eggs and young larvae and makes the pot far less attractive to egg-laying adults. Overwatering, especially during fall and winter when plants need less moisture, is the number one driver of fungus gnat problems.
Potting mixes high in organic matter and organic fertilizers like fish emulsion encourage the fungi that gnat larvae feed on. If a particular plant keeps producing gnats, consider repotting it in a lighter, faster-draining mix. Spreading a thin layer of coarse sand over the soil surface also helps by creating a dry barrier that discourages females from laying eggs.
For heavier infestations, a soil drench with beneficial nematodes (specifically a species called Steinernema feltiae, sold at many garden centers) is highly effective. These microscopic organisms enter the larvae and kill them within three to four days. A bacterial product called Bti, the same active ingredient used in mosquito dunks, also kills fungus gnat larvae when mixed into the water you give your plants. Commercial growers use a concentrated version, but homeowners can crumble a mosquito dunk into their watering can for the same effect. Discard any rotting or decaying plant material sitting in or around pots.
How Long It Takes
Once you remove the breeding source, adult flies that are already buzzing around will die off on their own within a few days to about two weeks, depending on the species. Traps help shorten this window by catching adults before they can find a new place to lay eggs. The key detail: if flies keep appearing after two weeks, you’ve missed a breeding site. Go back and check the less obvious spots, such as a forgotten potato in the back of a cabinet, a slow leak under a sink, or a drip tray you didn’t know existed.
Preventing Small Flies From Coming Back
Most small fly infestations boil down to moisture and organic debris. A few routine habits keep them from returning:
- Store produce in the refrigerator or use it before it softens, especially bananas, tomatoes, and berries.
- Take out kitchen garbage frequently and wash the inside of the can if liquids leak past the liner.
- Rinse recyclables before tossing them in the bin.
- Clean drains monthly with a brush or enzymatic cleaner to prevent biofilm from building up.
- Empty and wipe drip trays under the refrigerator and air conditioner at least once a season.
- Water houseplants only when needed, letting the soil surface dry between waterings, and avoid heavy organic fertilizers indoors.
- Wring out mops and rags after use, and hang them where they can dry completely.
If your home has plumbing leaks or broken tile with moisture trapped beneath, fixing those structural issues is the only permanent solution. Small flies will always find a damp, organic food source if one exists.