How to Get Rid of Gnats: Identify the Gnat First, Then Fix Its Source

Four different small flies get called gnats, and a trap that catches one ignores another. Sort yours by photo, size and where it flies, then clear out the soil, fruit, drain or leak it breeds in.

Quick Answer

To get rid of gnats, first work out which small fly you have, because each breeds in a different place: fungus gnats in damp potting soil, fruit flies in ripe produce and trash, drain flies in the slime inside drains, and phorid flies in decaying matter, sometimes from a broken pipe. Texas A&M AgriLife Extension says insecticides alone rarely succeed; removing the breeding site is what works.

  • Fungus gnats are slender, dark, mosquito-like flies 1/16 to 1/8 inch long that stay near houseplants; UC IPM says the adults do not bite people or damage plants.
  • Fruit flies are about 1/8 inch, tan in front and black behind, usually with red eyes, and the University of Kentucky says one female lays about 500 eggs.
  • Drain flies are 1/16 to 1/5 inch, gray and fuzzy like tiny moths, and their larvae live in the film inside sink, tub and floor drains, according to Texas A&M.
  • Phorid flies are about 1/8 inch, humpbacked and quick runners; large numbers on a ground floor may mean a broken drain or sewer line, says University of Maryland Extension.
  • Vinegar traps catch fruit flies, but Wisconsin Extension says they do not work for monitoring fungus gnats; yellow sticky cards do.
  • Gnats that bite are usually outdoor flies: biting midges, about 1/25 to 1/10 inch, and black flies, just under 1/4 inch.

As an Amazon Associate I earn from qualifying purchases.

To catch and identify gnats

Yellow sticky traps

Check price on Amazon →

Gnats: quick ID

GnatSizeThe tellBreeds in
Fungus gnat1/16 to 1/8 inchSlender, dark and mosquito-like, with long legs; weak flier near plantsDamp potting soil and organic debris
Fruit flyAbout 1/8 inchStout; tan in front, black behind, usually red eyesRipe or rotting produce, trash, recycling, drains, mops
Dark-eyed fruit flyAbout 1/8 inchA fruit fly with black eyesDrains, especially around bathrooms
Drain fly (moth fly)1/16 to 1/5 inchGray and fuzzy; broad wings held flat or like a roofThe gelatinous film inside drains
Phorid flyAbout 1/8 inchHumped back; enlarged hind legs make it a fast runnerDecaying matter: drains, garbage, wet potting soil, sewer leaks, dead animals
Biting midge (no-see-um)About 1/25 to 1/10 inchBites, mostly at dusk and dawn; small enough to pass through screensWet, organic soil at the edges of ponds and marshes, outdoors
Black fly (buffalo gnat)Just under 1/4 inchStout and humpbacked; only the females biteClear, fast-running streams, outdoors

Sizes and features from Texas A&M AgriLife Extension, UC IPM, the Universities of Kentucky and Maryland, Montana State University and Iowa State University, each linked below.

Published by BuzzSkito Mosquito & Tick Control

Published October 20, 2026 · Drafted with AI assistance and fact-checked against the sources listed below

What are the gnats in my house?

Gnat is not one insect. Indoors, the tiny flying bugs people call gnats are usually one of four: fungus gnats, fruit flies, drain flies or phorid flies. They are all small, but each breeds somewhere different, and Texas A&M AgriLife Extension's guide to indoor flies says identifying the fly correctly comes first, because control works best when its breeding sites are found and eliminated.

Tan fruit fly with bright red eyes and a dark-tipped abdomen, seen from the side beside a 1 mm scale bar
Common fruit fly (Drosophila melanogaster), a male, beside a 1 mm scale bar (about 1/25 inch). The red eyes and stout body set fruit flies apart from fungus gnats. Photo: no rights reserved, via iNaturalist, CC0 1.0.
Where you see themMost likelyFirst thing to check
Around houseplants, or at a window near themFungus gnatsDamp potting mix; a chunk of raw potato on the soil shows the larvae
Over the fruit bowl, trash or recyclingFruit fliesRipe or rotting produce, spills, empty bottles and cans
On the wall by a sink, tub or floor drainDrain fliesTape or a clear bag over the drain overnight
Running on counters, walls or floors; many on a ground floorPhorid fliesGarbage, drains, and leaks from drain or sewer lines
Biting outdoors, at dusk or near waterBiting midges or black fliesNothing indoors: they breed outside

