Skip to content
The Bug Identifier

Fungus gnats

Fungus Gnats: What They Are, Why You Have Them, and How to Get Rid of Them

Small dark flies around your plants, your window or your screen at night? Here is how to know for sure, where they are breeding, and how to end them for good.

What are fungus gnats?

Fungus gnats are tiny, dark flies that look like small mosquitoes and breed in damp potting soil. Adults are 1/16 to 1/8 inch (about 1.5 to 3 mm) long, with long legs and long antennae. Most of the ones in homes belong to the family Sciaridae, the dark-winged fungus gnats, and many are in the genus Bradysia.

They are the most common “gnats in the house” for anyone with houseplants. You usually see the adults first, resting on the soil, crawling on a leaf, or flying in short, jerky loops near a pot or a window. Water the plant or bump the pot and a little cloud of them rises up. However, the real problem is out of sight: the larvae in the soil.

One size figure online is wrong, so it is worth stating clearly. Google’s AI answer for this search says fungus gnats are “1/16 to 1/18 inch long”. But 1/18 inch is smaller than 1/16, so that range runs backwards. The source it cites, the University of California’s IPM program, gives 1/16 to 1/8 inch, and notes a few species reach 1/2 inch.

How to recognise a fungus gnat

Check each clue below to narrow down what you saw.

  • Size: 1/16 to 1/8 inch (about 1.5 to 3 mm)

    About the size of a fruit fly, but much thinner. The University of Minnesota and UC IPM give the same range.

  • Colour: grey to black

    Virginia Tech describes the body as greyish to black. They look like specks of soot when they land.

  • Long legs and long antennae

    UC IPM says the antennae are longer than the head. Shore flies, a common look-alike in greenhouses, have very short, bristle-like antennae.

  • Clear or smoky wings with a Y-shaped vein

    Under a magnifier, one vein near the wing tip forks into a Y. Colorado State and Wisconsin both use it to confirm the ID.

  • Weak, darting flight

    They fly in short hops and soon land again. A fly that zooms around the kitchen is more likely a fruit fly.

  • Found near plants, windows and lights

    Adults stay close to the pots they came from, and UC IPM notes they are drawn to light.

Fungus gnats or fruit flies? Telling small flies apart

Look at the eyes and the shape first. A fruit fly is tan with bright red eyes and a rounder body, while a fungus gnat is dark, thin and leggy, like a tiny mosquito. Alabama Cooperative Extension puts fruit flies at 1.5 to 3 mm and fungus gnats at 2 to 4 mm. Where you see them is the next clue.

The difference matters, because each fly breeds somewhere else and needs a different fix. Drying a plant does nothing for fruit flies, and a fruit fly trap does nothing for these gnats. Also, the word “gnat” covers a lot of insects. Biting gnats such as no-see-ums and black flies live outdoors and are a different problem.

Small flies in the house and how to tell them apart

Body shape

Fungus gnat
Thin and leggy, like a tiny mosquito
Fruit fly
Rounder, compact
Drain fly
Fuzzy, moth-like
Shore fly
Stout, like a small house fly

Colour and eyes

Fungus gnat
Grey to black
Fruit fly
Tan, bright red eyes
Drain fly
Grey or tan, hairy
Shore fly
Dark, with about five pale spots on each wing

Size

Fungus gnat
1.5 to 3 mm, some to 4 mm
Fruit fly
1.5 to 3 mm
Drain fly
2 to 5 mm
Shore fly
Small, stockier than a gnat

Where you see it

Fungus gnat
Houseplants, windows, screens
Fruit fly
Fruit bowl, bins, kitchen
Drain fly
Bathroom walls, sinks
Shore fly
Wet greenhouse benches, algae

Breeds in

Fungus gnat
Wet potting soil
Fruit fly
Fermenting food
Drain fly
Slime inside drains
Shore fly
Algae on wet surfaces

The fix

Fungus gnat
Dry the soil, Bti
Fruit fly
Remove the food source
Drain fly
Clean the drain film
Shore fly
Stop the algae and standing water

