Best Spray to Get Rid of Gnats: DIY and Commercial

The fastest way to kill gnats with a spray is a simple mix of rubbing alcohol, water, and dish soap, which kills them on contact within seconds. But spraying adults only solves half the problem. Gnats reproduce quickly, so you also need to target their larvae to stop the cycle. Here’s what works for both.

Why Sprays Alone Won’t Fix a Gnat Problem

Most indoor gnats are fungus gnats, and the adults you see flying around are just the visible fraction of the population. The real engine of the infestation is in the soil of your houseplants, where females lay eggs in moist organic matter. Larvae hatch and feed on fungi and plant roots for about two weeks before emerging as new adults. Killing the ones in the air feels satisfying, but new adults will keep appearing every few days unless you also deal with the larvae living in the top inch or two of soil.

A good approach combines a contact spray for the adults with a soil drench for the larvae. That way you’re hitting both life stages at once.

DIY Contact Sprays That Kill on Contact

The most effective homemade gnat spray uses rubbing alcohol as the active killer. Mix half a cup of water, half a cup of isopropyl alcohol, and a teaspoon of dish soap in a spray bottle. Spray it directly on gnats when you see them. The alcohol dehydrates and kills them almost instantly, and the soap helps the liquid stick to their bodies.

A gentler alternative uses vinegar instead of alcohol: combine a cup of water with a tablespoon of vinegar, a few drops of dish soap, and a pinch of baking soda. This works as a repellent and mild contact killer, though it’s slower than the alcohol version. It’s a better choice if you’re spraying near food prep areas where you’d rather not mist rubbing alcohol.

Both sprays need to hit the gnats directly to work. They have no residual effect, so they won’t kill gnats that land on treated surfaces later.

Commercial Sprays and What’s in Them

Most store-bought gnat sprays use pyrethrins, a natural insecticide derived from chrysanthemum flowers. Pyrethrins are fast-acting, have low toxicity to humans, and break down within a few hours. That short persistence is both a strength and a limitation: it’s safer for indoor use, but you’ll need to spray repeatedly to keep knocking down new adults before they can lay eggs.

Some products use synthetic versions called pyrethroids (look for ingredients like resmethrin or sumithrin on the label). These mimic the chemistry of natural pyrethrins and work similarly, with fast knockdown and short persistence. Either type works well for clearing a room of adult gnats, but neither will reach larvae in the soil.

Killing Larvae in the Soil

This is the step that actually ends an infestation. Mix one part standard 3% hydrogen peroxide with four parts water and pour it directly over the soil of affected plants. The mixture will fizz on contact as it attacks the larvae. It won’t harm your plant’s roots, and the hydrogen peroxide breaks down into water and oxygen after it does its work.

Water your plants with this solution in place of their normal watering for two or three consecutive waterings. That covers the full larval cycle and catches any eggs that hatch after the first treatment. Between waterings, let the top inch of soil dry out completely. Fungus gnat larvae need consistent moisture to survive, and dry topsoil alone can kill off a mild infestation.

Traps to Use Alongside Sprays

While you’re spraying adults and drenching soil, a simple trap can catch the ones you miss. Mix a few tablespoons of apple cider vinegar with a tablespoon of sugar and a few drops of dish soap in a small bowl. The vinegar and sugar attract gnats, and the soap breaks the surface tension so they sink and drown. Place these near your plants or wherever you see the most activity. Yellow sticky traps (available at garden centers) also work well for catching adults near soil level.

Safety Around Pets and Plants

Pets

If you use a pyrethrin or pyrethroid spray indoors, keep pets out of the room until the spray has fully dried. Cats are particularly sensitive to pyrethroid toxicity. Signs of a problem include drooling, tremors, hyperexcitability, and vomiting. Many commercial formulas also contain a booster ingredient called piperonyl butoxide that increases the spray’s effectiveness but also increases its toxicity to mammals. If you have cats, the DIY sprays or hydrogen peroxide soil drenches are a safer route.

Houseplants

Insecticidal soaps and even dish soap sprays can burn the leaves of sensitive plants. Begonias, fuchsias, gardenias, nasturtiums, and lantana are especially prone to damage. If you’re spraying near foliage, test a small area first and wait a day or two to check for yellowing, brown spots, or scorched leaf edges. Never spray plants that are already wilted, as stressed plants are much more likely to suffer leaf burn.

The hydrogen peroxide soil drench avoids this issue entirely since it goes into the soil rather than on the leaves.

Preventing Gnats From Coming Back

Gnats keep returning when conditions invite them. Overwatered houseplants are the single biggest cause of indoor fungus gnats. Let the top layer of soil dry between waterings, and consider adding a half-inch layer of sand or fine gravel on top of the soil surface to discourage egg-laying. Empty drip trays promptly so water doesn’t pool beneath pots.

Fruit flies, which are often confused with fungus gnats, breed in decaying fruit and kitchen drains instead of soil. If your gnats are hovering around the kitchen rather than your plants, store ripe fruit in the fridge and pour boiling water down drains weekly to clear organic buildup. The vinegar trap works on both species.