Compiled from Texas A&M, UC IPM, the University of Kentucky, the University of Maryland, Montana State and Iowa State extension sources linked on this page.

Bigger flies are a different problem. The house fly, which University of Minnesota Extension describes as dull gray and 1/6 to 1/4 inch long with four dark stripes on the thorax, is sorted from green bottle flies and cluster flies in the guide to flies in the house. Tiny insects that crawl or jump instead of flying are covered in the guide to tiny black bugs.

How can you tell which gnat you have?

Catch a few on a yellow sticky card or a strip of clear tape and look at them with a magnifying glass. Shape, eye color, wings, size and where they gathered are the checks the extension guides use.

Checks for a gnat on a card or in a jar

  • Slender, dark and long-legged, like a tiny mosquito? A fungus gnat. Under a magnifier, Colorado State and Wisconsin both point to a Y-shaped pattern on the wings.
  • Stout, tan in front and black behind, with red eyes? A fruit fly. The same build with black eyes is a dark-eyed fruit fly, which Texas A&M says breeds more often in drains.
  • Gray and fuzzy like a tiny moth, with broad wings held flat or like a roof? A drain fly.
  • Humpbacked, and quick to run across the counter? A phorid fly.
  • Did it bite? Fungus gnats and drain flies do not bite people. A biting gnat is usually an outdoor fly: a biting midge or a black fly.
  • How big is it on a ruler marked in inches? Fungus gnats run 1/16 to 1/8 inch, fruit and phorid flies about 1/8 inch, and drain flies up to 1/5 inch.

Two simple tests find the source. For houseplants, UC IPM's Pest Note on fungus gnats suggests placing chunks of raw potato, cut side down, on the potting mix; Colorado State says the larvae move to the potato within a few days, so check its underside for them. UC IPM describes the larvae as legless, with a shiny black head and a whitish to clear body. For drains, the University of Kentucky's fruit fly fact sheet tapes a clear plastic food storage bag over the opening overnight, and Texas A&M lays clear packing tape across the drain without sealing it completely. Flies caught by morning mean that drain is breeding them.

What is the difference between gnats and fruit flies?

Fruit flies are stout and tan with red eyes and gather at fruit and trash; fungus gnats are slender, dark and long-legged and stay around houseplants. Wisconsin Extension's fungus gnat page notes that people often mistake one for the other, and the mix-up matters because the traps differ. Wisconsin says the vinegar traps used for fruit flies do not work for monitoring fungus gnats, while Colorado State University Extension says fungus gnat adults are attracted to yellow and are caught on yellow sticky cards. Drain flies, the third common gnat, are fuzzier than either and stay near drains.

TraitFungus gnatFruit flyDrain fly
BodySlender and delicate; long legs and antennaeStout and cylindricalFuzzy, densely hairy, moth-like
Color and eyesDark, with light gray to clear wingsTan in front, black behind; usually red eyesGrayish to dark
How it movesWeak, erratic flight close to the plantGathers at ripe fruit, trash and spillsShort flights; found near sinks and tubs
Larvae live inDamp potting soil and organic debrisFermenting fruit and vegetables, spills, drains, mopsThe gelatinous film inside drains
What catches itYellow sticky cardsA vinegar trap with a little soapTape over the drain

From UC IPM, Colorado State, Wisconsin, the University of Kentucky, Texas A&M and University of Minnesota extension pages linked on this page.

How do you get rid of gnats in houseplants?