Fungus gnat and fruit fly sizes from Alabama Cooperative Extension. Shore fly features from UMass Extension and UC IPM. Drain fly details from our own guide.

If the flies cover the bathroom wall and look like tiny moths, see our guide to drain flies in the sink and shower. If they are humped and run across the counter instead of flying, they may be phorid flies, which can point to a broken pipe. And if you are still unsure, a clear photo through the free insect identifier will name it.

Fungus gnat larvae and eggs

Fungus gnat larvae are legless, see-through to white worms with a shiny black head, up to about 1/4 inch (6 mm) long. You can often see the food in their gut through the skin. They live in the top 2 to 3 inches (5 to 8 cm) of damp soil, according to Colorado State University, so you rarely spot them unless you dig.

The larvae eat fungi, algae and rotting plant matter in the soil. When there are a lot of them, they also chew fine roots and the base of young stems. In a heavy infestation, UC IPM says they can leave shiny slime trails on the soil surface, a bit like a tiny snail.

Fungus gnat eggs are almost impossible to see without a magnifier. They are tiny, oval, smooth and white or see-through, according to Colorado State. UMass Extension says a female lays them in clusters of about 20 to 30 on moist soil that is rich in organic matter. Over her short life she lays up to 200 eggs by Colorado State's count, and up to 300 by UMass's, which is why numbers climb so fast.

People also search for “baby gnats”. The baby of a fungus gnat is the larva in the soil, not a smaller flying gnat. Every adult you see flying is already full size. Likewise, a gnat does not grow into a house fly. Gnats are flies already, just a different, much smaller kind.

The potato slice test

This is the easiest way to find out which pots have larvae. Cut a raw potato into slices about 1/4 inch thick and press one, cut side down, onto or into the soil of each plant. Larvae come up to feed on it. Colorado State University says they gather under the slice within a few days.

Lift each slice after one to three days and look underneath. A few clear worms with black heads mean that pot is breeding gnats. No larvae after four days means that pot is probably clean. Throw the slices away after checking, and use fresh ones for each round, as UC IPM advises.

Do fungus gnats bite? Are they harmful?

No, they do not bite people or pets. UC IPM, Colorado State and Iowa State all say the adults do not bite, and Colorado State adds that they do not feed at all. They are an annoyance, not a health risk. If something small is biting you indoors, it is a different insect.

For that, our guide to small black bugs in the house includes a table of which tiny bugs bite and which do not. It also covers fleas and minute pirate bugs, the usual biters people mistake for gnats.

Can fungus gnats hurt your plants?

Sometimes, but less often than people fear. The larvae can chew roots and stunt growth, mostly in seedlings, cuttings and young plants with small root systems. The University of Wisconsin says this sort of damage is rare in home settings, and the adults do not harm plants at all.

A wilting houseplant is more often a watering problem than a gnat problem. UC IPM points out that wilting more often comes from overwatering, root rot or poor drainage. The gnats are a sign of the same wet soil that causes those problems, so they get the blame.

There is one real risk in greenhouses and seed trays. UMass Extension notes that fungus gnat larvae may carry soil diseases such as Pythium, Thielaviopsis and Fusarium, and their feeding wounds let those diseases into the roots. Watch for these signs of real damage:

Why do I have fungus gnats? Where they come from

You have fungus gnats because something in your home is staying wet and full of organic matter. Usually that is overwatered potting soil, especially mixes high in peat moss, which Colorado State says females find most attractive. What attracts gnats is that mix of moisture and rotting organic matter, plus light for the adults. They arrive on a new plant, in a bag of soil, or through a window, then breed in the wettest pot.

They do not appear from nowhere, and they do not build nests. What looks like a “gnat nest” is a pot of wet soil full of larvae. When people say they suddenly have gnats, one of these is nearly always the reason:

Gnats in the house but no houseplants?

