How to capture and kill fruit flies

Medically Reviewed by Neha Pathak, MD on September 15, 2021

Those tiny "gnats" you see circling an overripe banana on your kitchen counter? They aren’t gnats at all. They're fruit flies. Not only are they annoying, they can also be bad for your health. But there are plenty of ways to make them go away for good.

No matter where in the U.S. you live, fruit flies can show up on your kitchen counters or inside your trash can. They can turn up any time of year but are most common in the late summer and early fall. That's because they're attracted to ripe and rotting food.

Fruits and vegetables -- especially bananas, melon, tomatoes, squash, and apples -- are their favorites. Rotten onions and potatoes are also a big draw for these tiny, 1/8-inch-long creatures.

An adult female fruit fly can lay up to 2,000 eggs on the surface of anything that's moist and rotting. Within 30 hours, tiny maggots hatch and start to eat the decayed food. Within 2 days, they're all grown up and ready to mate, too. While that transition may seem quick, a fruit fly only lives 8 to 15 days.

Research shows that fruit flies can transfer germs from a dirty surface onto a clean one. Some of the bacteria they may carry include salmonella, E. coli, and listeria. These three germs each cause food poisoning. Severe cases may put you in the hospital and can even be life-threatening.

If you have a fruit fly problem, insect sprays will kill the adult insects but won't stop eggs from hatching. To get rid of all the fruit files in your home, you'll need to:

  • Look for places where fruit flies can breed. Check for and clean up sticky spills or rotting food on your counters, inside drawers and cabinets, inside and under your refrigerator, and under other kitchen appliances. Aside from overripe fruit and veggies, fruit flies can lay their eggs on cleaning rags and mops, and even in empty cans.
  • Clean your drain and garbage disposal. You can pour boiling water into them or tape a clear plastic food storage bag over the top and leave in place overnight. Adult fruit flies will try to leave the drain, and you'll find them in the bag in the morning.
  • Make traps. Place them wherever you have seen fruit flies.
    • Wine trap: Fill the bottom of a small jar with a splash of wine. Make a cone out of a piece of paper. Put the cone on top of the jar with the narrow end pointing up. The wine attracts the flies. The cone keeps them in the jar.
    • Rotten fruit trap: Follow the steps above, but put a piece of rotten fruit at the bottom of the jar.
    • Apple cider vinegar trap: Follow the steps above, but put apple cider vinegar in the jar.
    • Apple cider vinegar and dish soap trap: Mix the ingredients in a container. The vinegar will lure the flies in, but the dish soap makes it hard for them to get away.
    • Yeast trap: Follow the steps above but swap the vinegar mixes for ¼ to ⅓ cup water, a packet of activated dry yeast and a teaspoon of sugar.
  • Use bug spray with caution. If you do want to try an insect spray or fog, remember that they contain poisonous chemicals. Carefully read the label and follow the safety guidelines. Keep away from children and animals.

To prevent fruit flies from getting too comfortable in your house again:

  • Buy only what you're sure you'll eat. One spoiled potato or forgotten box of berries can lead to thousands of fruit flies. Once produce gets ripe, put it in your refrigerator until you eat it. Compost the leftovers or throw them away promptly.
  • Wash your produce when you get it home (to remove any eggs or larvae) and then store it in the refrigerator.
  • Empty your kitchen trash can every day.
  • Clean up any spills right away (especially alcohol or fruit juices).
  • Rinse your recycling. Make sure all jars, bottles, and cans are free of food scraps.
  • Put screens on your windows and doors. Look for tight-fitting, 16-mesh models that can keep adult fruit flies from coming inside your home.
  • Turn off lights over your doors and windows. Light attracts newly adult fruit flies.
  • Seal all containers. If you preserve your own fruits and veggies or brew your own cider or beer, check that your lids are well sealed. If not, fruit flies can squeeze under them and lay eggs.

© 2021 WebMD, LLC. All rights reserved. View privacy policy and trust info

Fruit flies are the worst. One day, you have a perfectly lovely banana sitting on your counter, and the next, you’re hosting a bed and breakfast for a colony of vermin, and they are overstaying their welcome.

Fruit flies can pop up at any time of year, but they are especially common in the summer months when there are generally more fruits and vegetables ripening. They lay eggs on rotting or fermenting food, which hatch into hundreds of larvae. Then those larvae lay eggs, and then those larvae lay eggs, and before you know it you have to move and surrender your home over to the flies.

Luckily, before you give up your keys, there are a few things you can do to get rid of the little suckers. If you follow these steps, you’ll significantly reduce the numbers of these little tyrants and take back your kitchen.

Prevention

It’s much easier to stop the fruit flies from settling down in your space if your kitchen is clean and tidy. Start by cleaning up any areas where food might collect and break down. That means keeping your garbage outside or in a container with a well-fitting lid. Throw your food scraps in a compost bag and keep that in the freezer, rather than letting it sit out at room temperature. Flush out the drains of your sink in case old food has collected there.

