Odors and household pests

How to get rid of gnats in the house: identify them, then fix the source

To get rid of gnats in the house, first work out which tiny fly you have, because each breeds somewhere different. Fungus gnats come from damp houseplant soil, fruit flies from fermenting food and trash, and drain flies from slime in pipes. Remove or dry out that source, then catch the adults with sticky cards or a vinegar trap.

Written by BroombookPublished · Updated 8 steps Easy

As an Amazon Associate, Broombook earns from qualifying purchases.

At a glance

Time
1 hour to identify and clean, plus 2 to 3 weeks of follow-up
Difficulty
Easy
How often
As needed; check plants, drains and the trash weekly while you have gnats

What you need

  • Yellow sticky cards
  • Clear packing tape
  • Clear plastic food storage bags
  • Apple cider vinegar and dish soap
  • A raw potato
  • Stiff drain brush
  • Vacuum with a hose attachment
Products that help
On this page

Step by step: how to get rid of gnats in the house

  1. 1

    Catch one and look closely

    Press a strip of clear tape onto a resting gnat, or let one land on a yellow sticky card, and look at it under a bright light or with your phone’s zoom. Note the color, the shape and whether it is fuzzy. Use the table below to match it.

  2. 2

    Watch where they gather

    Spend a day noting where you see the most: hovering over a plant pot, circling the fruit bowl or trash, or sitting on the bathroom wall next to the tub. Gnats rarely stray far from where they hatched, so the crowd points to the source.

  3. 3

    Test the drains with tape

    Lay a strip of clear packing tape across each suspect drain, sticky side down, leaving a gap so air still flows. Check it the next morning and again after a few days. Flies stuck to the tape mean that drain is breeding them.

  4. 4

    Test the houseplants with potato

    Push a few 1/4 inch slices of raw potato onto the soil of each plant. After 2 or 3 days, flip them over: tiny clear larvae with black heads on the underside mean fungus gnats are breeding in that pot.

  5. 5

    Dry out infested plant soil

    Let the top 1 to 2 inches of soil dry completely between waterings, and empty water from saucers within 30 minutes. Stick yellow sticky cards at soil level to catch adults. Dry soil kills eggs and young larvae and stops new egg laying.

  6. 6

    Clear out fermenting food and trash

    If the gnats are in the kitchen, throw out overripe produce, wash the trash can and recycling bin, and wipe up sticky spills under appliances. Set a jar of apple cider vinegar with a drop of dish soap under plastic wrap with small holes to catch the adults.

  7. 7

    Scrub any drain that tested positive

    Take out the stopper and scrub inside the pipe with a stiff drain brush to break up the slimy film, then run hot water. Follow up with an enzyme or bacterial drain gel used as the label directs, often nightly for a week or more.

  8. 8

    Vacuum the adults and keep watching

    Use the hose attachment to vacuum gnats off windows and walls for quick relief. Keep the traps and cards out for 2 to 3 weeks. If new gnats keep showing up after that, there is a second source you have not found yet.

What kind of gnats do I have?

Most “gnats” in a house are one of three small flies: fungus gnats, fruit flies or drain flies. You can usually tell them apart by color, body shape and where they sit.

ClueFungus gnatFruit flyDrain fly
ColorBlack or dark grayTan front, darker rear, often red eyesGray to black, fuzzy
ShapeSlender with long legs, like a tiny mosquitoStout and roundedBroad hairy wings, looks like a tiny moth
How it fliesWeak, erratic, stays low near plantsHovers around food in small cloudsShort hops of a few feet
Where you see itHouseplants, windows, lamps, screensFruit bowl, trash, recycling, kitchen sinkBathroom walls, tubs, showers, floor drains
Breeds inDamp potting soilFermenting food, spills, sometimes drainsSlime inside drains and overflow pipes
Full guideFungus gnatsFruit fliesDrain flies

The descriptions follow Texas A&M AgriLife Extension’s guide to indoor flies, the University of Kentucky fruit fly fact sheet and Ohio State’s drain fly fact sheet. A fourth, the phorid fly, looks like a fruit fly with a humped back and tends to run across surfaces before it flies.

Why won’t the gnats go away?