It happens, and it is one of the most confusing cases. These flies need moisture and fungus, not a plant. Iowa State Extension lists slow drains, cracks that hold moisture, and refrigerator drain pans as breeding sites. The University of Minnesota adds that, rarely, they breed inside walls where a leak lets fungus grow.

Where fungus gnats breed when there are no houseplants

Refrigerator drain pan

The clue
Gnats in the kitchen with no fruit out
What to do
Pull the kick plate, empty and clean the pan

Slow sink or floor drain

The clue
Gnats near one drain; also check for drain flies
What to do
Clear the trap and scrub out the debris

Damp cracks, leaks, wet cabinet base

The clue
Gnats in one spot near plumbing
What to do
Fix the leak and let the area dry

Wall or ceiling after a leak

The clue
Gnats coming from a wall or outlet, a musty smell
What to do
Find the moisture source, and call a pro if you cannot

Compost bin, mulch, wet garden soil by a door

The clue
Gnats near the entry, worse after rain
What to do
Move the compost, screen doors and windows

Pet, reptile or terrarium substrate

The clue
Gnats around the enclosure
What to do
Change the substrate and keep the top drier

Breeding sites from Iowa State Extension, the University of Maryland and the University of Minnesota. Compost and mulch from UC IPM.

How to find where the gnats are coming from

Cover the suspect and wait. The University of Maryland suggests putting a piece of window screen or cheesecloth over a plant pot or a drain for several days. If gnats collect under the cover, that is your source. Then move on to the next suspect until you have checked them all.

Pair the cover test with the potato slices for plants and yellow sticky cards for everything else. A card beside each pot or drain shows where the most adults are. The card that fills fastest is usually closest to the breeding site, because these weak fliers do not travel far.

Fungus gnat life cycle and how long they live

A fungus gnat goes from egg to adult in about 17 days at 75°F (24°C), according to UC IPM, and in 3 to 4 weeks at 65 to 75°F (18 to 24°C), according to Colorado State. Adults live about 7 to 10 days. Indoors the generations overlap and run all year, so you see adults, eggs and larvae at once.

Fungus gnat life cycle by stage

Egg

How long it lasts
About 3 to 6 days
Where it is
In clusters on moist soil
What it looks like
Tiny, oval, white or see-through

Larva

How long it lasts
About 10 to 14 days
Where it is
Top 2 to 3 inches (5 to 8 cm) of soil
What it looks like
Clear worm, shiny black head, up to 1/4 inch (6 mm)

Pupa

How long it lasts
About 4 to 6 days
Where it is
Near the soil surface
What it looks like
Small, oblong, hidden in the soil

Adult

How long it lasts
About 7 to 10 days
Where it is
On soil, leaves, windows, screens
What it looks like
Dark, thin fly, 1/16 to 1/8 inch (1.5 to 3 mm)

Ranges combine UC IPM (at 75°F), the University of Wisconsin, UMass Extension and Colorado State University. Warmer rooms make every stage shorter.

The numbers explain why the problem feels endless. A single adult lives about a week. But in that time a female lays up to a few hundred eggs, and those eggs are already adults again two to three weeks later. Meanwhile, more eggs keep going in. That is why killing the flies you see never ends it.

Why getting rid of them takes 3 to 4 weeks

No method kills every stage at once. Drying the soil kills eggs and young larvae near the surface. Bti kills larvae only, and the University of Wisconsin says it does not touch eggs, pupae or adults. So you have to keep going until every egg laid before you started has hatched and been dealt with.

What happens week by week when you treat fungus gnats properly

Days 1 to 7

What is happening in the pot
Drying and Bti start killing larvae; pupae already in the soil keep hatching
What you see
Just as many adults, sometimes more. This is normal

Days 8 to 14

What is happening in the pot
Few new larvae survive; most adults alive now are old and dying
What you see
Adults clearly fewer on the sticky cards

Days 15 to 21

What is happening in the pot
Eggs laid in week one have hatched into dry soil or Bti and died
What you see
Only a few stragglers

Days 22 to 28

What is happening in the pot
No new generation left to emerge
What you see
Empty cards and clean potato slices: you are done

