Fruit flies or fungus gnats: how to tell them apart in two seconds, where each one is coming from, and the fix for each
Two tiny flies that get the same name and need opposite fixes. How to tell a fruit fly from a fungus gnat by where it hovers and how it is built, what each one is breeding in, and why the vinegar trap only works on one of them.
Quick answer
Look at where they hover. Tiny tan flies with red eyes over fruit, bottles or the bin are fruit flies, breeding in something fermenting. Thin, dark, long-legged flies rising from a plant pot are fungus gnats, breeding in wet potting soil. Remove the fruit for one, let the soil dry for the other.
About Peekabug
Peekabug names the bug in your photo, tells you whether it is a problem and what to do.
On this page · 7
“Tiny flies in the house” is two different problems. One lives on your fruit bowl and the other in your houseplants, and the fix for one does nothing for the other. The University of Wisconsin notes that fungus gnats are often mistaken for fruit flies. Telling them apart takes about two seconds.
The two-second test: where it hovers, and how it is built
First, where. Fruit flies hang in the air over ripe fruit, open bottles, the recycling and the bin. Fungus gnats stay near plant pots, where they run across the soil or drift up when you water. UC IPM, the University of California’s pest programme, adds that they are drawn to light, so strays end up at the window.
Second, the build. The common fruit fly is small and stout. The University of Kentucky gives it as about an eighth of an inch (3 mm) long, tan at the front and black at the rear, usually with red eyes. A fungus gnat is about the same length but dark and delicate, with long legs and antennae longer than its head. UC IPM describes it as similar in appearance to a mosquito. Fungus gnats are not in our Field Guide; the nearest shape on a card is the common house mosquito, only much smaller.
A third tiny fly, the drain fly or moth fly, turns up in bathrooms and belongs in the same line-up.
| Fruit fly | Fungus gnat | Drain fly | |
|---|---|---|---|
| Looks like | Stout, tan, usually red eyes | Dark, slender, long legs, like a tiny mosquito | Grey, fuzzy, moth-shaped |
| Where you see it | Over fruit, bottles, bins | On and around plant pots, at windows | On walls near sinks, showers and toilets |
| How it flies | Hovers and circles | Weak, short, erratic flights | Short hops when disturbed |
| Breeds in | Fermenting fruit, vegetables and sticky residue | Moist potting soil | The slime film in drains and standing water |
| Egg to adult | About a week to ten days | About three to four weeks | About 10 to 15 days |
Pictures are not to scale.
The life-cycle figures are for warm rooms, from Kentucky and Wisconsin (fruit flies), Wisconsin and Colorado State University Extension (fungus gnats) and Kentucky (drain flies). A house fly is a good deal bigger than any of the three: Penn State Extension puts the hairy, dark grey drain fly at about a third of its size.
Where each one is coming from
Fruit flies come from something fermenting. Kentucky’s fact sheet explains that they lay their eggs near the surface of fermenting food or other moist organic material, and that an infestation often starts with ripe produce brought into the house, or with adults flying in from outside. It does not take much: Kentucky notes that a single rotting potato or onion forgotten at the back of a cupboard can breed thousands.
Kentucky says fruit flies can be around all year but are especially common in late summer and autumn, when ripe produce comes in from the garden. Our own data agrees. On Common Fruit Fly, iNaturalist research-grade records peak from August to November, and September has about ten times as many records as March.
Common Fruit FlyPeak is Aug–Oct.
Fungus gnats come from wet potting soil. Colorado State University Extension says the larvae live in the top few inches of the growing medium, feeding mainly on fungi, algae and decaying plant matter, and that the adults are strongly attracted to soil that stays moist. Colorado State notes that they are most noticeable in late autumn and winter. Plants that spent the summer outdoors come back in carrying them, and in short, cool days a plant uses less water, so a pot watered on the summer schedule stays wet.
Drain flies come from the plumbing. The University of Kentucky says their larvae live in the slime layer of drains, toilets and tanks that are not used often, which is why they tend to appear after you have been away.
Are they harmful?
Mostly they are a nuisance. Kentucky calls fruit flies primarily nuisance pests, with one caution: they can carry bacteria and other organisms onto food. Fungus gnat adults do not bite people or damage plants, according to UC IPM. The larvae can damage roots when numbers are high, but Wisconsin describes that as rare in homes, and the Royal Horticultural Society says established plants are unlikely to be harmed. Seedlings and soft cuttings are the ones to watch.
Of the 181 species in our Field Guide, the fruit fly is one of only eight whose habitat is listed as indoors and nothing else.
The fix for each
In both cases the fix is whatever the larvae are living in, not the adults you can see.
Fruit flies: find the source and remove it.
- Eat, refrigerate or throw out ripe produce. Kentucky adds that because the larvae feed near the surface, a damaged part of a fruit can be cut away and the rest kept.
- Check the hidden places. Wisconsin lists the bottom of the bin, bottles and cans waiting to be recycled, and sour mops and rags.
- Not sure about a drain? Kentucky suggests taping a clear plastic bag over it overnight and checking for flies in the morning.
- For the adults left over, Kentucky describes a trap made from a jar, a paper funnel and a little cider vinegar. It catches what is flying; it does not replace finding the source.
Fungus gnats: dry the soil.
- Let the top inch of the soil dry out before you water again. Wisconsin calls reducing moisture the single most important step, and suggests watering from the bottom, or a layer of coarse sand on top, to keep the surface dry.
- Yellow sticky cards near the plant catch adults and show whether numbers are falling.
- To find which pot is the source, lay a slice of raw potato on the soil and look underneath after three or four days.
- For a heavy infestation, Wisconsin and UC IPM both mention products based on the bacterium Bacillus thuringiensis subspecies israelensis, which acts on the larvae in the soil. UC IPM says insecticides are generally not recommended for fungus gnats around the home.
Drain flies: clean the drain. Kentucky says the most effective step is to clean pipes and traps thoroughly so the slime layer is gone, and not to pour insecticide down the drain.
Still not sure which one it is?
Flies this small are hard to photograph, but a sharp close-up in the identifier will suggest a name and say how sure it is: Likely, Possible or Best guess. The flies section of the Field Guide has the cards, and our guide to flying insects in the house covers the larger suspects.
Drop a bug photo hereor paste it, or choose a file
JPEG, PNG or WebP · one bug, filling the frame, in daylight works best
3 of 3 free scans today
No free scans left today.The app has its own 3 free scans a day.
Your photo is shrunk in your browser and sent to Peeka only to identify it. We do not keep it.
Questions
How do I know if I have fruit flies or fungus gnats?
Check where they gather and how they are built. The University of Kentucky describes fruit flies as about an eighth of an inch long, tan at the front and black at the rear, usually with red eyes, and they hover around ripe fruit, bottles and bins. Fungus gnats are dark and delicate with long legs, and the University of California's IPM programme compares their shape to a mosquito's. They stay near houseplants and walk across the soil.
Why do I have gnats in my house when there is no fruit out?
They are probably fungus gnats, and they are coming from potting soil rather than food. Colorado State University Extension says the larvae live in the growing medium of houseplants and that adults are drawn to soil that stays moist. If there are no plants either, look at the drains: the University of Kentucky notes that drain flies breed in the slime layer of sinks, floor drains and toilets that are not used often.
Does a vinegar trap work on fungus gnats?
No. The University of Wisconsin's fact sheet on fungus gnats says vinegar traps and the other methods used for fruit flies do not work for fungus gnats. Yellow sticky cards placed near the plant catch the adults, and a slice of raw potato on the soil shows whether larvae are living in that pot.
Are fungus gnats harmful to people or to plants?
Not to people: the University of California's IPM programme says the adults do not bite and do not damage plants. The larvae feed mainly on fungi and decaying matter in the soil, and can chew roots when there are a great many of them. The Royal Horticultural Society says seedlings and soft cuttings are the plants at risk, and that established plants are unlikely to be damaged.
How long does it take to get rid of fungus gnats?
Allow a few weeks. The University of Wisconsin says it may take three to four weeks of changed watering, with the top of the soil kept dry, to get them in check. That is about one generation: Wisconsin and Colorado State both put the egg-to-adult cycle at three to four weeks at room temperature.
Sources
Where the facts on this page come from.
- University of Kentucky Entomology: Fruit Flies (ENTFACT-621) · entomology.mgcafe.uky.edu
- University of Wisconsin-Madison Extension: Fruit Flies in the Home (XHT1102) · hort.extension.wisc.edu
- University of Wisconsin-Madison Extension: Fungus Gnats on Houseplants (XHT1277) · hort.extension.wisc.edu
- UC Statewide IPM Program: Fungus Gnats · ipm.ucanr.edu
- Colorado State University Extension: Fungus Gnats as Houseplant and Indoor Pests · extension.colostate.edu
- Royal Horticultural Society: Fungus gnats (sciarid flies) · rhs.org.uk
- University of Kentucky Entomology: Drain Flies or Moth Flies (ENTFACT-615) · entomology.mgcafe.uky.edu
- Penn State Extension: Moth Flies in the Home · extension.psu.edu
- Seasonal pattern: iNaturalist research-grade observations, as shown on Common Fruit Fly