Gnats that survive a cleanup almost always have a second breeding site you have not found. The adults you trap are replaced every day by new ones hatching from the source.

  • Fungus gnats can also breed in drains with a buildup of moist debris, not only in soil, according to the University of Maryland Extension.
  • Texas A&M lists refrigerator and air conditioner drip pans, sliding door tracks, cracked tile and the bottoms of garbage cans as common hidden sources.
  • Bagged potting soil stored in a garage or basement can hold larvae and reinfest every plant you repot.
  • A single forgotten onion, potato or wet mop can keep fruit flies going for weeks.
  • Phorid flies that keep coming from a floor or wall can mean a leaking sewer line under the house, which needs a plumber, not a trap.

What are phorid flies, and why do they matter?

Phorid flies, also called humpbacked or scuttle flies, are the small fly most likely to point to a hidden problem. They are about 1/8 inch long, look humpbacked from the side, and breed in decaying organic matter that is often out of sight.

The quickest clue is how they move. Texas A&M AgriLife Extension notes that phorid flies have enlarged hind legs that make them good runners, and that they often run and stop several times before they take off. It puts their life cycle from egg to adult at roughly 14 to 37 days, depending on conditions.

The University of Kentucky’s small flies fact sheet calls phorid flies the hardest of the small flies to manage, because the breeding source has to be found and can be hard to spot. Check these first:

  • Garbage cans, especially liquid pooled in the bottom
  • Standing water under leaking appliances such as refrigerators and washing machines
  • Drain openings in kitchens, bathrooms, laundry rooms and basements

Put sticky cards in several rooms; Kentucky notes that the spot where the most flies are caught helps show where they come from. Light traps, cleaning and insecticides can cut the numbers, but they will not end the problem while the breeding site remains. If you find very large numbers on the ground floor and none of the checks above pan out, the University of Maryland Extension says that can mean a broken drain or sewer line under the building. That calls for a plumber.

Are gnats harmful?

Indoor gnats are mostly a nuisance. The University of Kentucky says the common small flies in homes (fruit flies, fungus gnats, drain flies and phorid flies) do not bite and do not transmit diseases, but they can spread bacteria, especially to food.

  • Throw out any food that flies have been breeding in, and keep fruit and leftovers covered or in the fridge while you clear them out.
  • Wipe counters and cutting boards before you prepare food if flies have been walking on them.
  • Fungus gnats are more of a problem for plants than for people; our fungus gnat guide covers what they do to roots and how to treat the soil.
  • The outdoor eye gnats described below are the exception: they can spread pink eye.

What about gnats outside or flying around your face?

Gnats that swarm your face on a walk or bite on the porch are not the insects in your kitchen, and they do not come from your house. The Clemson University Home & Garden Information Center describes the two most common kinds.

GnatDoes it bite?Where it breedsScreens that keep it out
Biting midge (no-see-um)Yes. Females feed mostly early and late in the day and leave an itchy, raised spot like a mosquito bite.Mud around marshes, ponds and the edges of streamsVery fine mesh, 20 by 20 or smaller
Eye gnatNo. It feeds on moisture around the eyes, nose and ears, and can spread pink eye.Loose, sandy soil that has been disturbed18 by 16 mesh is usually enough

Clemson says controlling these gnats across a whole area is nearly impossible because there are so many of them, and insecticides kill only the adults, which are quickly replaced. What does help is moving air: a ceiling fan on a covered porch or a box fan on a patio knocks these small insects off course. Clemson also notes that repellents with DEET can keep gnats away for a while. Read the repellent label before you use it, especially on children.

Do bug sprays or foggers get rid of gnats?

Not on their own. Sprays and foggers only kill the adults that are flying at that moment, while eggs and larvae in the soil, drain or food keep hatching.

Texas A&M’s entomologists say insecticides alone rarely solve an indoor fly problem, and Ohio State notes that total-release foggers leave no residue and should not be used around food preparation areas. Never pour insecticide down a drain; Ohio State says none are registered for that use. If you decide a spray is worth it, choose one labeled for the place you will use it and follow every direction. The EPA explains that pesticide labels are legally binding.

Are gnat traps and treatments safe around kids and pets?

