How to Get Rid of Gnats: 7 Ways to Clear Them for Good

Most indoor gnats are fungus gnats from wet potting soil. Let soil dry, use yellow sticky traps and treat soil with BTI to break their life cycle.

Updated September 27, 20264 min readEdited by Flavio Barros

How to get rid of gnats: first figure out which kind you have. Most tiny black flies indoors are fungus gnats breeding in damp potting soil, so the fix is to let the soil dry out, catch adults on yellow sticky traps and treat the soil with a BTI larvicide. If the flies hover over fruit or the trash instead, you’re dealing with fruit flies, which need a different approach.

“Gnat” is a loose word for several small flies. Treating the wrong one is the main reason gnats keep coming back, so the first step below is identification. After that, the steps focus on fungus gnats, the most common indoor type.

1. Identify the gnats: fungus gnats vs. fruit flies

Fungus gnats are dark gray or black, slender, with long legs and long antennae, a bit like tiny mosquitoes. They’re weak fliers that stay close to houseplants, windows and soil, and they often run across the soil surface.

Fruit flies are tan with red eyes and a rounder body. They gather around ripe produce, the trash and the sink. Drain flies, a third type, look fuzzy and moth-like and rest on bathroom walls near drains. Once you know which one you have, figuring out how to get rid of gnats becomes much simpler.

TypeLooks likeFound nearBreeds in
Fungus gnatBlack, slender, long legsHouseplants, windowsMoist potting soil
Fruit flyTan body, red eyesFruit bowl, trash, sinkFermenting food
Drain flyFuzzy, moth-like wingsBathroom and kitchen drainsSlime inside drains

2. How to get rid of gnats by letting the soil dry out

Overwatering is the root cause of most fungus gnat problems. Their larvae live in the top inch or two of moist soil and feed on fungi and decaying organic matter, and sometimes on tender roots.

Let the top 1 to 2 inches of soil dry completely between waterings. Empty saucers under pots so water doesn’t sit there. Bottom watering, where the pot soaks from a tray for a short time, keeps the surface drier. If you only change one thing, drying the soil is the most effective answer to how to get rid of gnats in houseplants.

3. How to get rid of gnats with yellow sticky traps

Yellow sticky traps are cheap and very effective for adults. Cut them into strips and push them into the soil near the base of each plant, or lay them flat on the soil surface.

The traps also show you how bad the problem is. Check them every few days: fewer new gnats each week means the plan is working. They won’t stop the larvae, though, so combine them with the next step.

4. Treat the soil with BTI

BTI (Bacillus thuringiensis subspecies israelensis) is a naturally occurring bacterium that kills fly larvae in soil and water. It’s sold at garden centers as granules or “dunks” intended for mosquito control, and it’s widely used against fungus gnat larvae.

Soak a dunk or some granules in your watering can following the label directions, then water the plants with it. Repeat for a few weeks, since BTI only affects the larval stage and new eggs keep hatching.

5. Try a hydrogen peroxide soil drench

A common home method is watering with a diluted mix of household 3% hydrogen peroxide, often 1 part peroxide to 4 parts water. It kills larvae on contact and breaks down into water and oxygen.

Test it on one plant first, since sensitive plants and seedlings can be damaged. It works best when the soil is already a bit dry, so the solution reaches the top layer where larvae live.

6. Repot or top-dress heavily infested plants

When a pot has been soggy for months, it can be faster to start over. Repot in fresh, bagged potting mix, and store opened bags sealed, since damp mix can carry eggs.

A half-inch layer of coarse sand or fine gravel on top of the soil also helps. It dries quickly, so females have a harder time laying eggs.

7. How to get rid of gnats in drains and the kitchen

If the gnats cluster near a sink or shower rather than plants, you likely have drain flies or fruit flies. Scrub the drain with a stiff brush, then use an enzyme-based drain cleaner to dissolve the slime they breed in.

For fruit flies, remove ripe produce, rinse recycling and set a small dish of apple cider vinegar with a drop of dish soap. If gnats persist for weeks with no clear source, a licensed pest control company can look for hidden moisture, such as a leak under a floor or behind a wall.

FAQ

Does Dawn and vinegar get rid of gnats?

A dish of vinegar with a drop of dish soap works well on fruit flies and catches some fungus gnats. It won’t reach larvae in potting soil, so for fungus gnats it should be combined with drier soil, sticky traps and BTI.

What causes tiny gnats in your house?

Moisture and organic matter. Overwatered houseplants are the top cause, followed by ripe food, dirty drains and damp spots from leaks. Fixing the moisture problem is the core of how to get rid of gnats long term.

What gets rid of gnats immediately?

Sticky traps and a vacuum remove adults quickly. Clearing the whole infestation takes two to four weeks, because you have to wait out eggs and larvae already in the soil.

Do dryer sheets keep gnats away?

There’s little reliable evidence that dryer sheets repel gnats. Drying the soil and removing breeding sources works far better.

Bottom line

The key to getting rid of gnats is matching the treatment to the insect. For fungus gnats, stop overwatering, trap the adults and treat the soil with BTI for a few weeks. For fruit flies or drain flies, clean the food source or drain. Stay consistent for about a month and the population should collapse.