How to Get Rid of Gnats in Your House

Storybook illustration of a friendly cartoon gnat resting on the rim of a houseplant pot

Quick Answer

Most small black gnats flying around a house are fungus gnats, and they come from damp potting soil. To get rid of them, let the top 1 to 2 inches of soil dry between waterings, empty water from saucers, remove rotting plant matter and catch adults on yellow sticky cards. If the "gnats" hover over fruit or sit on bathroom walls, they are fruit flies or drain flies instead.

On this page
  1. What kind of gnats do you have?
  2. Why are there gnats in your house?
  3. How do you get rid of fungus gnats step by step?
  4. What about Bti, nematodes and insecticides?
  5. How do you keep gnats from coming back?
  6. Frequently Asked Questions
  7. Our Take
  8. Sources

Key Takeaways

  • Fungus gnat larvae live in the top 2 to 3 inches of moist potting soil, so drying that layer is the main fix.
  • Check which fly you have first: fruit flies, fungus gnats and drain flies each breed somewhere different.
  • Yellow sticky cards catch adults, and raw potato slices show whether larvae are in a pot.
  • Insecticides are rarely needed for gnats indoors; if you use one, read and follow the label.

What kind of gnats do you have?

"Gnat" is not one insect. People use the word for at least three tiny flies that turn up indoors, and each one breeds in a different place. Getting this right first saves you from drying out plants that were never the problem, or scrubbing drains while the gnats keep hatching in a flowerpot.

Fungus gnat on soil seen from the side: a small, slender fly with a dark head, an orange-brown abdomen, long legs and clear wings
Photo: Toby, CC BY 4.0, via iNaturalist, resized

Fungus gnats are slender black flies about 1/8 inch long with long legs and long antennae [1]. They tend to run across the soil surface and flutter weakly around plants. UC IPM points out that their antennae are longer than their head, which separates them from shore flies with short, bristle-like antennae [2].

Fruit flies are about the same size but tan in front with a darker rear and red eyes, and they hover around ripe fruit and the trash [4]. Drain flies are fuzzy, dark gray flies whose hairy wings fold roof-like over the body, and they usually rest on walls near sinks and tubs [5].

Fruit fly, fungus gnat or drain fly Three simple cartoon flies side by side. Fruit fly: tan body, red eyes, found near fruit and trash. Fungus gnat: slender black body with long legs, found near houseplant soil. Drain fly: fuzzy gray body with wide moth-like wings, found on bathroom walls near drains. Fruit fly Tan front, dark rear, red eyes Breeds in ripe fruit, juice, trash Fungus gnat Slender, black, long legs and antennae Breeds in damp potting soil Drain fly Fuzzy gray, wings held like a roof Breeds in slime film in drains
All three are about 1/16 to 1/8 inch long, so where they gather is often the fastest clue. Descriptions from Colorado State, Kentucky and UC IPM.
ClueFruit flyFungus gnatDrain fly
Color and shapeTan front, dark rear, red eyesSlender, black, long legsFuzzy, gray, moth-like wings
Where you see itFruit bowl, trash, wine glassHouseplant soil, nearby windowsBathroom walls, sinks, tubs
How it movesHovers slowly around foodRuns on soil, weak short flightsShort, hopping flights
What fixes itRemove fermenting foodLet soil dryScrub the drain film
Full guideFruit fly guideThis pageDrain fly guide

If the gnats gather around houseplants, treat the soil; if they gather around food or drains, the plants are not your problem. Still unsure? Try the bug identifier or compare photos on the fungus gnat profile and fruit fly profile.

Why are there gnats in your house?

Fungus gnats point to potting soil that stays wet. Minnesota Extension links them to overwatered soil or soil rich in organic matter, found mostly around houseplants [3]. A female lives about 7 to 10 days and can lay up to 200 eggs into cracks in the soil. The larvae, which are translucent with a shiny black head, feed on fungi, algae and decaying plant matter in the top 2 to 3 inches, and they also chew fine roots [1].

Development is quick. At 75 F, eggs hatch in about 3 days, larvae grow for about 10 days and adults emerge about 4 days after that, roughly 17 days per generation [2]. Colorado State gives three to four weeks at 65 to 75 F.

Where fungus gnat larvae live in a pot A cut-away flower pot. Adults fly just above the soil. Larvae live in the top 2 to 3 inches of moist soil. Letting the top 1 to 2 inches dry and emptying the saucer breaks the cycle. Adults fly just above the soil Larvae: top 2 to 3 in of moist soil Fix: let the top 1 to 2 in dry out Empty the saucer and remove rotting leaves
Larvae stay in the top 2 to 3 inches of moist potting mix (Colorado State University Extension), which is why drying that layer works.

Fall and winter are the worst time. Colorado State explains that plants brought indoors after a summer outside often carry gnats in, and that winter watering keeps the soil moist [1]. In rare cases, Minnesota Extension notes, fungus gnats can develop inside damp walls where fungus grows [3].

How do you get rid of fungus gnats step by step?

Colorado State calls drying the growing medium the single most important step [1]. Work through every pot in the house, not only the one where you saw gnats:

  1. Find the infested pots. Push a few 1/4 inch slices or wedges of raw potato into the soil surface. After a few days, turn them over; larvae gather on the underside. Replace the slices with fresh ones as you keep checking [2].
  2. Let the soil dry. Water only when the top 1 to 2 inches feel dry. Larvae need moisture, so this starves the next generation.
  3. Fix drainage. Use pots with drain holes, and pour out water that collects in saucers and decorative cachepots. UC IPM advises avoiding overwatering and providing good drainage.
  4. Clean up the soil surface. Pick off fallen leaves and remove rotting bulbs or roots. Repot plants whose mix stays soggy or smells sour.
  5. Trap the adults. Stand yellow sticky cards at the edge of each pot or just under the leaves. They catch egg-laying females, and the count tells you whether the problem is shrinking [1].
  6. Check other damp spots. If gnats persist with dry pots, look for wet organic material elsewhere, such as a leaking pipe, a soggy planter on a sunporch or compost scraps.

