Food Shopping and Storing How to Get Rid of Fruit Flies and Gnats in Your House Are there pesky little flies all over your day-old bananas and potted plants? Here's how to prevent and get rid of fruit flies and gnats indoors. By Lisa Milbrand Lisa Milbrand Lisa Milbrand has more than 20 years of experience as a lifestyle writer and editor, writing thousands of articles on topics that help people live better and healthier lives for Real Simple, Parents, and dozens of other top publications. Real Simple's Editorial Guidelines Updated on June 22, 2023 Fact checked by Haley Mades Fact checked by Haley Mades Haley is a Wisconsin-based creative freelancer and recent graduate. She has worked as an editor, fact checker, and copywriter for various digital and print publications. Her most recent position was in academic publishing as a publicity and marketing assistant for the University of Wisconsin Press Our Fact-Checking Process In This Article View All In This Article Where Do Fruit Flies Come From? What Causes a Fruit Fly or Gnat Infestation? Gnats vs. Fruit Flies Prevention Best Ways to Get Rid of Fruit Flies and Gnats How to Make a Fly Trap With Vinegar The average lifespan of a fruit fly is 40 to 50 days—aka much longer than any of us would like. Gnats, on the other hand, have shorter lifespans, but their ability to reproduce at rapid speeds means once you swat one, there's pretty much always another one buzzing around. Not only are they a nuisance, but flies can also transport bacteria (think Salmonella and E.coli). Fruit flies and gnats are both extremely hard to get rid of. But if you use a multiphase plan of attack, you should be able to spare not only your produce and plants, but any headaches as well. Not only that, but you can also prevent them. Here's everything you need to know about how to get rid of gnats and fruit flies if you have an infestation. 8 Plants That Repel Bugs and Mosquitoes Getty Images Where Do Fruit Flies Come From? Fruit flies can lay up to 500 eggs at a time near the surface of fermenting (ripening) foods or other organic materials like the soil in your houseplants. They can also lay their eggs in sink drains, garbage disposals, empty bottles and cans, garbage bags, and even damp mops and sponges. What Causes a Fruit Fly or Gnat Infestation? Fruit flies and gnats are tiny enough to slip into your house, attracted to the smells of ripening fruit, organic matter in your drains, open garbage cans, and even houseplants. Once there, they can quickly mate and create hundreds of new ones, creating that infestation. (And given that their entire life cycle is around a month, fruit flies and gnats can mate and grow to multiple generations within a few weeks.) Gnats vs. Fruit Flies To the naked eye, most wouldn't be able to tell the difference between the two. Both gnats and fruit flies are only about 1/8-inch long. The biggest difference is where they like to hang out. Fungus gnats are most likely to be gathered around your indoor potted plants, while you'll find fruit flies around unrefrigerated produce in your kitchen and rotting food in the trashcan. Luckily, you can get prevent and get rid of both gnats and fruit flies in the same way. How to Prevent Fruit Flies and Gnats That old saying, an ounce of prevention is worth a pound of cure definitely comes into play here—and it's much better to keep fruit flies and gnats away in the first place. Eliminate potential breeding grounds Keep in mind that houseflies breed in moist or damp environments. "Common places in your home include the sink area (around, in, or under it), damp clothes or rags, and potted plants," says Blaine Richardson, an associate certified entomologist at Saela Pest Control. "Clean these areas with non-chlorine bleach (mixed with water) and do what you need to avoid future moisture build-up." Don't invite any indoors Keep your windows and doors sealed tight. If you want to open the window to let the breeze in, make sure you have a screen to deter any flies from getting inside. Store and clean up food Don't leave ripened fruit or vegetables—like bananas, onions, tomatoes, or potatoes—exposed; keep them in the refrigerator until the problem is resolved. Fruit flies also tend to like alcohol and other sugary drinks, so be wary of keeping things like an open bottle of wine and juice products out on the counter. Best Ways to Get Rid of Fruit Flies and Gnats Once you have a fruit fly or gnat problem, there are a few different strategies you can use to get rid of the fruit flies and gnats. Use an insecticide If prevention methods don't work, you might want to use an insecticide specifically for gnats, Richardson says. The Environmental Protection Agency advises customers to look at product labels carefully: read the ingredients list, follow the directions to a tee, and check if it has an EPA registration number, which means it's been reviewed by the organization. Product labels will also have the words "Caution" (least harmful), "Warning" (more poisonous than "Caution" products), and "Danger" (very poisonous or irritating). Set up fly traps Fly traps are important control tools that continue to eliminate new adults as they emerge. While a pyrethrum-based aerosol insecticide may be used to kill adult flies if you can hit them, it won't take care of any eggs or larvae lurking in your kitchen. Store-bought fly traps will prevent the flies from breeding and can be purchased at your local hardware store. These disposable fruit fly traps, which are baited with a nontoxic lure, can catch about 2,000 flies each, and can last for one month. One of our favorite traps to buy is Aunt Fannie's FlyPunch which is non-toxic and super easy to use. The 11 Best Fly Traps of 2024 How to Make a Fly Trap with Vinegar Rather DIY than buy a trap? A simple, free, and effective homemade fly trap can be made with a few household items. Here's how. What You'll Need: Empty wine bottle or jar 8-by-10-inch piece of paper Tape 1 tsp. apple cider vinegar What to Do: Form a cone-shaped funnel with an 8-by-10-inch piece of paper. Seal the funnel with tape while leaving a small opening at the narrow end. Place the funnel into a clean, empty wine bottle or jar. Bait the jar with a teaspoon of apple cider vinegar. Place one or more of these traps on counters or in pantries where the pests are seen most often. The fruit flies enter the trap easily, but can't fly out. After you trap all visible flies, kill them with spray or release them outside. Re-bait and replace jar traps, if necessary. Don't have vinegar on hand? You can use a slice of ripe banana instead. Was this page helpful? Thanks for your feedback! Tell us why! Other Submit