The short answer
- Indoors, the four usual "gnats" are fruit flies, fungus gnats, drain flies and phorid flies. Where you see them is the fastest clue.[1][4]
- Around potted plants and windows: fungus gnats. Dry out the potting soil and treat the larvae there.[1][7][6]
- Around fruit, the trash or recycling: fruit flies. Find and throw out what they are breeding in.[2][1]
- Resting on bathroom or kitchen walls near a drain, fuzzy and moth-like: drain flies. Scrub the slime out of the drain.[3][5]
- Running over counters instead of flying off: phorid flies. Look for a wet, rotting source, sometimes a broken drain line.[1][4]
- Outdoors, gnats that bite near water at dawn or dusk are no-see-ums (biting midges); ones that bite by day near streams are black flies; ones that hover at your eyes without biting are eye gnats. Spraying the yard rarely helps; screens, fans and repellent do.[9][11][12][13][10]
Gnat and small fly profiles
Why the type of gnat decides the fix
Kentucky Extension lists fruit flies, fungus gnats, drain flies and phorid flies as the small flies most often found indoors. Texas A&M adds that the larvae live in drains, standing water, rotting food, potting soil or garbage, depending on the fly.[1][4]
That is why sprays aimed at the flying adults disappoint. Kentucky says killing adult flies usually gives only temporary relief and that proper management means removing the larval breeding source. Texas A&M says the same of fruit flies: traps or sprays may help for a while, but eliminating the breeding site is essential.[1][4]
Outdoor biting gnats are a different problem. Clemson Extension calls area-wide control of biting midges and eye gnats nearly impossible, because populations are rapidly replenished from breeding sites even after insecticides kill the adults.[9]
Fungus gnats: the houseplant gnat
What they look like: slender, delicate black flies about 1/8 inch long with long legs and long antennae, a bit like tiny mosquitoes. UC IPM gives the common size as 1/16 to 1/8 inch, with light gray to clear wings. They don't bite.[6][7][1][4]
The test: they stay close to potted plants, run across the soil surface, and are weak fliers that fly in short, erratic patterns. Because they are drawn to light, the first ones you notice are often on windows. To confirm larvae, push 1/4 inch slices of raw potato into the potting mix; Colorado State says the larvae move to the potato and start feeding within a few days, so check the underside.[7][6][1]
The plan: the larvae live in damp potting mix, so the fix starts with letting the top 1 to 2 inches of soil dry between waterings. Our fungus gnat guide covers watering, repotting, sticky cards and larval treatments step by step.[6][1]
Fruit flies: the kitchen gnat
What they look like: about 1/8 inch long, brown-black, usually with red eyes, and a stout body. They hover and fly fast and erratically around fruit bowls, trash cans and open drinks.[2][1][4]
The test: they gather on overripe fruit and anything fermented, such as vinegar, beer and juice. Texas A&M lists common breeding sites as the wet bottoms of trash cans, bags of potatoes or onions in the pantry, and fruit left out of the refrigerator. Kentucky notes that a single rotting potato or onion forgotten in a closet can breed thousands.[1][2][4]
The plan: find and remove what they are breeding in, then catch the stragglers. Our fruit fly and drain fly guide covers finding the source, traps and drain checks.[2][4]
Drain flies (moth flies): the bathroom gnat
What they look like: tiny, fuzzy, grayish to dark brown flies with broad, hairy wings held roof-like over the body, so they look like miniature moths. Size estimates run from 1/16 to 3/16 inch (Kentucky) to 1/16 to 1/5 inch (Texas A&M).[1][3][4][5]
The test: they sit on walls and ceilings near sinks, tubs and floor drains and make short hopping flights when disturbed. Swat one and it smears into a cloud of fine dust, because the wings are covered in scales and hairs.[3][1][4]
The plan: the larvae live in the slimy film inside drains, so the drain has to be scrubbed out with a brush, not just flushed. The fruit fly and drain fly guide has the cleaning steps.[1][4]
Phorid flies: the gnat that runs
What they look like: about the same size as fruit flies, 1/8 inch, but with a humpbacked look, dark veins along the front edge of the wing and enlarged hind legs.[4][1][8]
The test: phorid flies run rapidly over surfaces when disturbed instead of flying away, often running and stopping before they take off, which is why they are also called scuttle flies.[1][4]
Why they matter: the larvae feed in moist, decaying material, including garbage, drain pipes, wet potted soil and dead animals. Texas A&M notes that a few indoors is not unusual, but large numbers usually point to unsanitary conditions, and soil soaked by a leaking sewer line is one underground source. The small flies indoors guide covers how to track the source down.[4][1]
Two quick checks for a hidden breeding spot
The bag or tape test: tape a clear plastic food storage bag over a suspect drain or disposal overnight, as Kentucky suggests, or lay tape sticky side down over the opening, as Minnesota suggests. If flies are breeding inside, the new adults are caught as they try to come out.[2][5]
The sticky trap map: Kentucky suggests placing sticky traps around the house for phorid flies; the trap that catches the most flies points to the area holding the breeding source. For houseplants, yellow sticky cards set at the edge of the pots work the same way for fungus gnats.[1][6][7]
Outdoor gnats that bite: no-see-ums and black flies
No-see-ums (biting midges, also called sand gnats or punkies) are only about 1/16 inch long, so most people never see one feed. They are most active at dawn and dusk near swamps, marshes, ponds and stream edges, and the bite leaves an itchy, raised spot much like a mosquito bite.[9][11]
Black flies, also called buffalo gnats, are similarly small (Minnesota gives 1/16 inch) but are daytime biters. They breed in running water, mainly fast streams and rivers, and they tend to bite around the head and neck. Minnesota notes they are active from spring through summer, with bites most common in spring.[12][13]
The test: if you are being bitten outdoors and can barely see the culprit, it is one of these two. Time of day and the kind of water nearby usually tell you which. Neither breeds in your house, so indoor gnat treatments don't apply. Our no-see-ums and biting midges guide covers fine-mesh screens, fans, repellents and clothing for both.[9][11][13]
Eye gnats: the gnat at your face
What they look like: small flies, 1/16 to 1/8 inch long, with shiny black or gray bodies and yellow to orange-brown legs.[10][9]
The test: they hover around your head and keep landing at the corners of your eyes, nose, mouth or any cut. UC IPM says this persistent feeding at eyes and wounds is what separates them from fungus gnats and other small flies. They don't bite; their mouthparts work like sponges.[10][9]
Where they come from: the larvae develop in loose, moist, sandy soil with plenty of organic matter, especially soil that has just been dug, plowed or graded. Clemson notes they have been linked to spreading pink eye by carrying bacteria into the eye. Repellents give temporary relief, and Clemson says an 18 x 16 mesh screen is usually enough to keep them off a porch. See our no-see-ums and biting midges guide for more.[10][9]
Clouds of gnats near water that don't bite: midges
Big swarms of mosquito-like flies around ponds, lakes, porch lights and window screens that don't bite are usually non-biting midges. Clemson says most swarms are males, and that midges differ from mosquitoes by a much shorter snout. They don't bite, though thick swarms have caused allergic reactions and traffic hazards.[14]
The one change that helps most is lighting: Clemson suggests keeping outdoor lights off for about 45 minutes after sundown, since 90% of the activity happens before then. Our midge and mayfly swarms guide covers the rest.[14]
Common questions
- Why do I have gnats in my house?
- Because something indoors is giving the larvae a place to grow: damp potting soil for fungus gnats, ripe produce or a dirty trash can for fruit flies, slime in a drain for drain flies, or a wet, rotting spot for phorid flies.[1][4]
- Do gnats bite?
- The indoor ones don't. Fungus gnats, fruit flies, drain flies and phorid flies are non-biting. Outdoors, no-see-ums and black flies do bite; eye gnats don't bite but feed on moisture around the eyes.[1][9][12][10]
- Will a vinegar trap get rid of all gnats?
- No. Vinegar traps catch fruit flies, which are drawn to fermenting liquids. They won't fix fungus gnats in potting soil or drain flies in a drain, and even for fruit flies the breeding site has to go.[1][2][4]
- Are the gnats on my window fungus gnats?
- Often, yes. Fungus gnats are attracted to light, so they gather at windows. If you have houseplants nearby, check the soil with a potato slice for larvae.[7][1][6]
- Can I spray the yard to stop biting gnats?
- It rarely works for long. Clemson says insecticides kill adult biting midges and eye gnats, but populations are rapidly replenished and spraying would be needed daily. Fine screens, fans and repellents are more practical.[9]
Photo credits
- Fungus Gnat: (c) aispinsects, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Fruit Fly: Jesse Rorabaugh, public domain (CC0), via iNaturalist
- Drain Fly (Moth Fly): (c) Katja Schulz, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Phorid Fly: (c) Justin Williams, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Biting Midges: Sinaloa Silvestre, public domain (CC0), via iNaturalist
- Black Flies: Stephen James McWilliam, public domain (CC0), via iNaturalist
- Eye Gnats: (c) Tom, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
- Non-Biting Midges: (c) Robert Roach, some rights reserved (CC BY) — via iNaturalist, CC BY 4.0
Sources
- University of Kentucky Entomology, “Small Flies, ENTFACT-657.” entomology.mgcafe.uky.edu/ef657 (accessed 2026-11-10)
- University of Kentucky Entomology, “ENTFACT-621: Fruit Flies.” entomology.mgcafe.uky.edu/ef621 (accessed 2026-11-10)
- University of Kentucky Entomology, “ENTFACT-615: Drain Flies or Moth Flies.” entomology.mgcafe.uky.edu/ef615 (accessed 2026-11-10)
- Texas A&M AgriLife Extension, “Indoor Flies and Their Control.” agrilifeextension.tamu.edu/library/insects/indoor-flies-and-their-control/ (accessed 2026-11-10)
- University of Minnesota Extension, “Flies.” extension.umn.edu/garden-and-home/home-maintenance/household-insects/flies (accessed 2026-11-10)
- Colorado State University Extension, “Fungus Gnats as Houseplant and Indoor Pests, Fact Sheet 5.584.” extension.colostate.edu/topic-areas/insects/fungus-gnats-as-houseplant-and-indoor-pests-5-584/ (accessed 2026-11-10)
- University of California Statewide IPM Program, “Pest Notes: Fungus Gnats.” ipm.ucanr.edu/home-and-landscape/fungus-gnats/ (accessed 2026-11-10)
- Colorado State University, Department of Agricultural Biology, “Phorid Fly/Drain Fly (Colorado Insect of Interest).” webdoc.agsci.colostate.edu/bspm/arthropodsofcolorado/Phorid-Flies.pdf (accessed 2026-11-10)
- Clemson Cooperative Extension Home & Garden Information Center, “Gnats, HGIC 2489 (J. Ballew, 2018).” hgic.clemson.edu/factsheet/gnats/ (accessed 2026-11-10)
- UC Statewide IPM Program, “Eye Gnats, Pest Notes (J. A. Bethke).” ipm.ucanr.edu/home-and-landscape/eye-gnats/ (accessed 2026-11-10)
- University of Arizona Cooperative Extension, “Something's Biting Me, but I Can't See It! No-See-Ums (S. Nair, D. H. Gouge, S. Li, 2018).” cales.arizona.edu/apmc/docs/No-See-Ums-IPMShort.pdf (accessed 2026-11-10)
- University of Minnesota Extension, “Black flies (J. Hahn, reviewed 2024).” extension.umn.edu/yard-and-garden-insects/black-flies (accessed 2026-11-10)
- Mississippi State University Extension, “What to Do about Black Flies (Buffalo Gnats), P3755 (J. Goddard).” extension.msstate.edu/publications/what-do-about-black-flies-buffalo-gnats (accessed 2026-11-10)
- Clemson Cooperative Extension Home & Garden Information Center, “Midges, HGIC 2433.” hgic.clemson.edu/factsheet/midges/ (accessed 2026-11-10)