Gnats do not build nests. Unlike social insects such as ants or wasps, no gnat species constructs a shared home or returns to a central structure. What gnats do is lay eggs directly in or on the moist, organic-rich material their larvae need to eat, and that material varies widely depending on the type of gnat. The cloud of tiny flies hovering near your houseplants or over a patch of wet soil outdoors is not a nest but a breeding site, and the distinction matters if you want to get rid of them.
Why It Looks Like They Have a Nest
If dozens of gnats keep appearing in the same corner of your kitchen or around the same planter, it is easy to assume they are emerging from some hidden nest. In reality, the adults are simply congregating near wherever their larvae are feeding. Female fungus gnats, the most common indoor species, scatter their eggs across the top layer of damp potting soil. A single female can deposit anywhere from about 20 to over 200 eggs in a matter of days.1PubMed. Egg-laying preference of female fungus gnat Bradysia sp. nr. coprophila on three different soilless substrates With multiple females visiting the same pot, the soil becomes packed with larvae that all emerge as adults within a week or two. That synchronized emergence is what creates the impression of a nest producing wave after wave of flies.
Outdoor gnats give a similar impression for different reasons. Many species form mating swarms, hovering in a loose column above a landmark like a fence post or a puddle’s edge. These swarms are not nests but brief, weather-dependent gatherings of males waiting for females to fly through. The swarm dissolves as quickly as it forms, and the insects disperse to lay eggs wherever conditions are right.
Fungus Gnats and the Potting Soil Problem
The gnats most people encounter indoors belong to the family Sciaridae, commonly called fungus gnats. Their preferred breeding medium is any damp, organic-rich substrate, especially potting mixes high in peat moss or hardwood bark that support microbial growth.2Journal of Economic Entomology. Egg-Laying Preference of Female Fungus Gnat Bradysia sp. nr. coprophila on Three Different Soilless Substrates The adults themselves are harmless and barely eat. The larvae, translucent white worms a few millimeters long, feed on fungi, algae, and decaying organic matter in the soil. In heavy infestations they can also damage fine root hairs, which is why greenhouse growers take them seriously even though a few gnats on a windowsill are mostly just annoying.
Overwatering is the single biggest factor that turns a houseplant pot into a fungus gnat nursery. The top inch or so of soil stays wet, microbes flourish, and females are drawn to lay eggs there. If you let the soil surface dry between waterings, the larvae in the top layer desiccate and the adults lose interest. That simple change does more than any spray.
How Fungus Gnats Pick a Breeding Site
Female fungus gnats are not randomly landing on the nearest wet surface. They use chemical cues, particularly volatile compounds released by growing fungi, to evaluate potential egg-laying sites. Research on the mushroom-associated species Lycoriella ingenua found that the mycelia of certain fungi actively attracted pregnant females and triggered egg-laying, while the mycelia of other fungal species did not, even when no alternative was available.3PLOS ONE. Attraction, Oviposition and Larval Survival of the Fungus Gnat, Lycoriella ingenua, on Fungal Species Isolated from Adults, Larvae, and Mushroom Compost The gnats are essentially sniffing out which fungi will best nourish their offspring.
The picture gets more interesting when fungi have already been colonized by other organisms. Specific volatile chemicals released by heavily colonized compost, including compounds like 1-octen-3-ol (the “mushroomy” smell you might recognize from a forest floor), actually repelled female gnats in behavioral tests.4PubMed Central. Fungal Volatiles as Olfactory Cues for Female Fungus Gnat, Lycoriella ingenua in the Avoidance of Mycelia Colonized Compost This makes ecological sense: compost already thick with fungal growth may signal overcrowding and resource competition for larvae. So the females are not simply seeking “anything damp.” They are reading a chemical landscape and choosing the spots most likely to support larval survival.
In mushroom-growing facilities, the larvae feed readily on the fruiting bodies themselves. Lab observations showed that larvae could complete development on detached mushroom caps, stems, or gills placed on moist peat, and could even develop on peat alone when a protein source was added.5Annals of Applied Biology. Field and laboratory observations on the substrates of the mushroom fungus gnat Lycoriella auripila Their dietary flexibility is part of what makes them so persistent in any environment where organic matter and moisture overlap.
Eye Gnats and Outdoor Soil
Outdoors, a completely different group of gnats breeds in the top layer of soil rather than in standing water. Eye gnats (genus Liohippelates, family Chloropidae) get their name from their habit of buzzing around faces to feed on eye secretions, a behavior that can transmit bacterial conjunctivitis. Their breeding requirements are specific: they need disturbed, sandy soil that is moist and contains decaying plant material.6Journal of Integrated Pest Management. Eye Gnat (Liohippelates, Diptera: Chloropidae) Biology, Ecology, and Management Females may also deposit eggs on animal dung, rotting fruit, and decaying vegetables.
Agricultural fields are prime territory. Any soil where plant residues get turned under during tillage becomes a potential nursery. Laboratory studies confirmed that a wide range of incorporated plant materials, from bermuda grass clippings to sugarbeet leaves and broccoli trimmings, can support eye gnat development when mixed into damp, sandy soil.7Environmental Entomology. Organic Wastes and Soil Additives as Producers of Hippelates Eye Gnats This explains why eye gnat populations tend to spike in warm-season agricultural regions, particularly in areas with sandy soils and livestock. They have also historically been associated with bison grazing lands, where dung and disturbed turf provide everything the larvae need.6Journal of Integrated Pest Management. Eye Gnat (Liohippelates, Diptera: Chloropidae) Biology, Ecology, and Management
Water-Breeding Gnats and Drain Flies
Several gnat-like flies breed in water or the moist biofilm lining drains and pipes, which expands the list of places you might find them indoors. Drain flies (family Psychodidae), sometimes called moth flies because of their fuzzy, moth-shaped wings, lay eggs in the organic sludge that accumulates inside drains, especially in spots with low water flow. A study of hospital infestations in Germany traced breeding populations to hair-clogged drains in shower stalls, infrequently flushed toilets and urinals, and moisture from neglected leaking pipes.8PubMed. Hospital infestations by the moth fly, Clogmia albipunctata (Diptera: Psychodinae), in Germany Any fixture that sits unused for weeks can develop the biofilm layer drain fly larvae need.
Biting midges (family Ceratopogonidae), the tiny flies sometimes called no-see-ums, breed in shallow water or waterlogged soil at the margins of ponds, marshes, and even puddles. Their larvae can tolerate remarkably harsh conditions. Research documenting biting midge attacks on people in Italy found larvae thriving in water bodies with extremely low pH and high sulfate concentrations, conditions most aquatic insects would not survive.9Journal of Medical Entomology. First Report of Culicoides Biting Midges Attacking People in Italy, With the Description of Extreme Larval Breeding Sites and Diurnal Activity of Culicoides riethi
Black flies (family Simuliidae) take the aquatic route even further. Their larvae attach to rocks and vegetation in flowing streams, filtering food particles from the current. A survey of streams in northeastern Turkey identified 20 black fly species across 41 sampling sites, with species distribution strongly tied to water chemistry, including dissolved oxygen, temperature, and nutrient levels.10International Journal of Limnology. The Effects of Environmental Variables on the Distribution of Immature Black Flies (Diptera, Simuliidae) in Various Streams of Northeastern Turkey If you are being bitten near a creek, the breeding site is not in your yard but likely in the moving water upstream.
Breaking the Breeding Cycle Indoors
Because gnats breed directly in the substrate their larvae eat, control always comes down to making that substrate inhospitable. For fungus gnats in houseplants, the first line of defense is watering discipline: let the top layer of soil dry fully between waterings. Bottom-watering, where you fill the saucer and let the plant pull moisture up through the drainage hole, keeps the surface drier and less attractive to egg-laying females.
Biological control agents are popular in commercial greenhouses. Predatory mites and parasitic nematodes both target fungus gnat larvae in the soil. Research has shown that predatory mites are particularly effective against younger larvae, and combining mites with nematodes improves overall results compared to using either alone.11Biological Control. Control efficacy of fungus gnat, Bradysia impatiens, enhanced by a combination of entomopathogenic nematodes and predatory mites For home growers, predatory mite sachets designed for houseplants are increasingly available online.
A common recommendation is Bacillus thuringiensis israelensis (Bti), a soil bacterium sold as mosquito dunks or gnat drench products. Bti works well on very young larvae, but testing found it had no effect on second- and third-instar fungus gnat larvae, the larger ones that have already been feeding for several days.12PubMed. Effect of Bacillus thuringiensis subsp. israelensis and neonicotinoid insecticides on the fungus gnat Bradysia sp nr. coprophila The practical takeaway: Bti works best as a preventive measure applied before a large population establishes itself. Once you are already seeing clouds of adults, the larvae in the soil may be too mature for Bti to reach them effectively.
Soil amendments offer another angle. A recent study found that mixing black soldier fly byproducts into potting soil cut fungus gnat populations by up to about 93% compared to standard commercial potting mix.13Entomologia Experimentalis et Applicata. Amendment of Potting Soil With Black Soldier Fly Byproducts Affects Fungus Gnat Development The mechanism appeared to work in two ways: females avoided laying eggs in the amended soil, and the higher chitin content in the byproducts may have boosted the soil’s natural suppressiveness against larvae. While black soldier fly frass is currently more of a commercial greenhouse product, it is gradually becoming available to home gardeners as well.
For drain flies, the fix is simpler but easy to overlook: clean the drain. Pouring bleach down the pipe kills some adults on contact but does little to the larval biofilm clinging to the pipe walls. A stiff drain brush or enzyme-based drain cleaner that breaks down organic buildup is more effective. Running water through infrequently used fixtures at least once a week prevents the sludge from accumulating in the first place.
Why They Show Up Seasonally (and Sometimes When They Shouldn’t)
Most gnat species are warm-weather insects whose populations peak in spring and summer, tracking the rise in temperature and humidity that accelerates both microbial growth in soil and larval development times. Indoors, though, fungus gnats can breed year-round because central heating and regular watering keep potting soil warm and moist even in winter. That is why many people first notice their gnat problem in the colder months, when they bring plants inside or when windows stay closed and the tiny flies have nowhere to go but around your face.
Some species are surprisingly cold-hardy. Fungus gnats collected in Fairbanks, Alaska, survived freezing to around minus 31°C by using a strategy researchers described as simultaneous freeze tolerance and freeze avoidance within the same body. The abdomen froze and survived, while the head and thorax remained supercooled and unfrozen, separated by a dramatic difference in water content between the two body regions.14Journal of Comparative Physiology B. Simultaneous freeze tolerance and avoidance in individual fungus gnats, Exechia nugatoria A second, deeper freeze below minus 50°C was invariably fatal. This kind of cold adaptation means that even in harsh climates, outdoor gnat populations can overwinter as adults in sheltered spots like tree bark crevices and emerge as soon as conditions warm.
Quick Guide to Identifying Your Breeding Site
Since different gnats breed in very different places, identifying the culprit helps you target the right spot.
- Fungus gnats: Tiny, dark-bodied flies hovering near potted plants. Larvae live in the top inch of damp soil. Check any pot that stays consistently wet.
- Drain flies: Fuzzy, moth-like wings, often found resting on bathroom or kitchen walls. Larvae live in the biofilm inside drains and pipes. Check floor drains, shower drains, and any fixture that sees infrequent use.
- Eye gnats: Very small, shiny flies attracted to faces and wounds, usually outdoors. Larvae develop in disturbed, moist, sandy soil with organic debris. Common around agricultural land and livestock areas.
- Biting midges: Nearly invisible biters active at dawn and dusk near bodies of water. Larvae develop in muddy margins of ponds, marshes, and even stagnant puddles.
- Black flies: Small, humpbacked biters near streams and rivers. Larvae attach to submerged rocks in flowing water, so breeding sites can be well upstream of where you encounter the adults.
Sticky yellow traps catch fungus gnat and eye gnat adults effectively and can help confirm which species you are dealing with. Placing a few traps near suspected breeding sites for a day or two tells you where the concentration is highest, which points you toward the substrate that needs attention. The adults you see flying around the room are the symptom. The larvae in the soil, drain sludge, or waterlogged margin are the actual population you need to disrupt.