4 Things that attract fruit flies: Causes & how long they live

Are you a big fan of bananas? You might answer yes to that question. But a few creatures like bananas far more than you do. We’re talking about fruit flies. These annoying gnats can take over your week’s supply of fruits and veggies, so you never think about eating healthy. 

The fruit fly, also known as Drosophila melanogaster, has an insatiable appetite that transcends taste. It explains why they’re attracted to rotting material exclusively. Keep reading to learn more about fruit flies, what they do, and where they go! 

Here are the 4 things we’ll cover:

  • Decaying food
  • Puddles of waste & water
  • Fermented beverages
  • Fruit

How do fruit flies just appear out of nowhere?

fruit flies on an apple

One of nature’s biggest mysteries is how fruit flies appear out of nowhere, which led many people in the past few centuries to believe that they’re supernatural insects. The truth is these pesky critters (or Drosophila melanogaster) don’t just emerge out of thin air. Instead, the pesky insects make their way into your house through the tiniest holes and spaces because they’re just that small. They can even enter through your window screen! 

Their small size and incredibly quick breeding cycle make it seem like they magically appear in your house. 

What attracts fruit flies

Fruits aren’t the only thing that draws them in, despite having the word “fruit” in their name. Multiple other factors lure these creatures in, such as:

Decaying foods

The sheer smell of fermentation alerts these creatures from miles away. Whether it’s overripe bananas out in the open or just a heap of garbage, these tiny nuisances know where the party is. 

Puddles of waste

They’re big fans of damp places like kitchen sinks, mops, and water puddles. They actively look out for any place that presents an opportunity to harbor these critters. Since these places also tend to be rich food sources, the flies see them as a fitting resting place.

Fermented beverages

They might sense your big glass of wine and fly toward it. Thanks to their keen sense of smell, you don’t even need to open a window for them to get a whiff. They use their antennae to detect odors nearby and fly toward whatever they deem fit. 

Unrefrigerated fruit

The scent doesn’t travel in one continuous stream as in cartoons. It travels in whiffs. If that blows away before it reaches a fruit fly, they’ll never know what delicious stuff awaits them. To compensate for this, flies start to scan their surroundings and look for round objects that could be fruits. When you leave your produce out in the open, it ripens quicker. Consequently, the insects sense this and fly towards the ripening sweetness. 

The way they use their vision and sense of smell together to sense where the fermentation smell is coming from is what makes them so good at their job. It’s also what makes them even more annoying! 

fruit flies on a banana

Where are these fruit flies coming from

Fruit flies aren’t picky eaters. They’ll gobble up any rotting material, and it doesn’t even have to be food. Their wide palette makes everything inviting to them. But even then, there are only three ways they enter your house. 

Firstly, fruit flies are probably the world’s tiniest intruders. These critters will catch a whiff of ripened fruits, vegetables, and empty bottles of revenue trash bags and come running towards it. They’ll find their way into your house through your window screen or even the tiniest crack. 

They’re about 6-8 mm long and 3 mm in width, just the right size to sneak into your house without making a peep. 

Secondly, their keen sense of smell brought them to you. Even outside your house, they can sense the smell of fermentation from miles away. Once they start following that scent, it’s only a matter of minutes till they find the source. 

Thirdly and lastly, you might have brought them inside yourself! You might have brought fruit that’s secretly home to insect eggs into your house. Their eggs are minuscule and measure up to half a millimeter. Unless you have super sight, it’s extremely easy to miss them. 

So when you were bringing home the best bunch of bananas, you also brought a whole new generation of fruit flies into your house. Any sort of unrefrigerated fruit at the farmer’s market or grocery store is a breeding ground for these pesky insects. 

How do fruit flies form

Now that the fruit flies have an undercover party in your pantry, what’s going to happen to them? 

Like most insects, these critters go through four stages in their whole life. To understand the full story, let’s start at the beginning. 

The female lays about 400 eggs in her lifetime, with up to 20 eggs at each interval. A few days later, the eggs hatch into larvae. Even at this stage, they’re too small to see. But they usually lay eggs inside ripening fruit, so the eggs and larvae have enough food. These eggs are only half a millimeter in length and are shaped like a grain of rice. 

