The fastest way to get rid of gnats naturally is to eliminate their breeding source, then trap the adults still flying around. A simple bowl of apple cider vinegar and dish soap can catch dozens of adult gnats overnight, but lasting results come from cutting off the moisture or organic matter where they lay eggs. The exact approach depends on which type of gnat you’re dealing with, since the tiny flies hovering around your kitchen, your houseplants, or your drains are actually three different insects with different habits.
Identify Which Gnat You Have
Before you start setting traps, take a moment to notice where the bugs are congregating. This tells you almost everything you need to know.
Fruit flies hang around your fruit bowl, trash can, recycling bin, or kitchen sink. They look like tiny house flies (about ⅛ inch long) with red or black eyes and striped abdomens. They’re attracted to ripening fruit, sugary liquids, and alcohol.
Fungus gnats hover around your houseplants and rarely stray far from the soil. They look more like miniature mosquitoes, with dark brown or black bodies and long legs. Their larvae live in moist potting soil and can damage plant roots.
Drain flies are fuzzy, moth-like insects that clumsily fly out of sink or shower drains and land on nearby walls and ceilings. They’re light gray or tan, about ⅛ inch long, and breed in the slimy buildup inside your plumbing.
You might have more than one type. If so, you’ll want to use the targeted strategies below for each.
The Apple Cider Vinegar Trap
This is the go-to method for fruit flies and works well as a supplemental trap for any flying gnats. Mix three parts apple cider vinegar with one part water in a shallow bowl or jar. Add three to four drops of dish soap. The fermented smell of the vinegar draws gnats in, and the dish soap breaks the surface tension of the liquid so they can’t land and fly away. Instead, they sink and drown.
Place traps near the problem areas: next to your fruit bowl, beside the trash can, or on the counter near the sink. Replace the mixture every two to three days, or whenever it’s full of dead gnats. You can set out multiple traps in a heavy infestation. Some people cover the bowl with plastic wrap and poke small holes in it, which lets gnats enter but makes it harder for them to escape.
These traps catch adults but won’t stop new ones from hatching. That’s why source elimination matters more than trapping.
Getting Rid of Fruit Flies at the Source
Fruit flies lay eggs on overripe fruit and inside drains where old food collects. Your first step is removing every potential food source. Store ripe fruit in the refrigerator. Empty trash cans and recycling bins frequently, especially if they contain bottles or cans with sugary residue. Clean up any spilled juice, wine, or soda immediately.
Wipe down counters and scrub your sink drain with a brush to remove organic buildup. If you compost indoors, make sure your bin has a tight-fitting lid. Without a food source, the adult population drops quickly since fruit flies only live about two weeks.
Eliminating Fungus Gnats From Houseplants
Fungus gnats are the most stubborn of the three because their larvae live protected inside your potting soil. Getting rid of them requires breaking their life cycle at the soil level, and it typically takes three to four weeks of consistent effort.
Let the Soil Dry Out
The single most effective step is changing how you water. According to the University of Wisconsin Extension, allowing the top inch of soil to dry out between waterings eliminates the moist conditions fungus gnats need to lay eggs. Most houseplants tolerate this easily. Overwatering is the number one reason fungus gnats thrive indoors.
Add a Sand or Gravel Barrier
Cover the top of your potting soil with at least half an inch of coarse sand. Sand dries out quickly, which deters egg-laying. It also acts as a physical barrier: adult gnats can’t burrow through it to reach the soil, and larvae that hatch beneath it can’t push through the gritty layer to emerge as adults. This effectively breaks the entire life cycle. Make sure to cover the drainage holes at the bottom of the pot as well, since gnats can enter from below.
Hydrogen Peroxide Soil Drench
To kill larvae already living in the soil, mix one part standard 3% hydrogen peroxide with four parts water and pour it directly over the soil as you would normally water. The mixture will fizz as it contacts and kills larvae. It won’t harm your plant’s roots. You can repeat this with each watering cycle until you stop seeing adults.
Diatomaceous Earth
Food-grade diatomaceous earth is a powder made from crushed fossilized algae. Sprinkled liberally on dry soil, it works like microscopic shards of glass to larvae trying to move through it. The key is keeping it dry, because it loses effectiveness when wet. Apply it to the soil surface between waterings, focusing on areas where you see the most gnat activity. Reapply after each watering once the top layer dries again.
Neem Oil Spray
Neem oil disrupts the feeding and reproduction of many soft-bodied insects. Mix one to two tablespoons of cold-pressed neem oil with one teaspoon of mild liquid soap (like castile soap) in one quart of water. Shake well and spray the soil surface and the base of the plant. You can also water it into the soil as a drench. Keep the plant out of direct light until the spray dries to avoid leaf burn. It’s smart to test on a single leaf first and wait 24 hours before treating the whole plant.
Clearing Drain Flies Naturally
Drain flies breed in the slimy organic buildup inside your pipes. You won’t solve the problem by killing the adults you see on the wall. You have to clean the drain itself.
Start by sprinkling half a cup of baking soda into and around the drain opening, then pour in one cup of white vinegar. It will bubble aggressively. Let it sit for about 10 minutes, then flush everything down with very hot water. Use the hottest water you can get from your tap or heat it on the stove just below boiling (actual boiling water can damage certain pipe materials). Repeat this for every drain in your house, including showers and floor drains, since drain flies aren’t picky about which drain they colonize.
For stubborn infestations, use a stiff pipe brush to physically scrub the inside walls of the drain before applying the baking soda and vinegar. The organic sludge coating the pipe walls is where eggs and larvae live, and no amount of liquid flushing removes it as effectively as mechanical scrubbing. Repeat the cleaning every few days for a week or two until you stop seeing new adults.
Preventing Gnats From Coming Back
Once you’ve cleared an infestation, a few habits keep gnats from returning. Store ripe produce in the fridge or in sealed containers. Take out kitchen trash before it sits overnight. Run your garbage disposal regularly and rinse it with hot water afterward. Clean up pet food bowls rather than leaving wet food out.
For houseplants, bottom watering (setting the pot in a tray of water and letting the soil absorb moisture from below) keeps the top layer of soil dry, which is exactly the condition fungus gnats avoid. Maintaining a sand or gravel top layer as a permanent feature of your pots provides ongoing physical protection. When bringing new plants home from a nursery, inspect the soil and consider repotting with fresh, sterile potting mix, since fungus gnat larvae often hitchhike in from garden centers.
For drains, a monthly baking soda and vinegar flush prevents organic buildup from reaching the level that attracts drain flies. Covering drains with stoppers or mesh screens at night also blocks adults from entering or exiting.