Does Baking Soda Kill Gnats? What Actually Works

Baking soda has no demonstrated ability to kill gnats. No peer-reviewed study has tested sodium bicarbonate as a gnat insecticide, and the chemistry gives no reason to expect it would work. The idea circulates because baking soda often gets lumped into the same DIY pest-control lists as vinegar and dish soap, but its role in those recipes is essentially decorative. If you have a gnat problem, you need to identify which type of gnat you’re dealing with and then use a method that actually targets it, because the approaches differ considerably depending on the species.

Where the Baking Soda Myth Comes From

Search for gnat remedies online and you’ll find dozens of sites suggesting a mixture of apple cider vinegar, dish soap, and baking soda in a shallow bowl. The vinegar attracts fruit flies with its fermentation odor. The dish soap breaks the surface tension so the flies sink and drown. Those two ingredients have a clear mechanism. Baking soda, though, does nothing useful in that trap. When it reacts with vinegar, it produces carbon dioxide and water while neutralizing some of the acetic acid, which actually makes the vinegar less attractive as bait. At best, the fizzing looks like it’s “doing something.” At worst, it reduces the trap’s effectiveness by dulling the scent that draws flies in.

The confusion also stems from baking soda’s real usefulness in other household contexts. It deodorizes, it scrubs surfaces, and it can help clear slow drains when combined with vinegar and hot water. Because drain flies breed in the organic film lining pipes, people assume that cleaning the drain with baking soda kills the flies. It might help remove the gunk they breed in, but the baking soda itself isn’t insecticidal. You’re cleaning the habitat, not poisoning the insects. That distinction matters because a quick baking-soda flush won’t reach the deeper biofilm where larvae actually live.

Figuring Out Which Gnat You Have

The word “gnat” gets applied to at least three different insects that invade homes, and the right solution depends entirely on which one is buzzing around your kitchen or houseplants. Treating fungus gnats with a fruit fly strategy, or vice versa, wastes time while the population grows.

  • Fruit flies: Small, tan or brownish flies with red eyes, usually hovering near overripe fruit, compost bins, or open bottles. They breed on fermenting organic matter and are the ones genuinely attracted to vinegar traps.
  • Fungus gnats: Darker, more mosquito-like in shape, commonly seen around potted plants. Their larvae live in moist potting soil and feed on fungi and organic debris in the growing medium. Adults are weak fliers that tend to stay near the soil surface.
  • Drain flies: Fuzzy, moth-shaped flies that cling to bathroom walls near sinks or showers. They breed in the slimy organic layer inside drains and sewage pipes.

If your gnats cluster around houseplants, you almost certainly have fungus gnats. If they hover near the fruit bowl or trash can, fruit flies. If they appear in the bathroom and sit motionless on walls, drain flies. Each has a different breeding site, a different food source, and a different vulnerability. A vinegar bowl won’t touch fungus gnat larvae buried in soil, and cleaning drains won’t help when the problem is overwatered houseplants.

Dealing With Fruit Flies

Fruit flies are the easiest of the three to handle because their breeding cycle depends on exposed food. Remove their food source and the population collapses within days. Refrigerate or cover ripe fruit. Empty kitchen compost bins frequently. Wipe down counters where juice or wine has spilled. Rinse recycling containers that held sugary liquids.

While you’re cutting off their food supply, a simple trap helps knock down the adult population. Pour a half-inch of apple cider vinegar into a jar, add two or three drops of dish soap, and leave it uncovered near where you see the most activity. The vinegar’s fermentation scent draws them in, and the soap ensures they can’t land on the surface and fly away. You don’t need baking soda, sugar, or any other additive. Replace the vinegar every couple of days as it loses its scent. Within a week of eliminating food sources and trapping adults, most fruit fly problems resolve on their own.

If the infestation persists, check for a hidden breeding site. A forgotten potato in a back corner of a cabinet, a bag of onions going soft, or even a slow drain with organic buildup can sustain a population indefinitely. Fruit flies can complete a full generation in about a week under warm conditions, so even a small missed food source produces a steady stream of new adults.

Dealing With Fungus Gnats

Fungus gnats are the ones that truly frustrate houseplant owners, because the adults you see flying around are only the visible fraction of the problem. The real damage and reproduction happen underground. Female fungus gnats lay eggs in the top layer of moist soil, and the larvae feed on fungi, decaying organic material, and sometimes living root tissue. Killing the adults without addressing the larvae in the soil is like swatting individual mosquitoes over a stagnant pond.