Sticky cards and drying the soil work together: the cards remove adults, and dry soil stops new ones from growing. Expect to keep at it for at least one full life cycle, about three weeks, before judging the result.

What about Bti, nematodes and insecticides?

For houseplants, insecticides are rarely warranted, according to UC IPM [2]. Try the drying steps for a few weeks first. If larvae are still turning up on potato slices, two biological options exist:

OptionWhat it isWhat sources sayLimits
Bti soil drenchA bacterium (Bacillus thuringiensis subsp. israelensis) that kills gnat larvaeApplied to the soil to kill larvaeDoes not persist indoors; UC IPM notes repeat applications at about 5-day intervals
Beneficial nematodesTiny worms (Steinernema feltiae) applied in waterColorado State reports larval kill within three to four daysLiving organisms; check the product directions for indoor pots
Insecticide for adultsShort-residual products such as pyrethrinsUC IPM: temporary, fast-acting control if nothing else worksDoes not stop larvae; harmful to beneficial insects

Sources for the table: Colorado State University Extension [1] and UC IPM [2], retrieved 2026-11-12.

Bti and pyrethrin products are both pesticides, even when they are biological. Choose an EPA-registered product whose label lists fungus gnats and indoor plants. Read and follow the label. The label is the law. Keep children and pets away from treated plants as the label directs, and store products out of their reach [6]. UC IPM suggests treating houseplants outdoors when possible and waiting about a day before bringing them back inside. Do not pour homemade mixtures of household chemicals into pots.

How do you keep gnats from coming back?

Fungus gnats can show up in any month, but nuisance problems peak in late fall and winter [1], when plants come in for the season and dry indoor air tempts people to water more.

When fungus gnats are most noticeable indoors Twelve monthly bars. Fungus gnats can breed indoors in every month; November through February are marked as the typical peak. Fungus gnat nuisance by month J F M A M J J A S O N D Can breed indoors Typical peak (Nov to Feb)
Typical across much of the U.S.; varies by region. Peak months follow Colorado State University Extension; Minnesota Extension notes they can appear any time of year.

A few habits keep the soil unfriendly to larvae:

  • Water by need, not by calendar. Push a finger into the soil and wait until the top inch or two is dry.
  • Before bringing summer plants indoors, check them with potato slices and let the soil dry.
  • Keep extra potting mix sealed and dry; open bags that stay damp can start a new population.
  • Leave a yellow sticky card in a few pots through winter as an early warning.
  • Group plants where you can see them, such as a bright corner of the living room, so a new outbreak gets noticed early.

When should you call a professional? Fungus gnats in houseplants almost never need one. If gnats keep emerging from a wall, floor or crawl space with no plants nearby, a hidden leak may be feeding fungus in the structure, and a licensed pest professional or a plumber can help find it. Browse our other pest removal guides for more help.

Frequently Asked Questions

Do gnats bite?

Fungus gnats do not bite; Colorado State describes the adults as a nuisance rather than a direct threat [1]. Fruit flies and drain flies do not bite either. If small flies are biting you outdoors, they are a different insect.

Do fungus gnats hurt houseplants?

Usually only a little. Larvae mostly eat fungi and decaying matter, but they also chew fine roots, which can matter for seedlings and stressed plants [1]. Minnesota Extension says they typically do not harm plants.

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

Plan on at least three to four weeks. One generation takes about 17 days at 75 F according to UC IPM [2], and Colorado State gives three to four weeks at 65 to 75 F. Eggs and larvae already in the soil will keep producing adults for a while after you change your watering, so keep the sticky cards up until the counts drop to zero.

Why do I have gnats in my kitchen with no plants?

Gnats in a kitchen without plants are most likely fruit flies breeding in ripe produce, trash or a drain, or drain flies coming from the sink. Use the comparison table above, then follow the fruit fly guide or the drain fly guide.

Our Take

We think the biggest mistake with gnats is treating all small flies the same way. The extension sources we relied on are clear that fungus gnats live in damp potting soil, fruit flies in fermenting food and drain flies in drain slime, so a vinegar trap or a drain cleaner will do little against gnats rising from a flowerpot. Our suggestion: identify the fly first, then put most of your effort into watering less and checking pots with potato slices. Yellow sticky cards are a simple, low-risk way to track progress. Save Bti or an insecticide for the stubborn cases, and only after the soil has had a few weeks to dry, because in our reading of the sources, moisture is what drives the whole problem.

Sources

  1. Fungus Gnats as Houseplant and Indoor Pests (Fact Sheet 5.584). Colorado State University Extension, 2025.
  2. Pest Notes: Fungus Gnats. UC IPM, 2013.
  3. Fungus gnats: What insect is this?. University of Minnesota Extension, 2026.
  4. Fruit Flies (ENTFACT-621). University of Kentucky Entomology, 2026.
  5. Pest Notes: Moth or Drain Flies. UC IPM, 2014.
  6. Pesticide Safety: The Label is the Law. UF/IFAS Gardening Solutions, 2026.

Pest activity and species vary by region. If you are unsure what you have, your local Cooperative Extension office can identify it. Always read and follow pesticide labels. Spotted an error? Tell us.