How to Get Rid of Gnats in Your House

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
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 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].
| Clue | Fruit fly | Fungus gnat | Drain fly |
|---|---|---|---|
| Color and shape | Tan front, dark rear, red eyes | Slender, black, long legs | Fuzzy, gray, moth-like wings |
| Where you see it | Fruit bowl, trash, wine glass | Houseplant soil, nearby windows | Bathroom walls, sinks, tubs |
| How it moves | Hovers slowly around food | Runs on soil, weak short flights | Short, hopping flights |
| What fixes it | Remove fermenting food | Let soil dry | Scrub the drain film |
| Full guide | Fruit fly guide | This page | Drain 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.
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:
- 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].
- Let the soil dry. Water only when the top 1 to 2 inches feel dry. Larvae need moisture, so this starves the next generation.
- 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.
- Clean up the soil surface. Pick off fallen leaves and remove rotting bulbs or roots. Repot plants whose mix stays soggy or smells sour.
- 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].
- 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:
| Option | What it is | What sources say | Limits |
|---|---|---|---|
| Bti soil drench | A bacterium (Bacillus thuringiensis subsp. israelensis) that kills gnat larvae | Applied to the soil to kill larvae | Does not persist indoors; UC IPM notes repeat applications at about 5-day intervals |
| Beneficial nematodes | Tiny worms (Steinernema feltiae) applied in water | Colorado State reports larval kill within three to four days | Living organisms; check the product directions for indoor pots |
| Insecticide for adults | Short-residual products such as pyrethrins | UC IPM: temporary, fast-acting control if nothing else works | Does 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.
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
- Fungus Gnats as Houseplant and Indoor Pests (Fact Sheet 5.584). Colorado State University Extension, 2025.
- Pest Notes: Fungus Gnats. UC IPM, 2013.
- Fungus gnats: What insect is this?. University of Minnesota Extension, 2026.
- Fruit Flies (ENTFACT-621). University of Kentucky Entomology, 2026.
- Pest Notes: Moth or Drain Flies. UC IPM, 2014.
- 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.





