Where do fruit flies come from? The short answer
Fruit flies come from other fruit flies. They don't grow out of rotting fruit. They get into your kitchen in two main ways:12
- As eggs on food. Females lay tiny eggs on ripe fruit and vegetables at the farm, garden or shop, and you carry them home in your shopping bag.
- As adults following a smell. Adult flies are drawn to the sour smell of ripening, fermenting fruit. At only about an eighth of an inch long, they slip in through gaps in window screens and around doors.1
Once inside, a few flies can become a cloud in about a week, because each female can lay around 500 eggs and the trip from egg to adult is so short.12
ripe fruit → yeasts and other microbes make fermenting smells → flies follow them, or eggs arrive on the fruit → a new generation in about a week
Why do fruit flies seem to appear out of nowhere?
For centuries, many people believed in spontaneous generation: the idea that living things could spring from non-living stuff, like maggots from rotting meat.9 In 1668, the Italian doctor and scientist Francesco Redi tested it. He put meat and fish in jars. He left some jars open and covered others with fine gauze, so air could get in but flies couldn't. Maggots appeared only in the open jars, where flies had landed. In the covered jars, no maggots grew on the meat.9
Redi's conclusion is often summed up in Latin as omne vivum ex vivo: "all life comes from life".9 Almost two hundred years later, Louis Pasteur showed that even tiny microbes come from other microbes, which finished off the old idea for good.17 The same is true in your kitchen. Fruit flies seem to appear from nowhere because their eggs are tiny, about half a millimetre long, and easy to miss on the skin of a banana or tomato.82 (Redi used meat flies, not fruit flies, but the lesson is the same. In the video, his jars are drawn with simple meat shapes.)
What causes fruit flies? The smell of fermenting fruit
Fruit flies are drawn to fermenting fruit, and their larvae feed largely on yeast. Wild yeasts live on the skins of fruit, and as fruit ripens they feed on its sugar. This is called fermentation. Yeasts and other microbes release smells as they work, and some of those smells, like vinegar, are sour.23 (Curious where those yeasts come from? See where yeast comes from.)
Fruit flies smell with their antennae, the short feelers on the front of the head, which pick up odours and air currents.8 In lab tests, fruit flies flew toward the smell of every one of nine different kinds of yeast scientists tried.10 In one lab study, the smell of cider vinegar even made male flies leave a scent mark that drew other flies to the spot and told females it was a good place to lay eggs.11
That is why fruit flies turn up wherever something is quietly fermenting: a bowl of ripe fruit, a drain, a trash can, unrinsed bottles and cans in the recycling, or a damp, sour-smelling mop. All they need is a moist film of fermenting material.13 They're most common in late summer and autumn, when there's lots of ripe produce around.1
How are fruit flies born? The life cycle
Fruit flies go through four stages: egg, larva, pupa and adult. This is called complete metamorphosis, the same kind of change a caterpillar makes into a butterfly.819
Stage times from lab studies and the University of Cambridge fly lab.78
Because the larvae feed only near the surface, extension scientists say you can cut away the damaged or over-ripe part of a fruit rather than throwing the whole thing away.1
Temperature makes a big difference. Fruit flies are cold-blooded, so they develop faster when it's warm. University extension experts put the whole egg-to-adult trip at about a week to ten days in a warm home.123 The National Institutes of Health gives 10 to 12 days.18 In the lab it takes about 8½ days at 77°F (25°C), about 19 days at 64°F (18°C), and more than 50 days at 54°F (12°C).8 That is one reason putting ripe fruit in the fridge helps so much. The temperature lab below uses these lab figures, joined up with straight lines between them.
How fast do fruit flies multiply?
Very fast. A single female can lay about 500 eggs,12 and her daughters can start laying their own eggs soon after they become adults.8 Suppose only one egg in ten survived. One pair would still produce about fifty flies in a generation, and those fifty could produce more than a thousand in the next.
A made-up toy model, not a measurement: it assumes 500 eggs per female, that 1 egg in 10 survives, that half the survivors are female, and a new generation every 10 days. Real numbers depend on food, temperature and crowding.
This is why the University of Kentucky warns that a single forgotten rotting potato or onion, or a recycling bin that is never cleaned, can breed thousands of fruit flies.1 The same kind of runaway growth happens with other fast breeders too, like bacteria, which split in two.
Why do scientists love fruit flies?
The same things that make fruit flies annoying in a kitchen make them wonderful in a lab. They are cheap to feed (lab flies eat a mush of cornmeal, sugar and yeast), they are easy to keep in huge numbers, and a new generation arrives in about ten days, so scientists can follow traits through many generations in just a few months.78
Even more surprising, flies and people share a lot of the same basic biology. When scientists compared 929 human disease genes with the fruit fly's genes, 77% had a recognisable match in the fly.13 That's roughly three out of four, and it's why studying flies can help doctors understand human illnesses. (Learn more about why DNA is so important.)
Nobel Prizes won with fruit flies
How to get rid of fruit flies
Swatting the adults won't fix the problem if they still have somewhere to breed. Extension entomologists agree: find and remove the breeding spots first, then trap the flies that are left.123
- Deal with ripe produce. Eat it, throw it out, or put it in the fridge. Check for forgotten potatoes and onions in cupboards.13
- Rinse your recycling and keep the bin clean. Empty trash and kitchen compost often.2
- Let mops and rags dry fully, and wipe up juice spills, including under the fridge.12
- Check the drains. Tape a clear plastic food bag over a drain overnight. If flies are breeding inside, they'll be caught in the bag by morning.1
- Fix the screens. Tight-fitting window and door screens keep adults from flying in.1
Try it at home: make a fruit fly trap
This is the trap extension scientists recommend.12 Ask an adult to help, especially with any cutting or poking.
- Pour a little cider vinegar into a clean jar, or drop in a piece of very ripe banana.
- Roll a sheet of paper into a cone with a small hole at the tip (just a few millimetres wide). Tape it so it keeps its shape.
- Set the cone in the mouth of the jar, tip pointing down, so the tip doesn't touch the bait. Tape the edges to the jar.
- Put the trap where you've seen flies. They'll follow the smell in through the funnel and struggle to find the way out.
- Check it daily. Release the flies outdoors, far from the house, and replace the bait every few days so no new larvae grow in it.2
Another version from the University of Florida: a cup of apple cider vinegar with one drop of dish soap, covered with plastic wrap held on by a rubber band, with a few small holes poked in the top. The soap breaks the surface of the liquid, so flies that land on it can't climb out.12 Have an adult poke the holes.
Common myths about fruit flies
"Fruit flies come from rotting fruit." Rotting fruit attracts them and feeds their young, but every fruit fly hatched from an egg laid by another fruit fly.
29
"Fruit flies mean your house is dirty." Often they arrived as eggs on normal fruit from the shop. One forgotten onion is enough to start a swarm.
12
"Fruit fly larvae eat the fruit." The larvae mainly feed on the yeast growing on fermenting fruit, near its surface.
23
"Kill the adults and the problem is solved." If breeding spots remain, new flies keep hatching every day. Clean up the source first.
1
"Fruit flies are useless pests." They're one of science's most useful animals, with at least five Nobel Prizes to show for it.
4516
"Fruit flies are as dangerous as other flies." Fruit flies are mainly nuisance pests. Unlike
mosquitoes, they aren't after your blood, and Cornell entomologists say there's no evidence they spread disease the way house flies can. Still, they land on spoiling food, so keep them off things you'll eat.
12
FAQ
Why do fruit flies seem to appear out of nowhere?
They don't. Fruit flies often come home as tiny eggs or larvae on fruit and vegetables, or adults fly in through small gaps in screens and doors. A female can lay about 500 eggs, and in a warm kitchen egg to adult takes only about a week to ten days, so a few hidden flies can become many quickly.
What causes fruit flies in the house?
Fruit flies are drawn to ripe and fermenting fruit and vegetables, and to anything with a moist film of fermenting material: drains, garbage disposals, trash cans, unrinsed bottles and cans in recycling, and damp mops or rags. Wherever that film exists, they can lay eggs and breed.
Where do fruit flies come from if there's no fruit?
They can breed in drains, garbage disposals, the bottom of trash cans, unrinsed recycling, a forgotten potato or onion in a cupboard, spilled juice under the fridge, or a sour-smelling mop. A clear plastic bag taped over a drain overnight will catch any flies breeding inside.
Is my house dirty if I have fruit flies?
Not necessarily. Very often the flies arrived as eggs on perfectly normal fruit from the shop. They are especially common in late summer and autumn. Clearing away ripe fruit and anything fermenting is what stops them.
How are fruit flies born?
A female lays eggs about half a millimetre long on the surface of ripe, fermenting food. After about a day, a larva hatches and feeds mostly on yeast for about four days. After about four days it becomes a pupa inside a hard brown case, and about four days later an adult fly climbs out. In a warm room the whole trip takes about a week to ten days; in the cold it takes much longer.
How do you get rid of fruit flies?
Remove what they breed on: eat, throw away or refrigerate ripe produce, rinse recycling, empty the compost often, keep drains clean, and let mops and rags dry. Then catch the remaining adults with a trap, such as a jar of cider vinegar with a paper funnel in the top.
How long do fruit flies live?
In the lab, at about 77°F (25°C), a fruit fly can live around 50 days from egg to old age. About a week or so of that is spent as an egg, larva and pupa; the rest is adult life, which is plenty of time to lay hundreds of eggs.
Sources
- University of Kentucky Entomology, ENTFACT-621: Fruit Flies (M. F. Potter)
- Cornell University Integrated Pest Management, Fruit Flies
- University of Wisconsin–Madison Extension, Fruit Flies in the Home
- NobelPrize.org, Thomas H. Morgan: Facts (1933)
- NobelPrize.org, Nobel Prize in Physiology or Medicine 1995: press release
- Encyclopaedia Britannica, Fruit fly
- University of Cambridge (2015), How close are you to a fruit fly?
- Wikipedia, Drosophila melanogaster (life-cycle figures with cited lab references)
- Wikipedia, Francesco Redi (with cited references)
- Becher et al. (2018), Chemical signaling and insect attraction is a conserved trait in yeasts, Ecology and Evolution
- Lin et al. (2015), Food odors trigger Drosophila males to deposit a pheromone that guides aggregation and female oviposition decisions, eLife
- University of Florida IFAS Extension, ENY-2030: Do-It-Yourself Insect Pest Traps
- Reiter et al. (2001), A systematic analysis of human disease-associated gene sequences in Drosophila melanogaster, Genome Research 11:1114–1125
- NobelPrize.org, Hermann J. Muller: Facts (1946)
- NobelPrize.org, Nobel Prize in Physiology or Medicine 2011: press release
- NobelPrize.org, Nobel Prize in Physiology or Medicine 2017: press release
- Encyclopaedia Britannica, Spontaneous generation
- NIGMS (National Institutes of Health), Research Organism Superheroes: Fruit Flies (2024)
- University of California Statewide IPM Program, Fruit Flies