The maggots feast on the fruit alongside the bacteria already entered when the female first laid eggs. It’s because of the joint efforts of the maggots and the bacteria that the fruit starts to rot from the inside out. 

Later on, these larvae slowly change into hard pupae. Inside this hard case, you won’t find a beautiful butterfly. Instead, you’ll come face-to-face with a nasty adult fruit fly. The adult bug is easy to identify since they’re usually brown-yellow or brown-black with tiny red eyes. Though they’re only an eighth of an inch, you’ll usually see them hovering over food scraps

These pests can live up to 40-50 days with the right conditions. But before they die, they’ll ensure they leave behind enough of their kids to give you a headache!

fruit flies

Where do gnats lay eggs?

The infamously irritating pests use rotting and damp material as their playground. When one fruit fly sees a potential breeding ground, it calls all of its friends over. That is why they swarm up in one place in just a blink of an eye. 

Other than sweet fruits, they also dive right into vegetables a few days from going bad. But all this isn’t enough for them. They’ve been annoying brewers and winemakers for years now. If you leave your beer or wine out in the open for just a few minutes, they’ll find a way to join your cocktail party. 

These dirty critters like to roam around in some of the most unsanitary places known to man, which makes them much more dangerous than they look. Their size and speed might not be too impressive, but the microbes they carry will astonish you. It’s while buzzing through routine garbage. They encounter many deadly microbes, such as listeria, E.coli, and salmonella. 

Don’t think they’re harmless because of their name and preference for food. These bugs are just as disgusting and harmful as cockroaches, rats, and other vermin. 

How long does it take for fruit flies to die

Most popular myths suggest that fruit flies die in just a day, which is why many people just let them be. But they can live up to 40 to 50 days if the conditions are right. Even if the conditions are bad, they can survive for about seven days without any food. 

These resilient creatures can even survive the winter by slowing down their bodies. Sometimes, they can get through the cold nights in their adult stage. Other times, they alter their reproductive cycles and focus on laying eggs only when there’s enough food and warmth. 

These creatures prefer warm and humid areas but can’t handle temperatures higher than 45 for more than 20 minutes. If you have an infestation, you might have to heat your fruits and then eat them! 

How long do fruit flies live without food?

Fruit flies can fight a lot of conditions. But since their lives revolve around food, they can only survive up to 7 days without it if they’re lucky. Usually, starvation occurs after 4 to 5 days of no food. 

fruit fly up close

You can use this factor to get rid of them by clearing out any sort of food source in the open. Make sure to keep your fruits refrigerated, your drains clean, and all your mops completely dry. When you clear out their food source, you also take away their breeding ground. 


Drano is a great product to consider. Here is some more information on it. It can help you avoid the drains becoming breeding ground for flying critters.

NameDrano Max Gel Drain
Size80 ounces
Time to action7 minutes
Great againstClogs


  • A lot of competing products are less effective.
  • It’s the drain cleaner on Amazon with the best value.
  • It can also help if hair is stuck.
  • It helps avoid a breeding ground in your pipes.


  • Any drain cleaner should be rinsed out of the pipes once you’re done.
  • You will want to avoid it coming in contact with skin.

Where do fruit flies hide?

The pesky bugs lay eggs in the most suspicious places, and the size of their eggs just makes them all the more noticeable. Moreover, fruit flies will find a way to live anywhere. So here’s a list of all the places you might want to check: 

Places where fruit flies liveSolution
DrainsUse a drain cleaner once in a while.
Garbage disposalsAvoid unnecessarily putting food down the garbage disposal. Throw most of it in the trash. Rinse the garbage disposal after use by letting the water run.
Empty bottles & cansThrow away empty bottles. Empty reusable bottles after use.
Trash containersEmpty them more often, especially when runny waste is thrown out.
MopsMake sure mops are dried quickly, preferably outside.
Cleaning ragsHang cleaning rags so they can dry as fast as possible.

Unrefrigerated fruits and vegetables

