If tiny flies are swarming around your kitchen, bathroom, or houseplants, you’re likely dealing with one of three common household pests: drain flies, fruit flies, or fungus gnats. People often call these “net flies” or “gnat flies” because they’re small enough to pass through window screens and seem to appear out of nowhere. Getting rid of them requires identifying which type you have, eliminating their breeding source, and staying consistent for three to four weeks to outlast their lifecycle.
Identify Which Fly You Have
The fix depends entirely on which fly is breeding in your home, because each type relies on a different food source and habitat. Treating the wrong spot wastes your time while the colony keeps growing.
Fruit flies are about ⅛-inch long, shaped like a tiny house fly, and typically have red or black eyes with striped abdomens. You’ll find them buzzing around fruit bowls, trash cans, recycling bins, and kitchen drains. They lay eggs on overripe or rotting fruit and on old food residue inside sink drains.
Drain flies (sometimes called moth flies) are fuzzy, moth-shaped insects that rest on walls near sinks, showers, and floor drains. They breed inside the slimy organic film that builds up inside pipes. If you see them in your bathroom more than your kitchen, drains are almost certainly the source.
Fungus gnats look more like tiny mosquitoes than flies. They hover in clouds above potted plants and show little interest in your kitchen. Their larvae live in moist potting soil, feeding on fungi and organic matter. If the swarm is concentrated around your houseplants, these are your culprit.
Getting Rid of Fruit Flies
Start by removing every breeding source. Throw away overripe fruit, take out the trash, empty recycling bins that held bottles or cans with sugary residue, and clean your garbage disposal. Fruit flies can lay eggs anywhere organic material is decomposing, so even a forgotten banana peel under a counter can sustain an infestation. Wipe down counters where fruit juice or alcohol has spilled, and rinse any produce you keep out.
While you eliminate sources, traps help knock down the adult population. The most effective DIY trap uses a jar filled with about a quarter cup of apple cider vinegar and a few drops of liquid dish soap. The vinegar’s sweet fermentation smell attracts the flies, and the soap breaks the surface tension so they sink and drown instead of landing safely. Cover the jar with a lid and poke small holes in it. In side-by-side testing, this sealed-jar method caught upward of 50 flies in a single week, far outperforming open-top designs or paper cone traps, which caught fewer than 10.
Place traps near the fruit bowl, sink, and trash can. Replace the vinegar every few days as it loses potency. Keep traps running for at least two to three weeks even after you stop seeing flies, because eggs already laid will continue hatching.
Getting Rid of Drain Flies
Drain flies breed inside the gelatinous biofilm that coats the interior of pipes, and that biofilm is the key target. Killing the adults you see on the wall does almost nothing, because larvae embedded in the slime will replace them within days.
Why Quick Fixes Fall Short
Pouring bleach down the drain kills adult flies on contact but does not penetrate the biofilm where larvae live. The biofilm has a protective structure that resists chemical penetration, so new adults emerge within days of a bleach treatment. Boiling water has a similar problem: it cools rapidly as it travels through the drain body, contacting only a small fraction of the biofilm surface. Enzyme-based drain cleaners do target organic matter, but they work slowly, require repeated applications, and rarely reach the full extent of the biofilm layer deeper in the pipe.
The Effective Approach: Physical Removal
The most reliable method is physically scrubbing the biofilm out of the pipe. Ohio State University Extension recommends removing the drain trap and using a plumber’s snake with a brush tip to clean all gelatinous material from inside the pipe. If you can’t remove the trap, a long-handled stiff brush pushed as far down the drain as possible will clear a significant portion of the buildup. After scrubbing, flush the line with boiling water or a caustic drain cleaner to remove any residue left behind.
For persistent or widespread infestations, a commercial drain cleaner formulated to break down fats, oils, and grease (sometimes labeled for “FOG buildup”) works through the full length of the pipe, eliminating the flies’ habitat, food source, and breeding ground in one treatment. These products use either emulsification or bacterial digestion to dissolve the organic layer that brushes can’t reach.
Expect a Three-to-Four-Week Process
Drain flies complete their full lifecycle in 21 to 27 days. Eggs hatch in less than two days, larvae develop over 9 to 15 days, pupae emerge as adults within 24 to 48 hours, and adult females can live up to seven days. This means even a thorough cleaning may not stop new adults from appearing immediately, because larvae and pupae already in the pipe will continue developing. Repeat your drain treatment every five to seven days for at least a month to catch each generation before it can reproduce.
Getting Rid of Fungus Gnats
Fungus gnats breed in wet potting soil, so the fix starts with your watering habits. Let the top inch or two of soil dry out completely between waterings. The larvae need moist conditions to survive, and simply reducing soil moisture kills them off. For heavily infested pots, bottom-watering (placing the pot in a tray of water and letting the soil absorb moisture from below) keeps the top layer dry where gnats lay their eggs.
A layer of coarse sand or decorative pebbles on top of the soil creates a physical barrier that prevents adult gnats from reaching the moist soil to deposit eggs. You can also use sticky yellow traps placed near the soil surface to catch adults. These traps won’t eliminate the infestation alone, but they reduce the number of adults laying new eggs while the soil dries out.
If the problem is severe, a soil drench with diluted hydrogen peroxide (one part 3% hydrogen peroxide to four parts water) kills larvae on contact without harming most plants. Water the affected pots with this mixture, let them drain, and repeat after a week if gnats persist.
Using Sprays and Foggers Safely
Pyrethrin-based sprays, derived from chrysanthemum flowers, kill small flies on contact and are available as aerosols, foggers, and pump sprays. They work well for knocking down a large number of adults quickly but do nothing about eggs or larvae at the breeding source. Think of them as a supplement to source elimination, not a replacement.
If you use a fogger or bug bomb indoors, ventilation is critical. People are most commonly exposed to these chemicals when they re-enter a room too early or fail to air it out afterward. Always follow the label’s instructions for how long to stay out of the treated area, and open windows before spending time in the room. Sprays applied in poorly ventilated spaces pose the highest exposure risk.
Preventing Flies From Coming Back
Every type of small household fly relies on moisture and organic matter to breed. Eliminating those conditions is the only reliable long-term prevention.
- Kitchen drains: Run hot water after washing dishes, clean your garbage disposal weekly, and use a drain maintenance product monthly to prevent biofilm from rebuilding.
- Bathroom drains: Remove hair and soap buildup from shower drains regularly. Floor drains in basements or laundry rooms that rarely get used should be flushed with water periodically, since stagnant water and organic film accumulate quickly in unused pipes.
- Produce storage: Refrigerate ripe fruit rather than leaving it on the counter. Rinse produce when you bring it home to remove any eggs that may already be on the skin.
- Trash and recycling: Use lined bins, take trash out before it sits overnight, and rinse bottles and cans before tossing them in the recycling.
- Houseplants: Avoid overwatering, ensure pots have proper drainage, and remove standing water from saucers within 30 minutes of watering.
The pattern across all three fly types is the same: they can’t reproduce without a moist organic breeding site. Remove that, and the flies disappear within a single lifecycle, roughly three to four weeks. Leave it in place, and no amount of trapping or spraying will keep up with the rate they reproduce.