If you normally keep fruits and veggies on the counter, try moving them to cooler spots or covering them, especially fruits with a high sugar content that ripen quickly. Try keeping your bananas and tomatoes in a cool drawer or under a dome. Yes, tomato drawers are a thing.

How to capture and kill fruit flies

Photo by Catherine Powell/Shutterstock

How to Trap Fruit Flies

If fruit flies do make your kitchen their hangout spot, there are ways to trap them. They like fermented fruit, so mix a bit of dish soap with old beer, wine or apple cider vinegar. Pour water into the mixture until it bubbles, and leave the glass or bowl on the counter where you spot the flies. They’ll come to the glass because of the fruit sugar, but get trapped in the soap bubbles. You can also fit plastic wrap over the top of a beer bottle or glass of vinegar, and poke a few holes in it. Fruit flies can get in, but they can’t fly out.

If you’re looking for a solution with alcohol, there are commercial traps available, or you can make your own spray by mixing isopropyl alcohol and water. That should kill the flies on contact.

If All Else Fails…

Wait them out. Fruit flies only live for about two weeks, and when temperatures get cooler, they don’t survive long. You can have the sweet satisfaction of watching them drop off as summer turns to fall. Sip your pumpkin spice latte and grin, knowing you’ve outlasted the beasts for another season. Who’s in charge now, fly?

The gross reality is that fruit flies are mostly just annoying, but they do pose slight health risks. They can transport bacteria or germs as they land on food and surfaces in your home, which can occasionally lead to health issues. If you clean up an area with a lot of flies, you should wash your hands well afterwards, and wash any fruits and vegetables that are still on your counters before eating them.

Fruit flies can be a menace in the home, getting into food and multiplying quickly. But getting rid of fruit flies is easier than you might think with this simple homemade trap. It only takes minutes to put together, and you might already have the necessary ingredients in your cupboard. Here's how to make this basic yet effective fruit fly trap.

  • Apple cider vinegar
  • Dish soap
  • A jar or small bowl
The Spruce / Ana Cadena 

Although vinegar is the main ingredient and it is considered safe for consumption, liquid dish soap is not. Keep this solution out of the reach of children.

Before you begin, toss out any overripe fruit that might be attracting fruit flies.

  1. Pour around 1 cup of apple cider vinegar into a jar or small bowl. It doesn't have to be exact.

    The Spruce / Ana Cadena  
  2. Add a couple of drops of dish soap to the jar. Do not mix.

    The Spruce / Ana Cadena  
  3. Place the trap in the area where you've seen the fruit flies, and wait for it to do its job. Soon, the container will be filled with drowned fruit flies. Repeat with a fresh trap as necessary.

    The Spruce / Ana Cadena 

Vinegar is a natural, versatile, environmentally friendly kitchen product. In addition to its cooking uses, it is an inexpensive ingredient in many cleaning DIYs. Plus, unlike many commercial products, vinegar does not emit harmful, harsh fumes.

Fruit flies are attracted to the smell of the cider vinegar and will attempt to land on its surface. However, they will pass through the dish soap on the surface, not be able to get back up through it, and drown.

  • A bottle with a small neck can also be used.
  • Keep a fruit fly trap on your kitchen counter, even after you've trapped your fruit flies. This trap will prevent future infestations from occurring. You can keep it in a pretty container, so it doesn't stand out. The vinegar evaporates over time, so top it off whenever you notice it's getting low.

If you don't have any vinegar on hand, you can also trap fruit flies by placing a piece of overripe fruit in an open plastic bag. Wait for the fruit flies to congregate on the fruit, and then carefully seal the bag, trapping them inside.

If you'd like to try more than making a trap, here are some good solutions:

  • Often infestations occur when you bring home infected fruit from the grocery store or produce stand. If you notice fruit flies when you're shopping, skip any produce that they're near. You can bet there are plenty of fruit fly eggs on that produce just waiting to hatch in your kitchen. When you consider that a single fruit fly can lay 500 eggs, that's a pretty compelling reason to go home without the bananas that you planned to buy.
  • Rinse off fruits that are washable once you get home—apples, stone fruit, bananas, citrus fruits, etc.—to dislodge fruit fly larvae. Plain water works, but you can also use one of those fruit and vegetable washes found in the produce department of your supermarket.
  • Be diligent about eating fruits and vegetables before they become overripe or go bad. Fruit flies like to lay their eggs on ripe or fermented produce. Even better, store them in the refrigerator.
  • Keep your kitchen clean. Fruit flies land and lay eggs on countertops and even in your sink. In fact, be sure there is no food waste leftover in your drain or garbage disposal.
  • Take your trash out regularly (recyclables, too). Small amounts of juice or wine left at the bottom of bottles are enough to catch the attention of a fruit fly. If you can't remember the last time you scrubbed out your kitchen trash can and recycling bins, now might be the time.
  • Periodically throw your reusable shopping bags into the washer before fruit flies remind you that you're overdue.