Let the top of the potting mix dry out between waterings, because fungus gnat larvae live in damp soil. Colorado State says to let the growing medium dry between waterings, especially the top 1 to 2 inches, and puts the life cycle at three to four weeks at 65 to 75°F, with each female laying up to 200 eggs. UC IPM adds the other sources to remove: standing water, plumbing leaks and potting mix with incompletely composted organic matter. The larvae can damage roots and stunt seedlings and young plants when they are numerous, UC IPM says, though the adults do not bite or harm plants.

Dark-winged fungus gnat with long antennae, long thin legs and a pale, banded abdomen, resting on brown, rotting wood
A dark-winged fungus gnat (family Sciaridae) on wood. Note the long legs and antennae and the slim build that UC IPM compares to a mosquito. Photo: Katja Schulz from Washington, D. C., USA, CC BY 2.0, via Wikimedia Commons, CC BY 2.0.

Yellow sticky cards set under the leaves or along the rim of the pot catch the adults, Colorado State says. For the larvae, UC IPM points to two biological options for homes: Bacillus thuringiensis subspecies israelensis (Bti), a bacterium applied to the soil that gives temporary control and, because it does not persist indoors, may need reapplying about every five days; and the insect-parasitic nematode Steinernema feltiae, which works best between 60 and 90°F in moist soil. When the old mix has broken down and holds too much water, Colorado State advises repotting. The fungus gnat plan gives a week-by-week schedule, and the guide to bugs on houseplants covers plant pests that are not gnats.

How do you get rid of gnats in the kitchen?

Gnats in the kitchen are most likely fruit flies, and the fix is to find what they are breeding in. The University of Kentucky lists ripe or rotting fruit and vegetables, including potatoes and onions, plus drains, garbage disposals, empty bottles and cans, trash containers, mops and cleaning rags. It also mentions fruit juice spilled under a refrigerator and a recycling bin that is never emptied. Kentucky says a female lays about 500 eggs and the cycle from egg to adult can finish in about a week, and that fruit flies are especially common in late summer and fall.

Throw out or refrigerate the produce, clean up the spill, and empty and rinse the bins. Then trap the adults that are left: Kentucky's trap is a jar baited with a few ounces of cider vinegar under a funnel rolled from paper, and Texas A&M describes a bowl of apple cider vinegar, red wine or beer with a little soap, which makes the flies drown. Both treat traps as a finishing step, not a cure: Texas A&M says eliminating the breeding site is essential for complete control. The fruit fly guide goes step by step.

How do you get rid of gnats in a bathroom drain?

Small fuzzy flies resting on the wall by a sink or tub are drain flies, also called moth flies, and they breed in the gelatinous film that coats the inside of drains. University of Minnesota Extension says the best control is removing that source: scrub out the buildup with a stiff-bristled brush, or use a biological drain cleaner that breaks down the organic material. It says hot or boiling water, bleach and chemical drain cleaners are not effective, and Texas A&M agrees that bleach and drain cleaner do little to remove the film.

Gray, fuzzy drain fly with broad, hairy, leaf-shaped wings spread flat and short beaded antennae, resting on a white wall
A drain fly, also called a moth fly or bathroom moth fly (Clogmia albipunctata), on a white wall. The fuzzy, broad wings make it look like a tiny moth. Photo: no rights reserved, via iNaturalist, CC0 1.0.

Check every drain, not just the obvious one. Texas A&M lists floor drains and condensate pans among the breeding sites, and UMN warns that a broken sewer line under a floor or slab can be the source. Texas A&M says females lay masses of 20 to 100 eggs that hatch in less than 48 hours and the larvae feed for 8 to 24 days, and that drain products which break down the film usually need repeating over several weeks. The drain fly guide covers the hidden sources and the larvae, and a Canadian edition is also available.

Slender, segmented, gray-brown drain fly larva with fine hairs and a dark tube at its tail end, on a white background
A drain fly larva that the photographer found in a sink, photographed on a white background. The larvae live in the film inside drains. Photo: (c) carnifex, some rights reserved (CC BY), via iNaturalist, CC BY 4.0.

