How to Get Rid of Fruit Flies

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

Where Fruit Flies Come From

No matter where in the U.S. you live, fruit flies can show up on your kitchen counters or inside your trashcan. 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.

Why Fruit Flies Are a Health Risk

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.

How to Get Rid of Them

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 a trap. Place 3/4 of an inch of apple cider vinegar or white vinegar with a scrap of fruit (like an apple core) into a lidded plastic container. Cut a dime-sized hole into the lid, then place a funnel into it. You can also fashion a funnel from a rolled-up piece of paper. Make sure there's some room between the bottom of your funnel and the vinegar. Place the finished trap anywhere you've seen fruit flies. Once the sweet smell lures them into the container, they'll get stuck in the vinegar.

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.

How to Stay Free of Fruit Flies

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.

Empty your kitchen trash can every day. When you do, clean up any spills, since these can attract fruit flies, too.

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.

WebMD Medical Reference Reviewed by Christine Mikstas, RD, LD on July 07, 2019



Journal of Food Protection: Fruit Flies as Potential Vectors of Foodborne Illness.

University of Kentucky College of Agriculture, Food and Environment: "Fruit Flies."

Eco-Cycle: "All About Composting."

Michigan State University Extension: "How To Get Rid of Fruit Flies In Your Home."

Northwest Center for Alternatives to Pesticides: "Fruit Flies."

CDC: "Burden of Foodborne Illness: Findings."

PennState Extension: "Vinegar Flies." Pest Management Association: "Fruit Flies."

© 2019 WebMD, LLC. All rights reserved.