Where do fruit flies come from, and how do you get rid of them?

Written by Maxwell Martinson
Updated: July 6, 2022
© kajornyot wildlife photography/Shutterstock.com
Share this post on:


Fruit flies are some of the most harmlessly infuriating bugs in our lives. You’re sitting comfortably in your living room on a lazy afternoon thinking everything’s fine until you stroll past the kitchen and notice dozens of these flies getting up to no good.

It’s a little unsettling because you know they didn’t simply fly in the window. Instead, these flies were born in your kitchen, presumably alongside or inside the food that you eat.

Further, they’re so small that you can’t really go around spotting and swatting them. You’ve got to get craftier to rid yourself of these tiny pests.

We’re going to look at how fruit flies operate, where they come from, and how to get rid of them. Hopefully, the ideas below give you a little more confidence and less anxiety the next time you’re dealing with fruit flies.

What is a Fruit Fly?

fruit flies in test tube
Fruit flies are known as model organisms for study due to their rapid life cycles, few pairs of chromosomes, and large quantities of offspring.

©Chu Xiaolu/Shutterstock.com

The fruit fly, the lesser fruit fly, vinegar fly, and pomace fly are all nicknames for this pesky little bug. Its scientific name is Drosophila melanogaster, which sounds a lot more terrifying than the bug actually looks from a distance.

From our perspective, these tiny bugs are about half the size of a grain of rice. They’re so small that you can hardly see any details of their body without getting very close, and you’d be hard-pressed to notice one that landed on your arm.

Zoom in about 30 times, however, and the fruit fly is cursed with big red eyes, prickly little hairs that look like steampunk spikes, and splotches of color that resemble war paint. In the fruit fly’s defense, most bugs look like nightmare fuel when you get close to them.

One redeeming quality of these bugs is that they’re known as “model organisms” and have been used to study genetics and physiology, directly contributing to six separate Nobel Peace Prizes. (There’s no shame if you swatted a fruit fly as you read that sentence, though.)

They’re easy to study because they have extremely rapid life cycles and very few pairs of chromosomes. They also produce a large number of offspring every time they reproduce, and they reproduce very often. Introducing different variables to fruit fly experiments, then, can yield quick results with high numbers of new individuals to study.

That’s why they populate our homes so quickly as well. The very thing that makes them useful in our understanding of genetics is the thing that makes them so frustrating in our homes!

Still, it seems like you’d be able to prevent a whole generation of bugs from sneaking into your house and reproducing in your food. How can these little thieves get in? Where do fruit flies come from?

Where Do Fruit Flies Come From?

Apples left out in the open have been covered with fruit flies, attracted to their juice
Apples left out in the open have been covered with fruit flies, attracted to their juice

©Anne Webber/Shutterstock.com

Fruit flies spend the majority of their time outdoors, feeding on decomposing foods, feces, and more. These things, while repulsive to humans, are excellent places for flies to eat, mate, and lay their eggs.

In the case of fruit, flies are far more aware of the decomposition cycle than we are. As fruit ferments and decomposes, it lets off different odors. We can smell those byproducts in the late stages of the process, but the process of decomposition is going on from the moment the plant is picked, and is in full swing by the time it reaches that bowl on your kitchen counter.

Flies have evolved to smell decomposing fruit from great distances relative to their size. Odds are that anyone with a bowl of day-old fruit in their house is on the radar of numerous flies in or around that house. Smells seep out of the house through cracks, windows, vents, and more.

Fruit flies are small enough to use those channels to enter the house. In almost all cases, a fruit fly is small enough to follow the smell all the way back to the source without much interference.

So, if you find that some fruit flies got into your home, you didn’t do anything wrong. There are just very small holes or cracks in your house, just as there are in virtually every house.

A Hitchiker’s Guide to The Grocery

Other fruit flies might hitch a ride to our homes. Grocery stores do their best to prevent fruit flies, but odds are that there are fruit flies laying eggs somewhere in every grocery store around the country.

Maybe the eldest apple in your bag is partially rotten. Flies are aware of this long before you could visually inspect the apple and see if it’s rotten. So, the chosen flies floating around the fly-utopia of the grocery store might smell a delightful little trail of rotten apples, making their way to the bag you’re about to buy.

They lay their eggs and, luckily for them, they’re transported all the way to your home. They get the lay of the land, find new fruit, and each female lays around 400 eggs somewhere in your lovely home. Some might not survive, but there are certainly hundreds of viable newborn flies who might lay 400 more eggs sometime in the next few weeks.

Now you’ve got thousands of fruit flies living and laying eggs in your house and you’re two parts disgusted, two parts determined to find a solution.

What can you do to get rid of fruit flies?

How to Get Rid of Fruit Flies

The challenge of a fruit fly infestation is that the flies are constantly reproducing. Plus, after the first generation, the individuals in the population will reproduce at different times, in different places, and create a situation where there are new flies entering the equation at all times.

