How to Get Rid of Little Flies: Fruit Flies, Gnats & More

Getting rid of little flies starts with figuring out which type you have, because each one breeds in a different spot. The four most common small indoor flies are fruit flies, fungus gnats, drain flies, and phorid flies, all under 4 mm long and all capable of completing their entire lifecycle inside your home. Kill the adults all you want, but the infestation won’t end until you eliminate the breeding source.

Identify Which Fly You Have

This step matters more than any trap or spray. Each fly type has a specific breeding site, and targeting the wrong one wastes your time completely.

  • Fruit flies are about 1/8 inch long with stout, round bodies and distinctive red eyes. You’ll find them hovering near fruit bowls, trash cans, and recycling bins. They’re attracted to vinegar and any decaying fruit or vegetable matter.
  • Fungus gnats look like tiny, delicate mosquitoes with long slender legs and clear or dark wings. They don’t bite. You’ll notice them flying around your face or hovering near houseplants, because their larvae live in moist potting soil.
  • Drain flies are fuzzy, moth-like flies that rest on walls near sinks and showers. They breed in the slimy biofilm coating the inside of drain pipes.
  • Phorid flies resemble fruit flies but have a distinctive humped back and tend to run across surfaces in quick, jerky movements rather than immediately flying. Their breeding sources are the hardest to find, ranging from drain pipe linings to decaying matter trapped under appliances or even broken sewer lines beneath a home’s foundation.

A simple test: if the flies cluster around your fruit bowl or kitchen trash, they’re almost certainly fruit flies. If they rise up from your houseplants when you water them, fungus gnats. If they appear near bathroom or kitchen drains, you’re dealing with drain flies or phorid flies.

Getting Rid of Fruit Flies

Fruit flies can go from egg to breeding adult in as little as 8 to 9 days at warm room temperatures. That speed is why a few flies become dozens so quickly, and why you need to attack both the adults and the source simultaneously.

Remove the Breeding Source

Throw away or refrigerate any overripe fruit. Empty your kitchen trash can and clean the inside of the bin. Rinse out bottles and cans in your recycling before they sit. Check under appliances for any food that’s fallen and started to rot. Wipe down counters where juice or alcohol has spilled. Clean your garbage disposal by running it with ice and a splash of vinegar. Fruit flies lay eggs on any moist, fermenting surface, so the goal is eliminating every possible site.

Trap the Remaining Adults

While you’ve cut off new breeding, you still have adults flying around that can live for weeks. The classic vinegar trap works well: pour about half an inch of apple cider vinegar into a jar or glass, add two or three drops of dish soap, and leave it near where the flies congregate. The vinegar’s sweet, fermented smell draws them in, and the dish soap breaks the surface tension of the liquid so they can’t land on it without sinking. You can also cover the jar with plastic wrap and poke small holes in it, which lets flies enter but makes escape difficult.

Replace these traps every two to three days. Within a week of eliminating food sources and trapping adults, the population should collapse. If it doesn’t, you’ve missed a breeding site. Check less obvious places: a potato that rolled behind a bin, a wet mop head, a forgotten compost container.

Getting Rid of Fungus Gnats

Fungus gnat larvae are white, legless, about 1/4 inch long, and live in the top layer of moist potting soil where they feed on fungi and plant roots. The adults are mostly a nuisance, but heavy larval infestations can damage houseplants.

Let Your Soil Dry Out

The single most effective step is allowing the top inch or two of soil in your houseplants to dry completely between waterings. Fungus gnat larvae need constant moisture to survive. Many houseplants tolerate this drying cycle perfectly well, and it alone can break the breeding cycle.

Treat the Soil Directly

For active infestations, a hydrogen peroxide soil drench kills larvae on contact. Mix one part standard 3% hydrogen peroxide with four parts water and pour it through the soil as you would normally water. The mixture will fizz as it works through the soil. Let the soil dry out completely afterward. This is safe for plants and breaks down into water and oxygen.

For persistent problems, granular products containing a naturally occurring soil bacterium (sold under names like “Mosquito Bits” or “Knock-Out Gnats”) are highly effective. You sprinkle the granules on the soil surface and water them in. The bacteria specifically target fly and gnat larvae in soil and are harmless to plants, pets, and people. Repeat applications every week or two until you stop seeing adults.

Yellow sticky traps placed near your plants catch adults and help you monitor whether the population is shrinking. They won’t solve the problem alone, but they’re a useful indicator.

Getting Rid of Drain Flies and Phorid Flies

Both of these species breed in decaying organic buildup, often inside plumbing. The approach is similar for both, though phorid flies can be trickier because their breeding sources are sometimes hidden.

Confirm the Source

Place a strip of clear tape or an inverted clear bowl over each suspect drain overnight. If flies are breeding in the biofilm inside that pipe, you’ll find adults stuck to the tape or trapped under the bowl by morning. Test multiple drains, including ones you rarely use, because stagnant water and buildup in infrequently used pipes are prime breeding grounds.

Clean the Drains

Chemical drain cleaners won’t solve this. The flies breed in the slimy organic film coating the pipe walls, and liquid cleaners run right past it. You need to physically remove the buildup. Use a stiff drain brush to scrub inside the pipe as far as you can reach, then flush with boiling water. For kitchen sinks, clean the garbage disposal thoroughly. Enzyme-based drain cleaners (not chemical ones) can help break down remaining biofilm over several days of repeated use.

For floor drains in basements or garages, pour water into them regularly. The water in the drain trap evaporates over time, giving flies a direct path up from the sewer line.

When Phorid Flies Won’t Go Away

Phorid flies breed in an unusually wide range of decaying matter: pet waste, dirty mop heads, food trapped under or between appliances, septic systems, and even cracked sewer lines beneath a home’s slab foundation. If you’ve cleaned every visible source and phorid flies keep appearing, the problem may be a plumbing leak or broken pipe underground. This is one of the few fly problems that can genuinely require a plumber or pest control professional to resolve, because the breeding site is physically inaccessible.

Preventing Flies From Coming Back

Once you’ve cleared an infestation, a few habits keep it from returning. Store ripe fruit in the refrigerator rather than on the counter, especially during warmer months when fruit flies are most active outdoors and can hitchhike inside on produce. Take kitchen trash out before it sits overnight. Rinse any containers with food residue before putting them in recycling. Clean your garbage disposal and kitchen drain weekly with hot water and a brush.

For houseplants, avoid overwatering. Water only when the top layer of soil is dry to the touch. When repotting, use fresh potting mix rather than reusing old soil that may already contain larvae or eggs. If you bring new plants home from a nursery, inspect them for tiny flies before placing them near your other plants.

Keep drains flowing. Run water through infrequently used sinks, tubs, and floor drains at least once a week to maintain the water seal in the trap and flush away early biofilm buildup. Clean under kitchen appliances like the refrigerator and stove a few times a year to catch any food that’s fallen into hidden spaces.