Drying Out the Soil

The single most effective non-chemical intervention is letting your potting soil dry out between waterings. Fungus gnat larvae need consistently moist conditions to survive. Allowing the top inch or two of soil to dry out thoroughly between waterings kills existing larvae and makes the surface inhospitable for egg-laying. This works for most common houseplants that tolerate brief dry periods. For moisture-loving plants like ferns, bottom watering (placing the pot in a tray of water and letting the soil wick moisture upward) keeps the surface dry while hydrating the root zone.

Adding a top layer of coarse sand, decorative gravel, or perlite about half an inch deep discourages adults from reaching the soil to lay eggs. It also dries faster than organic potting mix, creating a physical barrier that interrupts the life cycle.

Sticky Traps for Adults

Yellow sticky traps placed at soil level catch adult fungus gnats effectively. The flies are attracted to the yellow color and get stuck on contact. These traps won’t solve an infestation by themselves because they don’t touch the larvae, but they reduce the number of adults laying eggs and give you a useful visual indicator of how bad the problem is. If the traps are collecting dozens of gnats a day, you know the larval population in the soil is large and needs direct treatment.

Biological Controls That Target Larvae

For serious infestations, biological controls offer the most reliable results without resorting to synthetic pesticides. Two stand out in the research.

Bacillus thuringiensis subspecies israelensis, commonly sold as Bti, is a naturally occurring soil bacterium that produces proteins toxic to the larvae of flies and mosquitoes. When fungus gnat larvae ingest Bti, the toxin proteins bind to receptors in the larval gut and create pores in the midgut lining, effectively destroying it from the inside. This mechanism is highly specific to certain fly larvae and poses no risk to plants, pets, or humans.

The toxin works through a multi-step process: the bacterium produces crystal proteins that, once ingested, get broken down in the larval gut into active fragments. These fragments bind to gut receptors and assemble into structures that punch holes through the gut wall.

Bti is available as granules or liquid concentrate that you dissolve in water and use to water your plants. It’s sold under several brand names at garden centers and is approved for organic gardening. Repeat applications every week or two are usually needed because Bti breaks down in soil and doesn’t persist long enough to catch newly hatched larvae from eggs laid after treatment.

Entomopathogenic nematodes, specifically species like Steinernema feltiae, are microscopic roundworms that actively hunt insect larvae in soil. Research on the fungus gnat Bradysia odoriphaga found that nematode species including Heterorhabditis bacteriophora, Heterorhabditis indica, and S. feltiae caused significantly higher mortality of fungus gnat larvae compared to untreated controls, with effectiveness increasing over exposure time. The highest kill rates were seen with H. bacteriophora and S. feltiae after 72 to 96 hours of exposure.1PubMed Central. An innovative strategy for control of fungus gnats using entomopathogenic nematodes alone or in combination with waterlogging These nematodes are sold commercially and applied by mixing them into water and drenching the soil. They’re living organisms, so they need to be stored in the refrigerator and used before their expiration date.

Both Bti and beneficial nematodes work best as part of a combined approach: dry out the soil, trap the adults, and treat the soil biologically. Used together, they break the fungus gnat life cycle at multiple points.

Dealing With Drain Flies

Drain flies breed in the gelatinous biofilm that coats the inside of sink and shower drains. The adults are harmless but persistent, and they’ll keep emerging as long as the breeding film remains. Baking soda poured down the drain addresses the symptom (odor) without reliably eliminating the film where larvae develop.

The most effective approach is mechanical: remove the drain cover and scrub the inside of the pipe with a stiff brush designed for drains. Enzyme-based drain cleaners marketed specifically for organic buildup work as a follow-up, digesting the film over repeated applications. Bleach can kill larvae on contact but doesn’t penetrate the film well and doesn’t prevent it from re-forming. Hot water flushes help but usually aren’t sufficient on their own for an established colony.

If drain flies persist after thorough cleaning, the source may be a secondary drain you’ve overlooked, such as an infrequently used floor drain in a basement or laundry room, or a leak behind a wall that creates a moist surface where biofilm can grow. Persistent infestations sometimes warrant a plumber’s inspection to identify hidden moisture problems.

Why Hydrogen Peroxide Gets Recommended