What if the gnats run across counters and floors?

Small humpbacked flies that scurry across surfaces are phorid flies, also called scuttle flies. Texas A&M describes them as about 1/8 inch, tan to dark brown or black, with enlarged hind legs that make them good runners, and says the larvae develop in moist, decaying plant or animal matter such as drain pipes, garbage cans, broken garbage disposals, wet potting soil and dead animals. A few indoors is not unusual, it says, but large numbers usually point to unsanitary conditions.

Small tan phorid fly with a humped thorax, dark eyes and long hind legs standing on pale fruit flesh, beside a 1 mm scale bar
A phorid fly (Megaselia scalaris) beside a 1 mm scale bar (about 1/25 inch). The photographer found it crawling on fruit with fruit flies. Note the humped back. Photo: no rights reserved, via iNaturalist, CC0 1.0.

The hardest cases come from below the floor. University of Maryland Extension says a very large number of phorid flies on a building's ground floor may indicate a broken drain or sewer line under the structure, and Texas A&M says leaks from sewer lines under buildings can cause severe infestations that sometimes require digging out the contaminated soil. Find the moist, decaying material and remove it or dry it out, as Maryland advises. Texas A&M puts the phorid fly's life cycle, from egg to adult, at 14 to 37 days.

Which gnats bite?

Fungus gnats and drain flies do not bite people: UC IPM says so of fungus gnat adults, and UMN of drain flies. The tiny flies that bite are usually outdoor insects. Biting midges, also called no-see-ums, are 1 to 2.5 mm long (about 1/25 to 1/10 inch), small enough to fly through window screens, and the females are most active at dusk and dawn, according to Montana State University Extension. Their bites can sting or burn and are often mistaken for mosquito bites. Black flies, which Iowa State University Extension says are also called buffalo gnats, are stout, humpbacked flies just under 1/4 inch; only the females bite, and the larvae live in clear, fast-running streams.

Tiny dark biting midge with gray-spotted wings sitting among the fine hairs on a person's skin
A biting midge on human skin. Montana State gives no-see-ums (genus Culicoides) as 1 to 2.5 mm long, about 1/25 to 1/10 inch, small enough to fly through window screens. Photo: division, CSIRO, CC BY 3.0, via Wikimedia Commons, CC BY 3.0.

The no-see-um guide and the guide to gnat bites cover the bites and how to avoid them, and the black fly guide covers black fly season, which Iowa State puts in late spring and early summer along rivers and streams.

Commonly confused with

Photos: Fungus gnat: Katja Schulz from Washington, D. C., USA, CC BY 2.0, via Wikimedia Commons, CC BY 2.0. Fruit fly: no rights reserved, via iNaturalist, CC0 1.0. Drain fly: no rights reserved, via iNaturalist, CC0 1.0. Biting midge: no rights reserved, via iNaturalist, CC0 1.0. Black fly: no rights reserved, via iNaturalist, CC0 1.0. House fly: CDC (CDC Public Health Image Library, phil.cdc.gov), public domain.

Which gnat killers work, and which should you skip?

Products help only after the breeding site is gone. The University of Kentucky says that unless breeding sites are removed or cleaned, a fruit fly problem will continue no matter how often insecticides are applied, and UC IPM says insecticides are rarely warranted for fungus gnats indoors. When a product does make sense, choose it by class and active ingredient, and check that its label lists the place you want to treat. EPA's introduction to pesticide labels puts it plainly, the label is the law: using a product in a way its labeling does not allow is a violation of federal law.

