Getting rid of gnats and fruit flies starts with figuring out which one you’re dealing with, because the most effective killers target each pest differently. Fruit flies breed in overripe produce and drain slime, while fungus gnats breed in moist potting soil. Using the wrong approach means you’ll keep seeing new waves of tiny flies for weeks. Here’s how to identify what’s in your home and eliminate it.
Fruit Flies vs. Fungus Gnats
Both pests measure about one-eighth of an inch long, but they look and behave differently. Fruit flies have a rounded body (like a tiny house fly), range from tan to black, and are easy to spot by their large red eyes. Fungus gnats are dark gray or black with long dangling legs, more like a miniature mosquito. Their eyes are so small you can barely see them.
The real giveaway is where they hang out. Fruit flies swarm around your kitchen: near fruit bowls, trash cans, compost bins, and sink drains. Fungus gnats hover around houseplants because they lay eggs in moist soil, where their larvae feed on organic matter and damage plant roots. If you see tiny flies rising from a potted plant when you water it, those are fungus gnats. If they’re circling your bananas or wine glass, fruit flies.
You may have both at the same time, especially in warmer months. In that case, you’ll need to treat both breeding sources.
How to Kill Fruit Flies
Apple Cider Vinegar Trap
This is the simplest and most reliable DIY method. Fill a jar with about a quarter cup of apple cider vinegar and add a few drops of liquid dish soap. The vinegar smells irresistibly sweet to fruit flies, drawing them in. The dish soap breaks the surface tension of the liquid, so when they land, their wings get weighed down and they drown instead of flying away.
You can leave the jar open or punch a few small holes in the lid with a nail to make it harder for flies to escape. Place traps near the spots where you see the most activity: next to the fruit bowl, by the trash can, near the sink. Replace the vinegar every two to three days.
Eliminate Breeding Sites
Traps alone won’t solve a fruit fly problem if the breeding source stays. Fruit flies lay eggs on overripe produce, and their larvae also feed on the slime that builds up inside kitchen drains. A single female can lay hundreds of eggs, and the entire life cycle from egg to adult takes only 10 to 12 days at room temperature (around 72°F). At slightly warmer temperatures, that drops to 9 or 10 days. This means a small problem becomes a big one fast.
Store ripe fruit in the refrigerator. Take out kitchen trash daily. Clean drains by pouring boiling water down them, then scrubbing with a drain brush to remove the organic film where larvae develop. Wipe down counters where juice or alcohol has spilled. Once you remove all food sources and run your vinegar traps for about two weeks, the population collapses because no new generation can develop.
How to Kill Fungus Gnats
BTI Soil Drench
The most effective treatment for fungus gnats targets the larvae hiding in your potting soil. Products sold as “Mosquito Bits” contain a naturally occurring bacterium (BTI) that works as a larvicide. The larvae eat it and die within 24 hours, but it’s essentially nontoxic to people, pets, and plants.
To use it: mix 4 tablespoons of the granules into 1 gallon of water and let it sit for 30 minutes. Skim off or strain out the floating granules (placing them in a nylon stocking before soaking makes cleanup easier). Then water your plants with the treated liquid, applying it directly to the soil surface. Repeat weekly for three weeks to catch larvae at every stage of development. If gnats reappear later, repeat the cycle. Products like Mosquito Bits and Gnatrol are widely available at garden centers.
Hydrogen Peroxide Soil Drench
If you can’t find BTI products, a hydrogen peroxide drench is a solid alternative. Mix one part standard 3% hydrogen peroxide with four parts water and pour it over the soil. The solution will fizz as it contacts larvae, killing them without harming your plants. Let the soil dry out thoroughly afterward, since fungus gnats need consistently moist soil to reproduce. Allowing the top inch or two of soil to dry between waterings is one of the best long-term prevention strategies.
Yellow Sticky Traps
Small yellow sticky cards placed near the soil surface catch adult gnats before they can lay more eggs. These won’t eliminate larvae already in the soil, but they reduce the adult population and help you gauge how bad the infestation is. If you’re seeing fewer adults on the traps each week while running a BTI drench, you know the treatment is working.
When to Use Sprays
For most home infestations, traps and soil treatments are enough. But if populations are high and you need faster results, pyrethrin-based sprays offer a low-toxicity option. Pyrethrins are derived from chrysanthemum flowers and have low toxicity to people and pets.
Spray the surface of the potting soil and the parts of the plant where adults tend to rest. Don’t try to spray gnats in mid-air or fog a room, as that’s ineffective and unnecessary. Make sure the product label specifically lists your intended use (such as “houseplants”). If you’re treating indoor plants, move them outside for the application and wait about a day before bringing them back in.
Synthetic versions of pyrethrins (called pyrethroids) are longer-lasting and sometimes more effective, but they’re also more toxic to beneficial insects. For indoor use on houseplants, natural pyrethrins are the safer choice. These sprays can be combined with BTI treatments since the products are compatible.
A Two-Week Game Plan
Because both fruit flies and fungus gnats have short life cycles, consistency over two to three weeks matters more than any single treatment. Here’s a practical timeline:
- Day 1: Identify which pest you have (or both). Remove all overripe fruit, clean drains, and take out the trash. Set up vinegar traps for fruit flies. For fungus gnats, do your first BTI soil drench and place yellow sticky traps near plants.
- Week 1: Replace vinegar traps every few days. Let plant soil dry between waterings. Monitor sticky traps.
- Week 2: Do a second BTI drench. Keep vinegar traps running. You should see noticeably fewer flies by now.
- Week 3: Do a third BTI drench if needed. By this point, you’ve outlasted the full life cycle of both pests, and any remaining adults have nowhere to breed.
The key mistake people make is killing the adults they can see while ignoring the larvae they can’t. Adults are just the visible tip of the problem. Hundreds of eggs and larvae may be developing in a drain, a forgotten piece of fruit, or a pot of damp soil. Target the breeding site, stay consistent for two to three weeks, and the infestation ends.