How to Get Rid of Tiny Gnats and Flies in Your House

Those tiny flies swarming your kitchen or hovering near your houseplants are almost certainly one of four species: fruit flies, fungus gnats, drain flies, or phorid flies. All four are smaller than 1/8 inch (about 4 mm), and each one breeds in a different spot in your home. Figuring out which type you have is the fastest way to eliminate them, because killing the adults does almost nothing if you don’t destroy the breeding site.

Which Tiny Fly Do You Have?

All four common indoor species look similar at a glance, but a few details give them away.

Fruit flies have a stout, rounded body and distinctive red eyes (though a less common “dark-eyed” variety exists). You’ll find them near overripe fruit, trash cans, recycling bins, or anything fermenting. They’re roughly 1/8 inch long.

Fungus gnats are thinner and more mosquito-like, with long slender legs and bead-like antennae. They range from 1/16 to 1/8 inch. You’ll almost always see them rising from houseplant soil or circling the pot. Their wings can be clear or dark.

Drain flies are fuzzy and moth-like, with broad, leaf-shaped wings they hold flat over their body at rest. They tend to hover near bathroom sinks, shower drains, or floor drains, especially ones that aren’t used often.

Phorid flies are the trickiest to identify. They’re the same size as fruit flies but have a noticeable hump on their back and run in quick, erratic bursts across surfaces rather than flying immediately. Their wings have distinctive dark veins along the front edge. Phorid flies breed in decaying organic matter inside walls, under slabs, or in broken drain lines, making them especially common in commercial buildings.

Why They Multiply So Fast

Indoor temperatures are ideal for rapid reproduction. Fungus gnats, for example, complete an entire generation in about 17 days at 75°F: eggs hatch in 3 days, larvae develop over 10 days, pupae emerge as adults 4 days later. Because generations overlap constantly, a single potted plant can produce a steady stream of adults for weeks. Fruit flies are similarly prolific. A single female can lay around 75 eggs per week under favorable conditions, and adults can live roughly two months, meaning one piece of forgotten fruit can seed a population that feels endless.

Finding the Breeding Site

Killing adult flies with traps or swatters is satisfying but temporary. The larvae are the real problem, and they’re hidden. Your first job is to locate where they’re breeding.

For fruit flies, check these common spots: the wet bottom of a trash can (especially under a leaking liner), a bag of potatoes or onions in the pantry, overripe bananas or tomatoes left on the counter, unrinsed bottles in a recycling bin, and damp or dirty mops and cleaning rags. Even a thin layer of spilled juice under an appliance is enough.

For fungus gnats, the source is almost always the moist potting soil of a houseplant. Look for tiny white, legless larvae with shiny black heads in the top inch of soil. Some fungus gnats also breed in the microbial film inside drains, similar to drain flies.

For drain flies, you can confirm the source with a simple test. Place a strip of clear adhesive tape across a suspected drain opening at night, sticky side down. If flies are emerging from that drain, you’ll find them stuck to the tape the next morning. Alternatively, coat the inside of a clear cup with petroleum jelly and set it upside down over the drain. Check both traps over several consecutive nights, since adults don’t emerge every day.

Getting Rid of Fruit Flies

Remove the food source and the population collapses. Throw away any overripe or damaged produce. Clean the inside of your trash can with soap and water, not just the liner. Rinse every bottle and can before it goes in the recycling bin. Wipe down counters and under appliances where juice or food debris might have pooled. Store ripe fruit in the refrigerator until the infestation is gone.

To catch the remaining adults while you wait for the population to die off, fill a small jar with apple cider vinegar and add a drop of dish soap. The vinegar attracts them and the soap breaks the surface tension so they sink. Replace it every few days. With the breeding site gone, you should see a sharp drop in numbers within a week.

Getting Rid of Fungus Gnats

The key is breaking the moisture cycle in your plant soil. Let the top inch of soil dry out completely between waterings. This eliminates the damp surface layer where females prefer to lay eggs. Watering from the bottom, by filling a saucer and letting the roots absorb moisture upward, keeps the surface dry while still hydrating the plant.

For a more aggressive approach, mix one part 3% hydrogen peroxide with four parts water and pour it directly over the soil as a drench. It will fizz on contact, which is the peroxide killing larvae. This is safe for plant roots at that concentration. Let the soil dry out afterward before watering again.

Covering the soil surface with about an inch of coarse sand or fine gravel also discourages egg-laying by keeping the top layer dry and unappealing. Yellow sticky traps placed near the soil surface catch adults and help you monitor whether the population is declining. Expect the process to take three to four weeks of consistent effort, since overlapping generations mean new adults will keep emerging from eggs and larvae already in the soil even after you’ve changed your watering habits.

Getting Rid of Drain Flies

Drain flies breed in the slimy organic film that builds up inside pipes, P-traps, and garbage disposals. Pouring bleach down the drain rarely works because it flows past the buildup without dissolving it. Instead, physically clean the drain. Remove the drain cover, scrub the inside of the pipe as far as you can reach with a stiff brush, and flush with boiling water.

For ongoing maintenance, enzyme-based drain cleaners are more effective than chemical ones for this purpose. These gels contain microorganisms that digest the organic film clinging to pipe walls, destroying the breeding habitat over several applications. Run water regularly through any drains you don’t use often, since stagnant P-traps are a favorite breeding site.

Do These Flies Bite or Spread Disease?

None of the four common indoor species bite humans. Fruit flies, fungus gnats, and drain flies are nuisance pests only. Fungus gnat larvae can damage the roots of seedlings or very young houseplants by feeding on root hairs and fungi in the soil, but established plants tolerate them well. Phorid flies are the only species that occasionally signals a more serious problem: if you can’t find a breeding source, they may be breeding in a broken sewer line or decaying organic matter beneath a concrete slab, which typically requires professional inspection.

Keeping Them From Coming Back

Most indoor fly problems come down to moisture and organic debris. A few habits prevent nearly all re-infestations. Store ripe fruit in the refrigerator or in sealed containers. Take out kitchen trash before the bag gets wet at the bottom. Rinse recyclables before tossing them in the bin. Clean your garbage disposal weekly by running it with ice and a splash of vinegar.

For houseplants, avoid overwatering. Most tropical houseplants actually prefer the soil to dry slightly between waterings, so letting the top inch go dry isn’t just gnat prevention, it’s better plant care. If you repot a plant, use fresh, sterile potting mix rather than reusing old soil that may already contain eggs. A layer of sand or decorative gravel on top of the soil is a simple long-term barrier that makes the surface inhospitable to egg-laying females while still looking good on a windowsill.