The good part for us is that they can’t reproduce in very many different places. Unless you have a whole house full of rotting fruit, it’s going to be easy to eliminate places for fruit flies to mate. You just have to find all of the fruit or foods that could rot and remove them from your house.

If your kitchen is relatively clean and you can’t find the source of the flies, you’re in for a small challenge. First, you’ve got to find the source, and there’s definitely a source.

Second, you have to dig deep and get rid of it because it’s probably an old piece of fruit or food that’s tucked somewhere deep in your cabinets. Often, fruit flies turn these isolated spots into hubs of reproduction, making them pretty unsettling to look at, let alone dispose of.

We’re sending you virtual courage for that. Maybe throw a mask and some gloves on to make it a little less gruesome!

Possible Mating Grounds for Fruit Flies

If you’re looking for the source of the flies without any luck, you’re probably very confused. It’s not always the cabinet or the counter. Remember how small these little guys are.

Their size gives them access to nearly every area of your home, and the actual rotting food or waste isn’t always the place to mate. They might find similar areas or spots in your house that have remnants of waste. Unfortunately, those are typically places that we don’t ever look and don’t think to look.

Start by closing up the garbage can. Get rid of the open garbage bags in your house, as you might have thrown an apple core in the can in the bathroom or a chunk of banana next to the bin in your bedroom.

Recycling is another area to contend with. Fruit flies (also called vinegar flies) can reproduce in fermenting liquids as well. That means wine, vinegar, juice, and really any fruit-based old drink bottle you throw into the recycling bin. Flies can smell those things, no matter how deep they’re buried.

You should also look through the closets of your house. Damp, warm, areas are great places for fruit flies to gather. You never know what kind of organic chemistry is working its magic in the closet, providing a little fermentation to attract and house generations of flies.

The same goes for your drains! Drains, especially seldom-used ones are perfect places for fruit flies to lay their eggs. This is a great time to clean your drains just in case that’s where flies are gathering.

You can also check in-and-around your fridge, under your cabinets, and generally anywhere that food could have slid or hidden without your knowledge.

This is a necessary step as you get rid of the flies. Sitting around swatting every fly you see will not help very much. That’d be like plucking individual blades of grass instead of mowing the lawn.

Once you remove the fruit, you can take active steps toward removing the existing flies.

Setting Fruit Fly Traps

Fruit fly trap on blue background
A plastic covered jar of fermenting liquid with tiny holes poked in the top can be a very effective homemade fruit fly trap

©Jeremy da Silva/Shutterstock.com

One of the best ways to attract and capture fruit flies is by setting up a homemade trap. It’s fairly easy, and you probably have everything you need in your home already.

Start by getting a small cup or bowl to use. A standard drinking glass or cereal bowl will work perfectly. Add a healthy amount of the fermenting fruit or liquid into the bowl. You can splash some vinegar on the pile to make it even more enticing to fruit flies.

Once you’ve got that in place, spread a layer of plastic wrap over the top of the container. Make sure it’s tight, then poke numerous holes into the top. The idea is that the flies will be able to enter but unable to leave. You might get a few flies that crawl back out, but odds are that they won’t. 

Further, if you leave a lot of liquid in the container, they’ll probably get stuck in it. Flies get drawn to the liquid, land inside, and they’ll most often get trapped. Set a few of these traps around your kitchen or any areas where you’ve noticed fruit flies.

Another option is to get a mason jar, fill it with the same materials, close it, then poke two or three holes in the metal lid. This method, although very similar, is more effective for some people. 

Experiment with different containers and bait, and you’ll land on something that works well for you. Apple cider vinegar, dish soap, and wine are all other baits that have worked for others. 
You can also look at this guide to using a hydrogen peroxide solution to deter and prevent fruit flies from coming near your home.

Explore Products to Get Rid of Fruit Flies

You don’t have to do it all yourself if your homemade traps aren’t working. There are a number of things you can buy to prevent fruit flies from bothering you. Take a look at our list of products known to get rid of fruit flies.

There are plenty of fly traps designed just for fruit flies. These will even prevent flies from coming into your home if you can place them in the right places. When they’ve already infiltrated, putting a trap near their food source will catch dozens, if not hundreds of them.

You can also invest in carnivorous plants, electronic lures with sticky pads, and a wide range of other pre-made traps!

Want to Learn More About Flies?

  1. How to Get Rid of Fruit Flies with Hydrogen Peroxide
  2. Fruit Flies In Your Drain? 4 Traps To Get Rid Of Them
  3. Discover The Largest Fly In The World
  4. How Big Was the Largest Venus Flytrap Ever?

The Featured Image

fruit fly
Super macro of Common fruit fly Drosophila melanogaster in real nature in Thailand.
© kajornyot wildlife photography/Shutterstock.com

Share this post on:
About the Author

Hi! I'm Max and I'm a writer from Minneapolis, Minnesota. I've been freelancing for more than five years and love the freedom and variety that this profession offers. Animals are also a big part of my life, and a lot of my time is dedicated to playing with my cat, Herbie.

Thank you for reading! Have some feedback for us? Contact the AZ Animals editorial team.