Where Do Fruit Flies Come From?

These stealthy little guys smell rotting fruit from miles away.

bowl of cut fruit with knife

Treehugger / Christian Yonkers

It often seems like fruit flies just appear out of nowhere. In fact, it appeared that way to so many people that they believed fruit flies were a product of spontaneous generation—spawned supernaturally from rotting fruit or meat. This theory was disproved a few hundred years ago and we now know the truth about these tiny nuisances.

What's the Truth?

open kitchen window with cut fruit
Treehugger / Christian Yonkers

The truth is that fruit flies (or Drosophila melanogaster, as they are scientifically named) are stealthy little guys that seem to smell rotting fruit from miles away. They don't come from inside the fruit, but rather come from outside once the fruit on your kitchen counter starts to go just past ripe.

"But all my doors and windows are closed!" you say. "How could they possibly get in?" Fruit flies are so tiny that they can enter through the tiniest of crevices around windows or doors and can even fly through a window screen.

When fruit is overripe or starts to go bad it begins to ferment, it produces alcohol, which attracts fruit flies. They continue to gobble up the fermenting fruit, and in the process, lay hundreds of eggs that hatch into larvae in mere hours. (Each female can lay 50 eggs a day.)

If you've ever gone out of town and left a bowl of ripe fruit on the counter, then you know this all too well. Upon your return, your kitchen is a fruit fly fiesta. By the way, you can bring fruit flies home from the store with your groceries if the fruit has already started to rot there.

How Do You Get Rid of Fruit Flies?

close shot of cut strawberries in clear bowl
Treehugger / Christian Yonkers

Well, first things first—you need to get rid of the offending fruit or vegetable. Cut out any rotting parts and eat the rest, if you can; otherwise, toss it in the compost before it contaminates other fresh produce.

Even after the fruit is gone, though, fruit flies can live on the bottom of mops, dirty drains, and old sponges. Be sure to launder mops and rags, and clean the drain by pouring 1/2 cup of salt, 1/2 cup of baking soda, and 1 cup white vinegar into it and leaving overnight. In the morning, pour in a generous amount of boiling water.

A tried and true method I have used is to smack them silly—though often you'll miss them (even though they're floating right in front of your nose, somehow they seem to escape) and you'll end up with sore hands in the process.

But this still doesn't get rid of every single last one of them ... and that's crucial if you don't want to be killing fruit flies for the next month. So what to do?

fruit fly trap in glass jar with funnel
Treehugger / Christian Yonkers

Many suggest putting beer in the bottom of a glass bottle with a paper funnel out the top. The fruit flies are attracted to the bait and can get in quite easily, but somehow never figure out how to get out. All you have to do is leave this out for a couple of hours, cap the bottle when you're done, and— voilà—the fruit fly problem is resolved.

Another trap method is to put apple cider vinegar and a few drops of dish soap in a microwave-safe bowl. Microwave it until it's warm and aromatic. Set it out as bait, and the fruit flies, attracted by the vinegar, will get caught by the reduced surface tension created by the dish soap.

Another tactic is to put all fruits and vegetables in the fridge temporarily until the fly infestation has been dealt with. Clean out the garbage and wipe down all counters, sinks, and other surfaces that could harbor fruit flies or eggs. Be sure to check all new incoming produce for nicks or scratches that might be harboring eggs. Wash and dry to be extra sure.