Ages

Now you know where fruit flies come from!

What next?

Try it yourself ↓

Where do fruit flies come from?

▶ 5:18 video · Watch on YouTube

  1. 0:00 Start
  2. 0:58 Following the smell
  3. 1:46 Egg to adult in a week
  4. 2:43 From a few to a swarm
  5. 3:31 The fly that won Nobel Prizes
  6. 4:24 A fly-free kitchen

Your turn

Try the fruit fly experiments

Play with the flies!

Each lab is one part of the video. Change things and see what happens.

Each lab isolates one idea from the video. The models are simplified and the speeds are illustrative.

Tap the buttons and see what happens.

1

Redi's jars

Redi's 1668 experiment

Where do wigglers come from?

Send a fly to each jar, then let three days pass. Which jars get maggots?

Which treatment produces maggots, and what does that say about spontaneous generation?

Send a fly to a jar. What happens?

2

Follow the smell

Odour plume and attraction

Sniff, sniff!

Slide the bananas or change how ripe they are. Do the flies follow?

Riper, more fermented fruit releases a stronger plume. How do the flies respond?

Make the bananas riper. Do more flies come?

3

The life-cycle wheel

Temperature and development time

Egg, wiggler, case, fly

Turn the temperature up or down. How long does egg to adult take?

Development time rises steeply as the room cools. Compare 77°F and 64°F.

Make it warm or cold. Is the wheel fast or slow?

Lab figures (8½ days at 77°F, 19 at 64°F, 50+ at 54°F), joined by straight lines; the wheel is sped up.

4

From a few to a swarm

Exponential growth (toy model)

Fast-forward 20 days, then clear away the fruit partway. What changes?

Remove the breeding material mid-run and watch the next generation vanish.

Toy model with made-up survival: 500 eggs per female, 1 in 10 survives, half are female, a generation every 10 days.

5

Nobel Prize flies

Drosophila Nobel Prizes

Tap each medal. What did fruit flies help discover?

Five prizes, from chromosomes to circadian clocks. Tap to compare.

6

A fly-free kitchen

Remove the breeding sites

Bye-bye, flies!

Tap the circled spots to clear them, then set the trap. Can you get to zero?

Trapping alone leaves breeding sites. Which combination gets you to zero?

Tap the circles. Can you make all the flies go?

Where do fruit flies come from?

Fruit flies come from other fruit flies! They don't pop out of old fruit.

A long-ago test

Long ago, people thought old food could turn into bugs. A doctor named Redi put food in jars. He covered some jars with cloth. Only the open jars got little wigglers, because flies landed there and left eggs.

Super sniffers

Ripe fruit has tiny living things called yeast on it. The yeast makes a sour smell. Fruit flies sniff it with their feelers and follow it into your kitchen. Sometimes their tiny eggs are already on the fruit when you bring it home.

Egg, wiggler, case, fly

A mother fly lays tiny eggs on ripe fruit. A little wiggler comes out and eats the yeast. Then it tucks into a hard case, like a sleeping bag. Pop! Out comes a new fly. When it's warm, this happens fast.

Did you know? Scientists love fruit flies! Studying them has helped win lots of big science prizes.
Bye-bye, flies: eat the ripe fruit or put it in the fridge, rinse the cans, and dry the mop. A grown-up can set a jar trap.

← More explainers

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

StageWhat happensHow long (about 77°F / 25°C)
EggLaid on the surface of ripe, fermenting food; about 0.5 mm longAbout a day
LarvaA tiny, pale grub that feeds near the surface, mostly on yeastAbout 4 days
PupaThe larva's outer skin hardens into a brown case, and inside it the pupa rebuilds its bodyAbout 4 days
AdultClimbs out with wings; ready to mate within hoursWeeks

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.

Generation (toy model)Rough dayFlies
Start02
1stabout 10about 50
2ndabout 20more than 1,000

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

YearWinnersWhat the flies helped show
1933Thomas Hunt MorganGenes are carried on chromosomes, lined up in a row4
1946Hermann J. MullerX-rays can cause mutations (changes in genes)14
1995Edward B. Lewis, Christiane Nüsslein-Volhard, Eric F. WieschausHow genes control the way an embryo develops5
2011Jules Hoffmann (shared)How the body first senses germs and starts fighting them15
2017Jeffrey C. Hall, Michael Rosbash, Michael W. YoungHow the body's internal clock works16

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

  1. Deal with ripe produce. Eat it, throw it out, or put it in the fridge. Check for forgotten potatoes and onions in cupboards.13
  2. Rinse your recycling and keep the bin clean. Empty trash and kitchen compost often.2
  3. Let mops and rags dry fully, and wipe up juice spills, including under the fridge.12
  4. 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
  5. 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.

  1. Pour a little cider vinegar into a clean jar, or drop in a piece of very ripe banana.
  2. 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.
  3. 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.
  4. Put the trap where you've seen flies. They'll follow the smell in through the funnel and struggle to find the way out.
  5. 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.

Did this help it click?

Sources

  1. University of Kentucky Entomology, ENTFACT-621: Fruit Flies (M. F. Potter)
  2. Cornell University Integrated Pest Management, Fruit Flies
  3. University of Wisconsin–Madison Extension, Fruit Flies in the Home
  4. NobelPrize.org, Thomas H. Morgan: Facts (1933)
  5. NobelPrize.org, Nobel Prize in Physiology or Medicine 1995: press release
  6. Encyclopaedia Britannica, Fruit fly
  7. University of Cambridge (2015), How close are you to a fruit fly?
  8. Wikipedia, Drosophila melanogaster (life-cycle figures with cited lab references)
  9. Wikipedia, Francesco Redi (with cited references)
  10. Becher et al. (2018), Chemical signaling and insect attraction is a conserved trait in yeasts, Ecology and Evolution
  11. Lin et al. (2015), Food odors trigger Drosophila males to deposit a pheromone that guides aggregation and female oviposition decisions, eLife
  12. University of Florida IFAS Extension, ENY-2030: Do-It-Yourself Insect Pest Traps
  13. Reiter et al. (2001), A systematic analysis of human disease-associated gene sequences in Drosophila melanogaster, Genome Research 11:1114–1125
  14. NobelPrize.org, Hermann J. Muller: Facts (1946)
  15. NobelPrize.org, Nobel Prize in Physiology or Medicine 2011: press release
  16. NobelPrize.org, Nobel Prize in Physiology or Medicine 2017: press release
  17. Encyclopaedia Britannica, Spontaneous generation
  18. NIGMS (National Institutes of Health), Research Organism Superheroes: Fruit Flies (2024)
  19. University of California Statewide IPM Program, Fruit Flies