ClassActive ingredientUsed againstWhat to know
Microbial larvicideBacillus thuringiensis subsp. israelensis (Bti)Fungus gnat larvae in potting soilLarvae must eat it; no effect on eggs, pupae or adults; repeat about every 5 to 7 days
Beneficial nematodeSteinernema feltiaeFungus gnat larvaeLive, insect-parasitic nematodes applied as a soil drench; work best at 60 to 90°F in moist soil
Insect growth regulatorS-hydropreneDrain fly larvaeCan be used in drains, where most insecticides are not labeled; stops larvae developing but does not kill adults
Botanical and synthetic insecticidesPyrethrins; pyrethroids such as bifenthrin and permethrinAdult gnatsTemporary control only; on houseplants, apply to the plant and soil surface as labeled, not into the air

From NPIC, UC IPM, Colorado State, Wisconsin Extension and Texas A&M AgriLife Extension. Use only a product whose label lists the site you are treating.

Some common shortcuts are not worth it. UC IPM says not to fog the air indoors for fungus gnats, Wisconsin calls spraying the air ineffective, and Kentucky reserves a pyrethrum aerosol for the last adults once the source is gone. Bleach or boiling water poured down a drain does not remove the film drain flies breed in, UMN says. NPIC's Bt fact sheet describes Bt as generally low in toxicity to people and mammals, though some products have irritated eyes or skin, and their other ingredients can pose more risk than the Bt itself. Keep products, sticky cards and traps out of reach of children and pets, follow the label, and for an exposure call the Poison Control Center at 800-222-1222, as NPIC advises.

How do you keep gnats from coming back?

  • Houseplants. Water only when the top 1 to 2 inches of mix are dry, give pots good drainage, and buy pasteurized potting mix; UC IPM says infestations can start in infested potting soil or incompletely composted material. Wisconsin adds that a 1/2- to 1-inch layer of coarse sand or fine gravel on the mix helps keep the surface drier and less attractive for egg laying.
  • Kitchen. Refrigerate ripe produce rather than leaving it out, rinse bottles and cans before they go in the recycling, and empty the recycling and trash often, since Kentucky lists all of them as fruit fly breeding sites.
  • Drains. Scrub the film out of sink, tub and floor drains now and then with a stiff brush, the method UMN recommends, and do not forget drains that are rarely used.
  • Leaks and screens. Fix plumbing leaks and caulk leaky windows and doors, which UC IPM lists among fungus gnat controls, and keep screens in repair; Kentucky notes that fruit flies can come in through poorly screened windows and doors.

This guide is general educational information, not medical advice. If you have symptoms or concerns after a bite or exposure, contact a healthcare provider.

Use any pesticide exactly as its label directs. The label is the law, and what is registered and sold varies by state.

Frequently Asked Questions

Why is my house full of gnats all of a sudden?+

Something started breeding them a week or more earlier. Fruit flies can go from egg to adult in about a week, the University of Kentucky says, so a forgotten potato, onion or juice spill can produce a crowd quickly. Fungus gnats often follow a houseplant brought in from outdoors, a bag of infested potting mix or a stretch of overwatering, which Texas A&M says is most common in winter. A sudden swarm on a ground floor can also mean phorid flies from a broken drain or sewer line.

Does dish soap and vinegar get rid of gnats?+

It catches fruit flies, but it will not get rid of them on its own. Texas A&M describes a bowl of apple cider vinegar, red wine or beer with a little soap, which makes the flies drown, and says eliminating the breeding site is still essential. Wisconsin Extension says vinegar traps do not work for monitoring fungus gnats, which are caught on yellow sticky cards instead, and drain flies and phorid flies need their breeding source cleaned out.

What is the best gnat killer for indoors?+

It depends on the gnat, and no product replaces removing the source. For fungus gnat larvae in potting soil, UC IPM points to Bti, a bacterium the larvae eat, or the nematode Steinernema feltiae. For drain fly larvae, Texas A&M names the insect growth regulator S-hydroprene, which can be used in drains where most insecticides are not labeled. Pyrethrin and pyrethroid sprays only knock adults down for a while. Use any product only where its label allows.

Why won't the gnats go into the vinegar?+