Just as you wait for your produce to ripen before you make fruit tarts or vegetable pies out of it, the insects also anticipate the moment it turns bad. When fresh produce is left unrefrigerated, the flies jump at the first chance to devour the decaying food whole.   

Anywhere near open trash cans and bags

The pesky creatures are always on the hunt for food. And for an insect, what could be more inviting than the rotting smell of trash?

Inside sink and drains

Sinks and drains are to the flies what a gingerbread house is to us. The insects gravitate towards congested places harboring filth. Not only does it provide suitable living conditions, but it often ensures a decent food supply. 

Anywhere where there are spilled garbage juices

You might have seen bees hunt flowers with the most nectar. Similarly, fruit flies tend to go after garbage, oozing with foul-smelling liquids. The pesky insects are attracted to the decaying smell of the trash, and the juices that come out of it are the most inviting.   

fruit flies on a lime

Cabinets where mops and rags are stored

You may think that a cleaning cupboard might be the last place these pesky bugs reside. But when you fail to clean the cleaning supplies, the rotten foods and their juices linger on their ends. Consequently, the flies loiter around the remains to get a taste.  

If you can’t find where these pesky flies are hiding, try placing a glue board in different locations. This way, you can monitor the number of flies stuck on it and narrow down the areas where the flies could be hiding. 

Where do flies go at night?

Fruit flies rest during the night and lets the mosquitoes take over. Fruit flies are generally active during early mornings and evenings since they prefer relatively cooler weather. When the sun goes down, these flies find shelter under:

  • leaves
  • twigs
  • sticks
  • rocks
  • and tall grass. 

Sometimes, they can continue to sleep up to 12 hours continuously. It might actually be the best time to spray insecticides to rid of these intruders once and for all. 

A recent study showed that some fruit flies changed their behavior when socially isolated, much like humans! The isolated flies started to sleep less and eat more. As simple as these bugs seem, the way they interact with each other and food source is far more complex than most people think.  

Why are flies so bad this year?

The amount of fruit flies in your area and house depends on how humid and wet it is. They reproduce in decaying organic matter. So when there are a lot of rainfall, their reproduction rate increases. Water starts to fill the trash cans and form puddles in the middle of the road, which is an open invitation for fruit flies. 

During the last couple of years, people noticed more fruit flies in their houses. The reason for that is that since people started spending more time at home, they produced more trash. 

Besides keeping the fruit fly hotspots clean, you can also make cider vinegar traps to get rid of them. 

Make sure you address these things.

  • Have you made sure there’s no fruit laying out?
  • Have you made sure fermented beverages are in the fridge?
  • There are no puddles of waste or water
  • Decaying food is thrown out in a closed container.


Are fruit flies attracted to light?

Depending on the time of the day, fruit flies prefer a range of lights. For instance, they prefer green lights in the mornings and later afternoons. During midday, they are more attracted to red light. Surprisingly, fruit flies try to avoid blue light no matter the time of day. 

Are fruit flies bad to have at home?

Fruit flies don’t just hover over your fruits. They also speed up the rotting process. They can also infect your food and introduce you to dangerous microbes. All three factors can greatly affect your health if the infestation isn’t addressed. If you ingest fruit fly eggs, it can lead to interstitial myiasis. Soon, you might experience vomiting, diarrhea, and pain in your abdomen. 

Do flies lay eggs on food?

When a fruit fly has landed on a piece of food for quite some time, it’ll eventually start laying eggs. First, they’ll consume it and then lay eggs that can hatch in about 48 hours into maggots. They don’t just lay eggs inside food but also speed up the rotting process. 

Do fruit flies die on their own?

You might have thought fruit flies live only for a day or less, but they can thrive for up to 40-50 days! If you leave them alone, the infestation will only get worse. Even if you cut off the main source of their food, they’ll find a way to survive on crumbs, spills, and waste food. They can survive off moist and decaying material in places such as dirty kitchen sinks, mops, and even water puddles. 

Does vinegar attract fruit flies?

Vinegar is produced through fermentation, which is precisely what attracts fruit flies. Vinegar is often used to lure and trap these pesky flies.