The short answer
- Find the pots that are breeding them. Push slices of raw potato into the soil and check the undersides after a few days for small white larvae with black heads; yellow sticky cards near the pots show where the adults are.[1][2][4]
- Water less. Colorado State calls letting the soil dry between waterings, especially the top 1 to 2 inches, the most important step. Empty saucers so pots don't sit in water.[2][5][1]
- Repot heavily infested plants in fresh, pasteurized potting mix, and toss soil that has broken down and stays soggy.[2][3][7][1]
- If gnats persist, drench the soil with a Bti product labeled for fungus gnats (repeat about every five days) or with Steinernema feltiae nematodes.[1][2][5][7]
- Sticky cards catch adults and help a little, but they don't reach the larvae. Sprays and fogs aimed at the flies give only temporary relief.[1][2][6][8]
Fungus gnats and look-alike small flies
Make sure they're fungus gnats
Fungus gnats are small, about 1/16 to 1/8 inch long (Kentucky gives 3 to 4 mm), slender and black or dark gray, with long legs, long antennae and clear to gray wings. They fly weakly, in short, erratic hops, so they stay close to the pots they came from, run across the soil surface and gather at nearby windows because they're drawn to light. People notice them flying around their faces and computer screens.[1][2][3][6][5]
- Larvae: up to about 1/4 inch (6 mm), white to translucent, legless, with a shiny black head. They live in the soil, mostly near the surface. In very wet, heavily infested pots they can leave shiny slime trails on the soil that look like trails from tiny slugs.[1][6][5][4]
- Fruit flies are brown-black, often red-eyed, and gather around overripe fruit and trash bins rather than plant pots. Drain flies are fuzzy, moth-like, dark gray to black, and found near sinks and tubs. If the flies aren't tied to your plants, start with our small flies indoors page and the fruit fly and drain fly guide instead.[3][6]
- Shore flies also breed in wet potting mix and algae, mostly in greenhouses. They're sturdier than fungus gnats and have short, bristle-like antennae instead of long ones.[1]
- Wilting isn't proof of gnats. UC IPM says overwatering, underwatering, root rot fungi and poor drainage are much more common causes of a wilting houseplant than fungus gnat larvae.[1]
Why you have them: wet soil
Females lay their eggs in the cracks of moist potting mix, and mixes high in peat moss are especially attractive. Each female can lay 100 to 200 eggs during an adult life of only 7 to 10 days. The larvae feed mostly in the top 2 to 3 inches of the mix on fungi, algae and decaying plant matter, and on root hairs and tender roots as well. Kansas State notes that larvae need fungi as part of their diet to complete development.[2][3][4]
- How fast: at 75°F, UC IPM says eggs hatch in about 3 days, larvae feed for about 10 days, and adults emerge about 4 days later, so a generation can take about 17 days. Colorado State puts egg to adult at three to four weeks at typical room temperatures of 65 to 75 F, and Kansas State gives 20 to 28 days. Generations overlap, so every stage is in the pot at once.[1][2][4]
- Why fall and winter: houseplants pick up gnats while they summer outdoors, then are brought in. Shorter days and cooler rooms slow plant growth and water use, so if the watering schedule doesn't change, the mix stays wet. Colorado State says older potting mix that has broken down also holds more water.[2][6]
- Other ways in: Texas A&M points to potting soil that was infested in storage or by the manufacturer, and the NC State county article adds newly purchased plants and open doors and windows.[6][7]
- Damage: established houseplants rarely suffer much. Seedlings, cuttings and young plants are the most likely to be stunted when larvae chew their roots, and UC IPM has seen root damage and even plant death in houseplants and interior plantings with high numbers in moist, organically rich soil.[1][4][5][7]
Find the infested pots: potato slices and sticky cards
If you have more than one plant, test each pot before treating anything. Larvae are the stage to target, and only some pots may have them.[1][2]
- Potato test: push 1/4 inch slices or wedges of raw potato into the soil surface, or set chunks on it cut side down. Larvae move to the potato and start feeding within a few days. Lift and turn each piece to look for larvae on the underside.[2][1]
- Kansas State reports that potato disks recovered more larvae (38%) than carrot disks (23%), and that leaving them 48 hours worked better than 24 hours.[4]
- The potato pieces also pull some larvae away from roots. UC IPM says to remove and discard infested pieces after a few days and put in fresh ones.[1]
- Yellow sticky cards: cut them into small squares on skewers in the pots, or stand them at the edge of the container under the plant canopy. Adults are attracted to yellow. Kansas State notes that no one has found a reliable link between adult counts on cards and the number of larvae in the soil, so treat cards as a sign of which pots are active, not as a count.[1][2][4][7]
- Our indoor sticky traps guide covers where to place cards and how to handle them.[1]
Change how you water
Drying the surface of the mix is the single most useful step. Dry soil kills eggs and young larvae, and Colorado State and Kansas State both say a dry surface is less attractive to egg-laying females. Kansas State found larvae survive best at a middling moisture level (52 percent in one study) and do worse in very wet or very dry mix.[2][4][5]
- How dry: Colorado State says the top 1 to 2 inches; Kansas State, writing for growers, gives the upper 1.0 to 3.0 inches; an NC State county article says the top inch for most houseplants. Moisture-loving plants can't tolerate this, so don't push those to wilting.[2][4][7][5]
- Saucers: empty water from saucers after watering. Clemson adds that saucers under plants kept outdoors should be turned upside down so they don't collect rain.[5][1][8]
- Drainage: use pots with drainage holes, and a mix that drains well. UC IPM suggests more perlite or sand in the mix.[1][7][3]
- Bottom watering: the NC State county article suggests watering from the bottom where possible, so the surface where gnats lay eggs stays drier.[7]
- Give it time. Texas A&M warns that once gnats are well established, drying the soil alone may not be enough. Colorado State suggests waiting several weeks after changing your watering before turning to insecticides.[6][2]
Repot, replace or pasteurize the soil
Old, broken-down mix holds water and decaying material, and Colorado State recommends repotting every so often for that reason. When an infestation hangs on, repotting into fresh mix removes most of the larvae in one step.[2][7][6]
- Use pasteurized or sterile potting mix, and keep stored bags closed and off the ground so they don't get infested before use.[1][3][8]
- Don't add compost that hasn't fully broken down to potting mix unless it's been pasteurized, since UC IPM says it's often already infested. Go easy on manure, blood meal and similar organic fertilizers.[1]
- Remove decaying bulbs, rotting roots and fallen leaves on the soil surface: they feed larvae.[2][1]
- Solarizing soil: UC IPM's home method is to moisten the soil, seal it in clear or black plastic bags no more than about 8 inches deep, and leave it on a raised surface in full sun for 4 to 6 weeks.[1]
- Clean pots before reusing them, and don't move infested plants among clean ones while you treat.[7][1]
- If weather allows, moving infested pots outdoors can end the indoor problem. In some cases throwing out a badly infested plant is the simplest fix.[6][3][1]
Sand, gravel and other top layers: what the evidence says
A layer of sand, gravel or diatomaceous earth on the soil is a popular tip, and sources disagree on it. An NC State county extension article recommends top-dressing with coarse sand, gravel or diatomaceous earth to discourage egg-laying and help the surface dry, combined with other steps. Laboratory work at Kansas State found otherwise.[7][4][9]
- Sand: Kansas State reports that a sand layer was proposed to make the surface unattractive to egg-laying females, but even a 3.1 mm layer didn't prevent adult emergence or stop egg-laying.[4]
- Diatomaceous earth: in a Kansas State laboratory study, dry or moist layers 3.1 and 6.3 mm thick generally didn't prevent adults from emerging or females from laying eggs. The dry layers absorbed moisture from the mix and cracked, and larvae pupated and females laid eggs through the fissures. Kansas State doesn't recommend it for fungus gnats.[10][4][9]
- Coarser aggregate: a review by the same researcher says a layer of recycled-glass growing aggregate reduced adult emergence over time and may cut egg-laying, depending on how thick the layer was, and that any barrier works only as part of a wider plan.[9]
- A university garden library answering a reader's question doubted that sand on top would help and warned it can crust and hurt drainage.[8]
- Bottom line: a top layer is not a fix by itself. The review explains that fine layers fail because their small openings still let larvae pupate and females lay eggs, so if you try one, keep drying the soil and treating the larvae as well.[9][4][7]
Bti soil drenches
Bti (Bacillus thuringiensis subspecies israelensis) is a bacterium toxic only to the larvae of certain flies, including fungus gnats, mosquitoes and black flies. Mixed with water and poured onto the soil as a drench, it kills fungus gnat larvae. The Bt sold for caterpillars is a different subspecies and does not work on fly larvae.[1][2][5][7]
- Repeat it: UC IPM says Bti doesn't reproduce or persist indoors, so potted plants may need applications at about five-day intervals.[1]
- Treat early: Kansas State says Bti works better on first and second instar larvae than on older ones, and a laboratory study found no effect on second and third instars. Apply before numbers build and keep repeating so each new hatch is hit while young.[4][11]
- Finding it: UC IPM and the NC State county article say Bti products are sold at nurseries and garden centers, and the NC State article notes some mosquito-control products contain it. Colorado State says formulations sold for fungus gnats generally aren't available at retail. Use a product whose label covers houseplants or fungus gnats and follow it.[1][7][2]
- Our Bti page covers the active ingredient in more detail.[1]
Beneficial nematodes and predatory mites
Steinernema feltiae, an insect-parasitic nematode, is the species UC IPM, Colorado State and Kansas State name as the most effective against fungus gnat larvae. The microscopic worms enter the larvae, and Colorado State says the larvae die within three to four days. They're mixed with water and applied as a soil drench.[1][2][4]
- Unlike Bti, nematodes reproduce and hunt for hosts. In moist mix, UC IPM says they can give longer control after several applications to establish them.[1]
- Temperature: UC IPM says Steinernema feltiae works at 60° to 90°F in moist conditions; Kansas State gives 46°F to 86°F for infection. Typical room temperatures of 65 to 75 F fall inside both ranges.[1][4][2]
- They're live and perishable, usually mail-ordered, and have to be applied right away. Kansas State says they work best applied before larvae build to damaging numbers.[1][4]
- In a greenhouse trial on potted cacti, Steinernema feltiae cut the number of adult gnats caught on yellow traps by 90% compared with untreated pots.[12]
- Predatory soil mites (Stratiolaelaps, sold as Hypoaspis) are used against fungus gnat larvae in greenhouses, but UC IPM says they probably won't perform well in individual houseplants and aren't a good choice for homes. Our beneficial nematodes guide covers handling and application.[1][4]
Sprays and systemic products
UC IPM says insecticides are rarely warranted for fungus gnats in and around homes. Texas A&M puts it plainly: indoor sprays and fogs may give temporary relief, but finding and eliminating the breeding sites is the only way to get rid of them.[1][6]
- Sprays aimed at adults don't touch the larvae in the soil, so adults keep emerging. Colorado State says short-lived contact products such as pyrethrins, soaps, oils and neem need repeating every couple of days to show any effect.[2][3]
- If populations are intolerable and Bti or nematodes aren't available, UC IPM says a pyrethrin or pyrethroid product labeled for houseplants can give temporary control. Spray the soil surface and plant parts where adults rest; don't fog or spray gnats in flight. If possible, treat the plants outdoors and wait about a day before bringing them back in.[1][2]
- Colorado State notes that imidacloprid, sold in some houseplant granules and spikes, kills larvae in the mix. Our imidacloprid page covers that active ingredient.[2]
- Pyrethroids are more toxic to beneficial insects than pyrethrins, and UC IPM suggests protecting natural enemies, such as predatory hunter flies that catch gnats, by avoiding broad-spectrum sprays outdoors and in greenhouses.[1]
Keeping them from coming back
Prevention comes down to the same two things that end an infestation: potting mix that dries between waterings, and no infested soil or plants brought in.[2][1][6]
- Infested bagged mix and newly bought plants are common sources, so check them before they go near your other plants.[6][7]
- Plants that spent the summer outdoors often bring gnats in. Check them with a potato slice when they come inside, and cut back watering as their growth slows in fall.[2]
- Keep a sticky card in a few pots as an early warning.[2][4]
- Outdoors, moist grass clippings, compost, organic fertilizers and mulch also breed fungus gnats, but UC IPM says larvae outdoors don't usually cause serious damage. Fix leaks and standing water near the house, and screen and caulk doors and windows.[1]
Common questions
- Do fungus gnats bite?
- No. Adult fungus gnats don't bite people or pets and don't damage plants; they're a nuisance. Only the larvae in the soil feed on roots.[1][2][3]
- How long does it take to get rid of fungus gnats?
- Expect several weeks. Adults live 7 to 10 days, but eggs and larvae already in the soil keep emerging, and one generation takes about 17 days at 75°F to three or four weeks. Colorado State suggests giving watering changes several weeks before reaching for insecticides.[1][2][3]
- Does a potato really work for fungus gnats?
- As a test, yes. Raw potato attracts larvae within a few days, and Kansas State found it recovered more larvae than carrot. Swapping in fresh pieces also removes some larvae, but it won't clear a pot on its own.[2][1][4]
- Will putting sand on top of the soil stop fungus gnats?
- The evidence is weak. Laboratory studies at Kansas State found thin sand and diatomaceous earth layers didn't stop adults emerging or females laying eggs, though a coarser recycled-glass layer did reduce emergence. Some extension advice still suggests coarse sand or gravel as one step among several.[4][10][9][7]
- Can I use mosquito-control Bti on my houseplants?
- Bti is the same bacterium used against mosquito larvae, and an NC State county article notes some mosquito products contain it. Only use a product in a way its label allows, and repeat about every five days.[7][1][5]
- Why do I still have gnats after letting the soil dry?
- The surface may not be dry deep enough, other pots may be infested, or the population is too established for drying alone. Texas A&M says the soil may then need to be treated or replaced.[2][6]
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
Sources
- 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 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 Kentucky Entomology, “Small Flies, ENTFACT-657.” entomology.mgcafe.uky.edu/ef657 (accessed 2026-11-10)
- Kansas State University Research and Extension, “Fungus Gnat Management in Greenhouses and Nurseries, MF2937 (R. A. Cloyd).” bookstore.ksre.ksu.edu/pubs/MF2937.pdf (accessed 2026-11-10)
- Clemson Cooperative Extension, “Common Houseplant Insects & Related Pests, HGIC.” hgic.clemson.edu/factsheet/common-houseplant-insects-related-pests/ (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)
- N.C. Cooperative Extension, Beaufort County Center, “Fungus Gnats: Tiny Pests in Houseplants and How to Control Them (2025).” beaufort.ces.ncsu.edu/2025/04/fungus-gnats-tiny-pests-in-houseplants-and-how-to-control-them (accessed 2026-11-10)
- Elisabeth C. Miller Library, University of Washington Botanic Gardens, “Managing fungus gnats indoors (Plant Answer Line).” depts.washington.edu/hortlib/pal/managing-fungus-gnats-indoors (accessed 2026-11-10)
- Insects (PubMed 26463188, PMC4553482), “Cloyd RA. Ecology of fungus gnats (Bradysia spp.) in greenhouse production systems associated with disease-interactions and alternative management strategies. Insects 2015;6(2):325-332.” pmc.ncbi.nlm.nih.gov/articles/PMC4553482/ (accessed 2026-11-10)
- Journal of Economic Entomology (PubMed 17849889), “Cloyd RA, Dickinson A, Kemp KE. Effect of diatomaceous earth and Trichoderma harzianum T-22 on the fungus gnat Bradysia sp. nr. coprophila. J Econ Entomol 2007;100(4):1353-1359.” pubmed.ncbi.nlm.nih.gov/17849889/ (accessed 2026-11-10)
- Pest Management Science (PubMed 16408320), “Cloyd RA, Dickinson A. Effect of Bacillus thuringiensis subsp. israelensis and neonicotinoid insecticides on the fungus gnat Bradysia sp nr. coprophila. Pest Manag Sci 2006;62(2):171-177.” pubmed.ncbi.nlm.nih.gov/16408320/ (accessed 2026-11-10)
- Communications in Agricultural and Applied Biological Sciences (PubMed 27145569), “Stefanovska T et al. The potential for using entomopathogenic nematodes to control darkwinged fungus gnats Bradysia coprophila on succulents in glass houses. Commun Agric Appl Biol Sci 2015;80(2):41-45.” pubmed.ncbi.nlm.nih.gov/27145569/ (accessed 2026-11-10)