Because they are probably not fruit flies. Wisconsin Extension says the vinegar traps used for fruit flies do not work for monitoring fungus gnats, the slender dark gnats that hover around houseplants. Colorado State says fungus gnat adults are attracted to yellow and get caught on yellow sticky cards set under the leaves or along the edge of the pot. Fuzzy gnats on the wall near a sink are drain flies, which you find by taping over the drain overnight.

What attracts gnats to a house?+

Moisture and decaying organic matter, a little different for each gnat. Fungus gnats lay eggs in damp potting soil and organic debris, and UC IPM says the adults are attracted to light, so they often show up at windows. Fruit flies are drawn to ripe or fermenting fruit and vegetables, which the University of Kentucky says makes them especially common in late summer and fall. Drain flies breed in the film inside drains, and phorid flies in moist, decaying plant or animal matter.

What kills gnats in houseplants instantly?+

Nothing reaches every stage at once. Yellow sticky cards catch the adults, and UC IPM says pyrethrin or pyrethroid sprays give only temporary control of them. The larvae in the soil take longer: Bti works only when the larvae eat it, may need reapplying about every five days indoors, and Wisconsin Extension says it does not affect eggs, pupae or adults. Colorado State's first step is letting the top 1 to 2 inches of potting mix dry between waterings.

What time of year are gnats most active?+

Indoors they can turn up in any month, but each has a season. Colorado State says fungus gnat problems are most noticeable in late fall and winter, and Texas A&M links that to winter overwatering of houseplants. The University of Kentucky says fruit flies can be a problem year round but are especially common in late summer and fall. Outdoors, Iowa State says black flies are most common along rivers and streams in late spring and early summer.

How long does it take to get rid of gnats?+

Plan on a few weeks, because the stages already in the soil, fruit or drain keep emerging after you start. Colorado State puts the fungus gnat life cycle at three to four weeks at 65 to 75°F, so keep the soil dry and the cards up for at least that long. Fruit flies cycle in about a week, according to the University of Kentucky, so they fade faster once the source is gone. Texas A&M says drain fly larvae feed for 8 to 24 days.

Do gnats bite?+

Not the ones that breed in houseplants and drains. UC IPM says fungus gnat adults do not bite people, and UMN Extension says drain flies do not bite either. Biting gnats are usually outdoor flies. Biting midges, or no-see-ums, are small enough to pass through window screens and are most active at dusk and dawn, Montana State says, and Iowa State says only female black flies bite, causing intense itching, swelling and soreness. Bites from biting midges are often mistaken for mosquito bites.

Can gnats come up through the drain?+

Yes. Drain flies breed in the gelatinous film inside sink, tub and floor drains, and Texas A&M says dark-eyed fruit flies breed more often in drains than other fruit flies. Phorid flies can breed in drain pipes and broken garbage disposals, and the University of Maryland says large numbers on a ground floor may point to a broken drain or sewer line under the building. A clear bag or tape over the drain overnight shows whether that drain is the source.

Sources

  1. Indoor Flies and Their Control (ENTO-050) — Texas A&M AgriLife Extension Service
  2. Pest Notes: Fungus Gnats (Publication 7448) — University of California Statewide IPM Program
  3. Fungus Gnats as Houseplant and Indoor Pests — Colorado State University Extension
  4. Fungus Gnats on Houseplants — University of Wisconsin-Madison Division of Extension
  5. Fruit Flies (ENTFACT-621) — University of Kentucky Entomology
  6. Flies — University of Minnesota Extension
  7. Phorid Fly — University of Maryland Extension
  8. Bacillus thuringiensis (Bt) General Fact Sheet — National Pesticide Information Center
  9. Introduction to Pesticide Labels — U.S. Environmental Protection Agency
  10. Biology and Impact of Biting Midges in Montana (MontGuide MT201205AG) — Montana State University Extension
  11. Black Fly — Iowa State University Extension and Outreach

How this guide was made: it was researched and drafted with AI assistance from the sources listed above. A second, independent AI pass then checked each factual claim against those sources. Found an error? Email support@buzzskito.ca.