Our timeline, built from the stage lengths above. The University of Wisconsin and Oklahoma State both say a fall infestation takes 3 to 4 weeks of changed watering and a sand topping to clear.

Most people quit in the first week, right when the adults look just as bad as ever. Those adults came from pupae that were already in the soil. Stay the course, and the drop in the second week will tell you it is working.

How to get rid of fungus gnats

To get rid of fungus gnats, dry out the top 1 to 2 inches of soil between waterings, water from the bottom, and add a sand or gravel topping. Then treat any pot that still has larvae with Bti every 5 to 7 days, and trap adults with yellow sticky cards. Keep it up for 3 to 4 weeks. Most homes never need an insecticide.

The order below starts with what costs nothing and ends with the options you will rarely need. Oklahoma State calls changing the growing conditions “the single most important step”. In fact, Iowa State goes further and says insecticides are not effective against them in household situations.

The 3 to 4 week fungus gnat routine

  1. Find every pot that has larvae

    Push a 1/4 inch slice of raw potato, cut side down, into the soil of each plant. After one to three days, lift it and look underneath. See-through worms with black heads mean that pot is breeding fungus gnats. Colorado State University says larvae show up on the slice within a few days.

  2. Let the top 1 to 2 inches of soil dry out

    Water less often, and wait until the top 1 to 2 inches (2.5 to 5 cm) feel dry before you water again. Drying kills the eggs and the larvae near the surface. Empty saucers and trays after watering, so no water sits under the pot.

  3. Water from the bottom

    Stand the pot in a tray of water, let the soil soak it up from below, then let it drain. The roots get water while the top of the soil stays dry, which is where females lay their eggs. Wisconsin and Oklahoma State extension both recommend bottom watering for fungus gnats.

  4. Cover the soil with sand or fine gravel

    Spread 1/2 to 1 inch (1.3 to 2.5 cm) of coarse sand or fine gravel over the soil. The layer dries fast, so it is a poor place to lay eggs. The University of Wisconsin and Oklahoma State both recommend it.

  5. Treat the soil with Bti

    For pots that still have larvae, water in a product made with Bti (Bacillus thuringiensis israelensis), such as Mosquito Bits or Gnatrol, mixed and applied exactly as the label says. Bti kills larvae only, so repeat it every 5 to 7 days until no new adults appear.

  6. Catch the adults with yellow sticky traps

    Stand small yellow sticky cards in the pots, close to the soil. They catch adult females before they lay eggs, and they show you whether numbers are falling. Change them when they fill up.

  7. Keep going for 3 to 4 weeks

    Stick with the routine for at least three weeks, and up to four. That is how long one full generation takes to hatch out and die off. If the sticky cards stay almost empty for a week and the potato slices come up clean, you are done.

1. Dry out the soil (free)

Drying the soil is the single best fix, and it costs nothing. Colorado State says to let the top 1 to 2 inches dry between waterings, because drying kills the eggs and larvae. Push a finger into the soil to check. If it feels damp at the first knuckle, wait.

Some plants cannot dry out much, such as ferns, carnivorous plants and seedlings. For those, rely more on bottom watering, the sand topping and Bti. In contrast, most common houseplants handle a drier surface well and often grow better for it.

2. Add a sand or gravel topping (cheap)

A layer of 1/2 to 1 inch (1.3 to 2.5 cm) of coarse sand or fine gravel keeps the surface dry, so females have nowhere good to lay eggs. The University of Wisconsin and Oklahoma State both recommend it. Plenty of gardeners on Reddit say it was the step that finally worked. Wisconsin specifies coarse sand or fine gravel, so skip fine play sand.

3. Repot with clean, fresh mix

If a pot is badly infested or the mix is old and soggy, repot it. Shake off as much old soil as you can and use fresh, pasteurized potting mix. UC IPM advises avoiding mixes with compost that has not fully broken down, and adding perlite or sand to improve drainage. Also remove any rotting bulbs or roots, which feed the larvae.

