Independent identification guides — we don’t sell pest control services
Identification

Gnat vs Fruit Fly: There Are Three Answers, Not Two

Macro photograph of a fruit fly, Drosophila, showing its red compound eyes and tan body
A fruit fly runs about 3 mm and holds its wings flat over the body at rest. Photo: Hannah Davis (CC BY-SA 4.0), via Wikimedia Commons

Short answer

The question assumes two answers. There are three. Fungus gnats come out of houseplant soil, fruit flies out of something fermenting, drain flies out of the film inside a pipe. Which one you have changes what you do next.

  1. Watch where it goes back to once you leave it alone: a plant pot, a fruit bowl, or a wall near a drain.
  2. Work on that spot, not on the fly. The step-by-step protocol for gnats in the house covers it room by room.
  3. If it jumps instead of flying, the rundown of very tiny bugs in the house is a better start.

Where does it go when you leave it alone?

Chasing a small fly tells you nothing. Standing still for two minutes tells you almost everything. All three are weak fliers that stay near where they emerged, so shoo it off, step back, and watch where it settles.

Back down toward a potted plant, onto the soil, or onto the window nearest it: the nursery is the potting mix, not the plant. That is a fungus gnat, described on the fungus gnat and drain fly identification page.

Straight to the fruit bowl, the trash lid or an unrinsed glass, landing on the food rather than circling above: the nursery is something fermenting. That is a fruit fly, covered on the fruit fly identification page.

A short drop onto a wall or tile near a sink, tub or floor drain, then nothing at all: the nursery is inside the pipe. That is a drain fly, the answer nobody expects, and it explains many sightings in bathrooms, where there is no fruit to blame.

Treat this as a house rule, not a published test. It holds up because it restates what is published: fungus gnats lay in moist organic debris and potting soil, drain flies in the slimy matter coating a drain, fruit flies on fermenting food. Adults stay near the nursery.

Fungus gnat or fruit fly?

Side by side, these two barely look alike. A fungus gnat reads as a miniature mosquito: dark, slender, long thin legs, antennae longer than its head, 1.5–3 mm (1/16–1/8 in) long. Family Sciaridae, usually Bradysia or Orfelia. A fruit fly is built the other way: stout bodied, about 3 mm (1/8 in), tan on the head and thorax with a darker, often banded abdomen. Drosophilidae, most often Drosophila melanogaster.

Behavior sorts them faster than anatomy. A fungus gnat flies weakly and erratically, is drawn to light, and usually gets noticed at a window before anyone finds the plant. It rarely touches food; a fruit fly lands on the food itself. One is over the dirt, the other on the fruit. If yours reads warm brown, the roundup of tiny brown flying bugs in the house covers it.

Red eyes do not settle it alone: most fruit flies have bright red eyes, a useful check up close. But D. repleta has dark eyes, so dark eyes do not rule a fruit fly out. Read eye color together with the landing spot.

The larvae explain the adults. Fungus gnat larvae live in damp potting mix, feeding on fungi and organic matter, and chewing fine roots when numerous. They are legless and whitish with a shiny black head, and on very wet soil they leave faint slime trails like snail tracks. A fungus gnat generation runs about 17 days at 75 °F (24 °C), so a pot that stays wet keeps producing them. Fruit fly larvae live in whatever has started to ferment, which is why confirming a fruit fly in a kitchen means hunting the source.

Drain fly or fruit fly?

Adult drain fly, Clogmia albipunctata, resting with its hairy wings held over its back
Same 3 mm as a fruit fly, but the wings are furred and sit over the back in a roof shape. Photo: Adrian Tync (CC BY-SA 4.0), via Wikimedia Commons

This is the pairing that sends people in circles: in a kitchen, a drain fly sits three feet from the fruit bowl and passes for a fuzzier version of the same problem. Drain flies, family Psychodidae and usually Psychoda or Clogmia, run about 3 mm (1/8 in), the same size as a fruit fly, but their wings are covered in fine hairs and held over the back in a roof shape at rest. UC IPM describes the flight as short hopping flights. A fruit fly’s wings lie flat.

Where they sit finishes the job. A drain fly parks on a vertical surface for long stretches: a wall, a tile, the side of a tub. If you keep swatting at something that lands on the wall near a sink and never on the fruit, look at the drain. It is why drain flies turn up in searches for tiny black bugs in the bathroom with no wings.

The one look that cannot be faked: hairy wings held roof-like over the back, plus a short hopping flight, is Psychodidae and nothing else here. Stop checking eye color and go find which drain.

The breeding sites have nothing in common. Drain fly eggs go into the slimy layer lining the inside of a pipe and hatch in about 48 hours, and the full cycle runs 8 to 24 days depending on temperature. Any trap aimed at fruit is irrelevant to them, which is the whole point of the page for small black flying bugs that are not fruit flies. Clearing them means stripping the film out of the drain they came from.

All three, side by side

 Fungus gnatFruit flyDrain fly
