Bright kitchen windowsill with potted houseplants, a clean sink, and a glass bowl of apple cider vinegar for natural gnat control

How to Get Rid of Gnats: Identify, Remove, and Prevent Them Safely

Tiny black flies hovering around your houseplants or sink are frustrating, especially when a bowl of vinegar barely slows them down. Most quick fixes fail because “gnat” is a catch-all label for three different indoor pests, each breeding in a different place.

To clear an infestation for good, work in order: identify which fly you have, remove its breeding site with kid- and pet-safe methods first, and prevent excess moisture from inviting the next generation back. Most indoor outbreaks clear in two to three weeks once you eliminate the larvae, not just the adults.

Step 1: Identify Which Small Fly You Have

Spend two minutes checking where the flies gather and what they look like. According to the University of Maine Cooperative Extension, fungus gnats, drain gnats (drain flies), and fruit flies have distinct appearances and habitats:

Pest TypeWhat It Looks LikeWhere You See ItPrimary Breeding Site
Fungus GnatsSlender, dark gray/black, long legs and antennae (mosquito-like, 1/16–1/8 in.)Walking on potting soil or lifting from houseplants when wateredTop 1–2 inches of damp potting mix
Drain Gnats (Drain Flies)Fuzzy, dark gray, broad moth-like wings held like a roof (~1/8 in.)Resting on bathroom tiles, shower walls, or sink rimsGelatinous organic slime (biofilm) inside drains
Fruit FliesTan to brown, round body, often red eyes (<1/8 in.)Hovering over bananas, trash bins, or juice spillsOverripe produce and fermenting residue

If your flies are tan, circle ripe produce or trash bins, and ignore your houseplants, you have fruit flies rather than true gnats. Because their cleanup routine is different, follow our dedicated guide on how to get rid of fruit flies instead.

Quick Drain Check (Overnight Tape Test): Not sure if flies around a sink are emerging from the pipe? Texas A&M AgriLife Extension recommends drying the drain rim at night and placing clear tape sticky-side down over part of the opening, leaving a small gap for airflow. Flies stuck underneath by morning confirm that drain is a breeding site.

Step 2: Remove Gnats Safely (Kid- and Pet-Safe Methods First)

Aerosol bug sprays only knock down flying adults briefly while leaving eggs and larvae behind. Start with physical and biological methods that wipe out the breeding site without introducing harsh chemicals around children or pets.

How to Get Rid of Fungus Gnats in Houseplants

Fungus gnat larvae live in wet potting mix and feed on fungi and decaying organic matter, as documented by the UC Statewide IPM Program. Starving the larvae breaks the life cycle.

Healthy potted houseplant with dry top potting soil and a yellow sticky trap stake
Healthy potted houseplant with dry top potting soil and a yellow sticky trap stake.
  1. Let the top 1–2 inches of soil dry out. Pause watering until the top layer feels dry to the touch (without letting the plant wilt). Larvae cannot survive in dry soil, and this change alone resolves mild infestations.
  2. Place yellow sticky stakes in each pot. Push a yellow sticky card into the rim of affected pots to catch egg-laying adults, which rarely fly far from their host plant. Keep stakes out of reach of curious toddlers and pets.
  3. Treat stubborn larvae with Bti (Bacillus thuringiensis israelensis). Steep Bti granules (sold as Mosquito Bits or Mosquito Dunks) in your watering can and water weekly for three weeks. Bti is a naturally occurring soil bacterium that targets only gnat and mosquito larvae; the National Pesticide Information Center notes it has very low toxicity to mammals, does not harm pets, and the U.S. EPA concluded risk is not expected for children or infants.
  4. Monitor larvae with a raw potato slice. Set a thin slice of raw potato cut-side down on the soil for two days, then check underneath for translucent larvae with black heads. Discard infested slices outdoors and repeat until slices stay clear.

How to Get Rid of Drain Gnats (Drain Flies)

Drain flies breed in the slimy organic biofilm lining slow or rarely used pipes. As Utah State University Extension explains, pouring bleach or boiling water alone rarely removes them because the water-resistant film shields larvae along the pipe walls.

Stiff-bristle pipe cleaning brush and kettle beside a clean stainless steel kitchen sink
Stiff-bristle pipe cleaning brush and kettle beside a clean stainless steel kitchen sink.
  1. Scrub the pipe walls mechanically. Remove the stopper or strainer and scour down the drain throat and overflow channel with a stiff-bristle pipe brush to break up the biofilm.
  2. Flush with hot water. Run very hot tap water (or carefully pour hot water down heat-safe pipes) to rinse away loosened sludge.
  3. Apply a bio-enzymatic drain cleaner. Pour a non-toxic enzyme or microbial drain gel into the drain at night when water won’t run for several hours. Beneficial enzymes digest remaining slime without corroding pipes or leaving toxic fumes. Repeat nightly for three to five days.
  4. Skip harsh chemical openers and never mix bleach. Caustic cleaners rarely strip biofilm completely, can damage pipes, and create unnecessary fume hazards. Never mix bleach with ammonia or acidic cleaners.

Catch Stragglers with a Vinegar Trap (Optional)

For lingering kitchen flies, mix half an inch of apple cider vinegar with two to three drops of dish soap in a small bowl. Dish soap breaks surface tension so landing flies sink. Note that vinegar catches stray kitchen and fruit flies well, but it will not fix fungus gnats in soil or drain flies in pipes.

Step 3: Prevent Gnats From Coming Back

Long-term prevention comes down to controlling moisture and removing organic buildup:

  • Bottom-water houseplants: Pour water into the saucer so roots drink from below while the top soil stays dry. Empty saucers after 20 minutes and repot in fresh, well-draining mix.
  • Keep drains active and clean: Flush rarely used guest sinks, floor drains, and laundry tubs weekly, and apply a bio-enzymatic maintainer monthly.
  • Fix leaks quickly: Check under sinks, refrigerator drip pans, and damp bathrooms. If a fixture is wasting water, our guide on how to fix a running toilet covers a simple DIY fix.
  • Manage kitchen scraps: Empty trash often, rinse recycling, and refrigerate ripe produce. If countertop scraps sit out between trash days, a sealed food-waste processor (see Smart Cara Explained) cuts down odor and moisture. These same habits also deter crawling pests—see our guide on how to get rid of ants in your house if you spot trails near the sink.

If gnats persist past three weeks despite dry soil and scrubbed drains, check for a hidden moisture source such as a cracked pipe, damp crawlspace, or wet mop stored in a closet.

Quick FAQ

How long does it take to get rid of gnats?
Most indoor outbreaks clear in two to three weeks once you eliminate the larvae, not just the adults. If gnats persist past three weeks despite dry soil and scrubbed drains, check for a hidden moisture source such as a cracked pipe, damp crawlspace, or wet mop stored in a closet.

Are vinegar traps enough to get rid of fungus gnats?
No. A vinegar trap catches stray kitchen and fruit flies, but it will not fix fungus gnats in soil or drain flies in pipes. For fungus gnats, let the top 1–2 inches of soil dry out, use yellow sticky stakes to catch adults, and treat larvae with Bti for three weeks.

Is Bti safe to use around kids and pets?
Yes. Bti is a naturally occurring soil bacterium that targets only gnat and mosquito larvae. The National Pesticide Information Center notes it has very low toxicity to mammals, does not harm pets, and the U.S. EPA concluded risk is not expected for children or infants.

Similar Posts