Store open bags of potting mix sealed, and off the ground, so gnats cannot lay eggs in them. If a new bag already has gnats, take it back, or solarize it as UC IPM describes: moisten it, seal it in plastic no more than 8 inches (20 cm) deep, and leave it in full sun for 4 to 6 weeks.

4. Treat the soil with Bti

Bti is the tool that ends most bad infestations. It is a soil bacterium, Bacillus thuringiensis subspecies israelensis, and EPA says its toxins only affect the larvae of mosquitoes, black flies and fungus gnats. EPA also states that Bti has no toxicity to people. Home products include Mosquito Bits and Gnatrol.

Water it into the soil so it reaches the larvae. UC IPM notes that Bti breaks down quickly indoors, so the University of Wisconsin and Oklahoma State advise repeat doses 5 to 7 days apart. Note that only the israelensis type works. Colorado State warns that Bt products sold for caterpillars do nothing to fungus gnats.

5. Beneficial nematodes and predators

Tiny worms called beneficial nematodes, Steinernema feltiae, hunt fungus gnat larvae in the soil. Colorado State says larvae die within 3 to 4 days of a soil drench. UC IPM rates this species as the most effective nematode for the job, and says it works at 60 to 90°F (16 to 32°C) in moist soil.

They come by mail order and are alive, so use them as soon as they arrive. Predatory mites (Stratiolaelaps scimitus) and rove beetles (Dalotia coriaria) also eat the larvae. These are mostly greenhouse tools, and UC IPM says the mites probably do not work well in single houseplants. As for what eats fungus gnats indoors, small spiders such as jumping spiders catch a few adults, but never enough to end it.

6. Yellow sticky traps

Yellow sticky cards catch the adults and show you how many are left. Place them low, near the soil or at the edge of the pot. They help, because every female you catch is a female that lays no more eggs. However, Iowa State notes that traps kill only adults, so on their own they will not solve the problem.

7. Insecticides, last and only if needed

If drying, sand and Bti are working, you do not need an insecticide. UC IPM says insecticides are rarely warranted in and around homes. If adults are still out of control after several weeks of changed watering, a pyrethrin spray labeled for houseplants can give fast but short control of the adults.

The University of Wisconsin says to spray the plant and the soil surface, never the air. UC IPM advises moving plants outdoors to spray them where possible, and waiting about a day before bringing them back. Do not use foggers or bug bombs. Short-lived sprays such as soaps, oils and neem do not affect the larvae in the soil, according to Colorado State.

Fungus gnat treatments compared

Drying the top 1 to 2 inches

Kills
Eggs and young larvae
Evidence
Strong. Every extension source
Cost
Free
Best for
Every pot that can take it

Bottom watering

Kills
Prevents egg laying
Evidence
Good. Wisconsin, Oklahoma State
Cost
Free
Best for
Plants that need steady moisture

Sand or gravel topping

Kills
Prevents egg laying
Evidence
Good. Wisconsin, Oklahoma State
Cost
A few dollars
Best for
Long-term prevention

Repotting with fresh mix

Kills
Removes larvae and eggs
Evidence
Good. UC IPM, Colorado State
Cost
Low
Best for
Old, soggy or badly infested mix

Bti drench

Kills
Larvae only
Evidence
Strong. UC IPM, EPA, extension
Cost
Low
Best for
Heavy infestations, many plants

Steinernema feltiae nematodes

Kills
Larvae
Evidence
Good. UC IPM, Colorado State
Cost
Medium, perishable
Best for
Greenhouses, many pots

Yellow sticky traps

Kills
Adults only
Evidence
Good for monitoring
Cost
Low
Best for
Tracking progress, catching females

Hydrogen peroxide drench

Kills
Some larvae, unclear
Evidence
Weak. No extension testing
Cost
Low
Best for
Not our first choice. See below

Pyrethrin spray

Kills
Adults, short term
Evidence
Works briefly; Iowa State says not effective at home
Cost
Medium
Best for
A last resort, outdoors

What does not work, or is not proven