Size1.5–3 mm (1/16–1/8 in)about 3 mm (1/8 in)about 3 mm (1/8 in)
FamilySciaridae (Bradysia, Orfelia)Drosophilidae (Drosophila melanogaster)Psychodidae (Psychoda, Clogmia)
Where it lays eggsmoist potting mix and organic debrison and around fermenting foodslimy film inside a drain
Where it landssoil surface, foliage, nearby windowsdirectly on the foodwalls and tile near the drain
Developmentabout 17 days per generation at 75 °F (24 °C)about 8 to 10 days at 85 °F (29 °C)eggs hatch in about 48 hours, full cycle 8 to 24 days

Where do gnats come from?

Almost never through the window. That assumption sends people outside with a spray can while the population breeds six feet away. Fungus gnats do gather at a sill, because light draws them, but that is them trying to get out.

Fungus gnats arrive in soil: a new plant from the nursery, or a bag of mix that sat damp in the garage. UC IPM’s advice is dull and effective: let the top of the container soil dry between waterings and fix the drainage. A wet saucer counts, and so does a room that never dries out, which is where bringing indoor humidity down matters. A yellow sticky trap in the pot tells you over a week or two whether the count is falling.

Fruit flies arrive on produce and stay for the sugar: a peach going soft under the others, juice in a recycling bin, residue in a disposal. Rarely the fruit you can see, which is why sorting out the kitchen lineup ends at the trash can. The fruit fly removal protocol runs those stops in order.

Drain flies need no visible food, only the slimy layer that builds on the inner wall of a pipe. They will take a basement floor drain or a guest bathroom sink nobody has run in a month, the sort of thing a seasonal prevention pass is meant to catch. Once a pipe is confirmed, the drain fly removal protocol starts with a cup test on every drain in the room.

What is a gnat, actually?

“Gnat” is not a group of insects. The word has no taxonomic meaning at all. It is a household term for any small fly that annoys you. Fungus gnats are Sciaridae. Drain flies are Psychodidae. Fruit flies are Drosophilidae. Three unrelated families, one word over all of them.

So the question has three answers rather than two, and not because the insects are hard to tell apart: half of it is a word that never picked a side. If none of the three fits, the identification hub sorts sightings by color, size and room.

If it jumps and has no wings, it is none of the three

One last exit. If the speck launches itself up to several inches and has no wings, you have a springtail: smaller than all three at about 1/16 in (1 to 2 mm), different animal, different fix.

Its classification is worth a line, because sources disagree in print. University of Minnesota Extension calls springtails insects. The 2025 update of UC IPM’s Pest Note calls them insectlike arthropods in the order Collembola. Either way it is none of the three above, and the springtail page covers the moisture fix.

FAQ

Are gnats and fruit flies the same insect?

No. “Fruit fly” names one family, Drosophilidae. “Gnat” names nothing in particular: indoors it usually means a fungus gnat out of a plant pot or a drain fly out of a pipe. The difference is really one of breeding site.

What is the fastest way to tell a fungus gnat from a fruit fly?

Watch one land. A fruit fly puts itself directly on the fruit or food waste. A fungus gnat hovers over the soil or drifts to a window. Long thin legs and a mosquito outline is the fungus gnat, short and stout the fruit fly.

Why did my bowl of vinegar catch nothing?

Probably because you do not have fruit flies. Vinegar smells like fermenting fruit, which is what a fruit fly hunts for and what neither of the other two breeds in. A fungus gnat wants wet soil; a drain fly barely leaves its own wall. An empty bowl is an identification result. What belongs in the bowl, and what it will and will not catch, is covered in the guide to the apple cider vinegar trap.

Do gnats come in from outside through the windows?

Occasionally, but that is not the usual story. All three breed indoors in material already in the house: potting mix, fermenting food waste, drain film. Numbers that appear overnight are a hatch, not an entry, the same pattern behind tiny black bugs that show up all of a sudden.

Can I have two of these at the same time?

Yes, and in a kitchen with houseplants it is common. Overripe fruit on the counter and an overwatered pot two feet away support two populations that never touch. Clear one and the other carries on, which is why a fix so often half-works.

Sources

  1. University of California Statewide Integrated Pest Management Program, Pest Notes: Fungus Gnats, UC ANR Publication 7448.
  2. University of California Statewide Integrated Pest Management Program, Pest Notes: Moth or Drain Flies, UC ANR Publication 74167.
  3. Colorado State University, Colorado Insect of Interest: Small Fruit Flies, Department of Bioagricultural Sciences and Pest Management.
  4. Purdue University Department of Entomology, Small Flies, Purdue Extension publication E-233-W.
  5. University of California Statewide Integrated Pest Management Program, Pest Notes: Springtails, UC ANR Publication 74136.

Chriss R.

Writer and editor

Writes and edits House Bug Guide. Not an entomologist, and doesn't claim to be: the identification details here are drawn from university extension entomology publications and rewritten for people who need an answer tonight, with the sources listed at the foot of each page.

Read next