Another common DIY recommendation is a hydrogen peroxide soil drench for fungus gnats: typically a mixture of one part 3% hydrogen peroxide to four parts water, poured through the soil. The peroxide fizzes on contact with organic matter, and the idea is that the oxidizing action kills larvae. Anecdotally, many plant owners report good results, and the peroxide does break down into water and oxygen, so it doesn’t leave residues in the soil. However, there’s limited published research specifically quantifying its effectiveness against fungus gnat larvae compared to controls. It’s worth trying as a first-line measure because it’s cheap and unlikely to harm most plants, but you shouldn’t count on it for a heavy infestation when biological options with stronger evidence are available.

When Essential Oils and Natural Sprays Can Backfire

Essential oils, particularly citrus-based ones, occasionally appear in natural pest control recommendations. Some plant-derived compounds do have insecticidal properties, but using them on or around living plants introduces a real risk of phytotoxicity, meaning the treatment damages the plant you’re trying to protect. Research on citrus essential oil-based formulations has found that while they can kill certain soft-bodied insects, higher concentrations damage the plant’s photosynthetic machinery.2PubMed Central. Aphicidal Activity and Phytotoxicity of Citrus sinensis Essential-Oil-Based Nano-Insecticide The concentrations needed to reliably kill insects often overlap with the concentrations that harm leaf tissue. This is a consistent pattern with botanical insecticides applied directly to plants: the therapeutic window between “kills bugs” and “burns leaves” can be uncomfortably narrow.

Neem oil is a partial exception because it has a longer track record of safe use on houseplants at recommended dilutions, and it works as both a repellent and a growth disruptor for insect larvae. But even neem can damage sensitive plants if applied in direct sunlight or at too high a concentration. If you go the neem route, test it on a single leaf first and apply it in the evening when the plant isn’t in direct light.

The Overwatering Connection

Fungus gnats are, at their core, an overwatering problem. Healthy soil with appropriate moisture levels simply doesn’t support the fungal growth and organic decomposition that gnat larvae need. If you’re fighting fungus gnats repeatedly across multiple plants, the issue probably isn’t that you need a better insecticide. It’s that your watering habits or soil mix is keeping things too wet.

Potting mixes heavy in peat or coconut coir hold moisture for extended periods, creating ideal gnat habitat. Switching to a chunkier mix with more perlite, bark, or pumice improves drainage and lets the soil dry faster between waterings. Ensuring your pots have drainage holes and that saucers aren’t left full of standing water matters more than any spray or drench. Preventive measures are genuinely more effective than reactive treatments here. A household that adjusts its watering and soil composition rarely sees gnats return, while one that keeps reaching for quick fixes tends to cycle through infestations season after season.

What About Commercial Gnat Sprays

Pyrethrin-based sprays, often marketed as “houseplant insect spray,” kill adult fungus gnats and fruit flies on contact. Pyrethrins are derived from chrysanthemum flowers and break down quickly in the environment. They’re useful for immediate knockdown of a swarm of adults but do nothing against larvae in soil or drains. Synthetic pyrethroids (permethrin, bifenthrin) last longer but are more toxic to aquatic organisms and beneficial insects, making them a poor choice for routine indoor use around plants.

For most household gnat situations, commercial chemical sprays are overkill. The combination of source elimination (removing food, drying soil, cleaning drains), trapping (vinegar for fruit flies, yellow sticky cards for fungus gnats), and biological controls (Bti or nematodes for soil larvae) handles the problem without introducing synthetic chemicals into your living space. Save the pyrethrin spray for a bad fruit fly outbreak where you need immediate relief while your traps and sanitation measures catch up.

How Long It Takes to Clear an Infestation

Expectations matter here, because gnat control isn’t instant no matter which method you use. Fruit flies can go from egg to adult in about a week under warm conditions, which means you’ll continue seeing new adults for at least seven to ten days after you’ve removed all food sources. Fungus gnats have a similar timeline, and their pupal stage in the soil adds a few extra days. Even after a successful Bti drench or nematode application, pupae already in the soil will emerge as adults that you’ll see flying around for another week or so. This doesn’t mean the treatment failed. It means you’re seeing the tail end of the previous generation. If your traps show declining numbers over two to three weeks, the approach is working. If numbers stay steady or climb, there’s a breeding source you haven’t found or addressed.

Drain flies can take longer to eliminate because biofilm deep in pipes is hard to fully remove in one pass. Plan on two to three weeks of repeated cleaning and enzyme treatments before declaring victory. If adults are still appearing after a month of consistent effort, the breeding site is probably somewhere other than the drain you’ve been cleaning.