Several popular fixes do little against these flies, and one of them is advice that ranks high on Google. Vinegar traps catch fruit flies, not soil gnats, according to the University of Wisconsin and Oklahoma State. Hydrogen peroxide and cinnamon are widely shared but have little testing behind them. Here is what the evidence actually says.

How to prevent fungus gnats

The best prevention is not overwatering: let the top of the soil dry between waterings, and never leave water standing in saucers. Use a fast-draining mix, keep potting soil bags sealed, and check new plants before they join the others. Prevention matters most in fall, when plants come in from outside.

Wet soil also brings other pests. Springtails, the tiny jumping specks on wet soil, need the same moisture, and our guide to tiny white bugs in soil and around the house covers them. For pests on the leaves rather than in the soil, see spider mites on houseplants.

Fungus gnats outside

They live outdoors too, in damp mulch, compost, leaf litter and wet garden soil. Outside they are part of the clean-up crew that breaks down rotting plant matter, and they rarely need any control. UC IPM notes that serious damage is more common in greenhouses, nurseries and sod farms than in home gardens.

Some people find a strange sight after a wet spell: a slow-moving ribbon of tiny worms crossing a path or a lawn. The University of Maryland says these are the larvae of dark-winged fungus gnats, which travel in snake-like masses in wet years near wooded areas. They are harmless, and no treatment is needed.

When to call someone

Most fungus gnat problems are a do-it-yourself job. Call a licensed pest professional or a plumber if gnats keep coming with no plants in the house and you cannot find the source, or if they seem to come from a wall, ceiling or floor. That points to hidden moisture, and the leak matters more than the gnats.

Not sure it is a fungus gnat at all? Take a sharp photo of one on a sticky card and run it through our bug identifier by picture before you buy anything.

Pest control disclaimer. Photo-based identification can help, but it is not always perfect. For dangerous spiders, large infestations, or anything you are unsure about, contact a licensed pest control professional.

Fungus gnats FAQ

Do fungus gnats spread from plant to plant?
Yes. The adults are weak fliers, but they still drift from pot to pot, and a female lays her eggs in whatever damp soil she lands on. That is why one plant can turn into every plant on the shelf. Check all your pots with the potato test, and treat every pot that has larvae at the same time.
Can I still use a bag of potting soil that has gnats in it?
You can, once you kill what is inside it. UC IPM explains how to solarize soil: moisten it, seal it in clear or black plastic no more than 8 inches (20 cm) deep, and leave it raised off the ground in full sun for 4 to 6 weeks. The simpler choice is to return the bag and buy a pasteurized mix.
Do fungus gnats die in the winter?
Not indoors. Inside a warm house they breed all year, and Colorado State University Extension says problems peak in late fall and winter. In California's interior, UC IPM says outdoor numbers actually peak in winter and spring.
What do adult fungus gnats eat?
Very little. Colorado State University says the adults do not feed on plants or people, though they may sip water from leaves or the soil surface. All the eating happens in the larval stage, when the young feed on fungi, algae, rotting plant matter and sometimes fine roots in the soil.
Are fungus gnats a sign of mold?
They are a sign of wet soil, which is where mold and other fungi grow. The larvae feed on that fungal growth, which is how these gnats got their name. White fuzz on the soil surface plus gnats almost always means the pot is staying too wet, so dry it out and the fuzz and the gnats both fade.
Why do fungus gnats fly around my laptop or TV at night?
Because the adults are drawn to light, as UC IPM notes. In a dark room a screen is the brightest thing around, so the gnats from the nearest plant drift toward it. A lit window does the same in the daytime. The screen is not the source, so look in the plants closest to it.
Can fungus gnats live in a terrarium or a reptile enclosure?
Yes. Any setup that keeps the substrate wet and full of organic matter suits them, so terrariums, seed trays and reptile tanks all get them. You often cannot let those dry out. In that case lean on Bti, which EPA says has no toxicity to people. Check the product label for use around animals before you apply it.

Related guides

Sources

Not sure it is this one?

Identify a bug