Most gnat control is low risk, because the main tools are drying, cleaning and trapping. A few items still belong out of reach of small children and pets.

  • Vinegar traps: cider vinegar and a drop of dish soap. Set them on a counter or shelf where a dog or toddler cannot knock them over or drink from them.
  • Sticky cards: they cling to fur, hair and small fingers. Clip them high in the pot or on a window, not on the floor.
  • Bti for fungus gnat larvae: Bti is a strain of the soil bacterium Bacillus thuringiensis. The National Pesticide Information Center’s Bt fact sheet says Bt is low in toxicity to people and other mammals, but that some Bt products have caused eye and skin irritation. Use it only as the label directs and wash your hands afterward.
  • Sprays and foggers: keep people and pets out of the room for as long as the label says, and put away pet bowls, toys and food first.

When should you call a professional?

Call a pest control company or a plumber when you cannot find the source after two careful searches, or the flies come from walls, floors or a basement drain.

A licensed pest professional can identify the species under magnification, and a plumber can camera-inspect a line for a break that is feeding drain or phorid flies. For routine prevention, keeping drains, the trash area and appliance undersides clean, as in our deep cleaning checklist, removes most of the places gnats breed.

Mistakes to avoid

  • Treating every tiny fly the same way, such as setting vinegar traps for fungus gnats that are breeding in a plant pot.
  • Watering houseplants on a schedule in winter, when the soil stays wet for days.
  • Pouring bleach down a drain and expecting it to remove the slime that drain flies breed in.
  • Setting off a fogger in the kitchen, which kills a few adults and leaves residue near food.
  • Covering a drain completely with tape, which blocks airflow so the flies may not come up to be caught.
  • Ignoring small flies that run across counters and walls before flying; phorid flies can mean a leak or broken drain line.

Products that make this easier

Optional. Everything above works with basic supplies; these just save time or effort.

  • Catch and identify

    Yellow sticky traps for houseplants (dual-sided)

    Cards on a stake sit in the pot and catch adult gnats, which also lets you see exactly which fly you have. They catch adults only.

    See it on Amazon
  • For fungus gnat larvae

    Summit Mosquito Bits

    Contains Bti, a soil bacterium that kills fungus gnat larvae when the granules are soaked in your watering water. Check the label for houseplant directions and repeat as it says.

    See it on Amazon
  • For fruit flies

    TERRO Fruit Fly Trap

    A ready-made bait trap for the kitchen. Works on fruit flies, not on fungus gnats or drain flies.

    See it on Amazon
  • For drain flies

    Zep Drain Defense Enzymatic Drain Cleaner

    Enzymes digest the organic film inside pipes that drain flies feed on. It works slowly and needs repeat doses, so use it after scrubbing the drain.

    See it on Amazon

As an Amazon Associate, Broombook earns from qualifying purchases. Links open the product on Amazon, where sizes, sellers and prices change.

FAQ

Frequently asked questions

What causes gnats in the house?

Gnats breed in moist, decaying material: overwatered houseplant soil, fermenting fruit and trash, or the slime inside drains. Find which one you have and the cause follows.

Do gnats bite?

Fungus gnats, fruit flies and drain flies do not bite. Biting gnats such as no-see-ums are outdoor insects that come in through screens.

Why are there gnats in my bathroom?

Gnats in a bathroom are usually drain flies breeding in the sink, tub or shower drain. Tape test each drain and scrub the one that catches flies.

How long do gnats live?

Adult fungus gnats live about a week to 10 days, and drain flies about two weeks. That is why you need to keep trapping for two to three weeks after removing the source.

Does vinegar get rid of gnats?

A vinegar trap catches fruit flies well and some other gnats poorly. It does not reach larvae, so it only helps once the breeding source is gone.

Why are gnats flying around my face outside?

Those are usually eye gnats, which feed on moisture around the eyes, nose and ears. They breed in loose, disturbed soil outdoors, so a fan and a repellent help more than anything inside the house.

Sources

  1. Texas A&M AgriLife Extension: Indoor flies and their control
  2. University of Maryland Extension: Fungus gnats
  3. University of Kentucky Entomology: Fruit Flies (ENTFACT-621)
  4. Ohio State University: Drain flies (moth flies), ENT-41
  5. US EPA: Introduction to pesticide labels
  6. University of Kentucky Entomology: Small flies (ENTFACT-657)
  7. University of Maryland Extension: Phorid fly
  8. Clemson Cooperative Extension HGIC: Gnats
  9. National Pesticide Information Center: Bacillus thuringiensis (Bt) fact sheet

General cleaning information. Always follow the care label and your manufacturer’s instructions, and test any cleaner on a hidden spot first.