How to get rid of gnats inside your home

Gnats on fruit
Gnats on fruit (Image credit: Shutterstock)

If you spot these tiny bugs, you’ll need to know how to get rid of gnats inside your home. Be it rotting fruit, overwatered plants or you simply forgot to wipe up a sugary spill, these can easily attract a swarm of gnats. 

So what are gnats? Similar to fruit flies, gnats are tiny flying insects that include fungus gnats, fruit flies, and drain flies. Usually, fungus gnats are dark with long legs around 2.5 mm in size; fruit flies tend to be brown, while drain flies have moth-like wings and are usually found anywhere near water.

While these tiny insects are not harmful, they can become a huge nuisance. What’s more, if you don't know how to get rid of gnats, swarms can quickly take over your home, infesting trash cans, plants or decomposing foods. It doesn’t help that gnats breed frequently, so they will always come back if not dealt with immediately. 

Luckily, there are some things you can do to help get rid of gnats quickly to prevent a future infestation. From setting sticky traps to apple cider vinegar solution, here’s how to get rid of gnats inside the home, and banish them once and for all.

If you’re dealing with other pest problems, be sure to check out how to get rid of stink bugs,  how to get rid of mice safely, how to get rid of roaches or how to get rid of ants in your home.  

1. Yellow sticky traps 

Yellow sticky paper for gnats

Yellow sticky paper for gnats (Image credit: Shutterstock)

Place yellow sticky paper traps in areas where you’re most likely to see gnats, such as near ripe fruit, houseplants or trash cans. Simply peel off the protective coating, cut to size and hang. When placing near plants, these should be 2-3 inches above the plant canopy. Once full with gnats, simply throw away and replace. Fungus gnats are attracted to the color yellow, so these make the ideal traps to prevent infestations. We can recommend these Gideal 20-Pack Dual-Sided Yellow Sticky Traps ($7, Amazon), to banish gnats.

2. Plug-in traps 

Zevo flying insect trap plugging into wall

Plug-in traps for gnats (Image credit: Zevo)

Plug-in traps are an effective way of getting rid of gnats. Traps like this Zevo Flying Insect Trap ($19.97, Walmart), use safe amounts of blue and UV light to attract gnats, and mosquitoes to trap them in. Simply dispose of the cartridge once full and replace. The best thing is they contain no chemical insecticides, odor and are more user-friendly.  

3.  Make a homemade solution 

Bowl of solution to trap gnats

Bowl of solution to trap gnats (Image credit: Shutterstock)

Lure gnats in with a sweet substance. Mix a solution of half a cup of warm water, two tablespoons of apple cider vinegar, one tablespoon of sugar, and about six drops of liquid dish soap into a small bowl. Once gnats go in for a drink, the sticky dish soap will trap them. Simply place the bowl in the areas where you've noticed a swarm of gnats. 

4. Rotten fruit traps 

Rotten fruit

Rotten fruit (Image credit: Shutterstock)

Similarly, gnats are attracted to rotting fruit. Place a few pieces of overripe or rotting fruit in a large bowl, cover with plastic wrap and secure with a rubber band. With a toothpick, poke a few holes in the top. The idea is that once gnats and fruit flies make their way in through the tiny holes, they get trapped within the plastic and can’t fly out. 

5. Dilute bleach for drain gnats 

Pouring bleach down the drain

Pouring bleach down the drain (Image credit: Shutterstock)

If you've noticed a swarm of gnats lingering around your sink drains, you may have drain flies. The best method to get rid of drain flies is using bleach. Carefully dilute one-half cup of bleach with about one gallon of water and pour it down the affected drain. Ensure you air out the space, and have sufficient ventilation.  

6. Deter with strong scents 

Citronella oils

Citronella oils (Image credit: Shutterstock)

Typically, gnats hate strong smells like citronella, peppermint, lemon and lavender. Add a few drops of these scents to water or in an oil diffuser to keep gnats at bay. You could also opt for scented candles like these Wild Lavender Candles ($16, Amazon), that will also keep your home fragrant. 

7. Bug zapper 

Bug zapper hanging outside

Bug zapper hanging outside (Image credit: Shutterstock)

While this works better with mosquitos or larger bugs, a bug zapper is a good option. The  UV light attracts gnats before they get electrocuted. Bug zappers like this FVOAI Bug Zapper ($33, Amazon), are safe to use indoors and outdoors. Plus, these should be able to instantly catch a swarm of gnats. 

If you’ve tried these solutions with no luck, you’ll need to call in a professional pest control company to help address your gnat infestation. 

What causes gnats inside the home? 

Gnats on food

Gnats on food (Image credit: Shutterstock)

There are many things inside the home that can attract gnats. These include food sources, spillages, and organic matter such as fruits and vegetables left uncovered. Moist soil in plants make an ideal, warm environment for fungal gnats to congregate. While decomposing organic matter, wastes and sewage from damaged pipes and drains are the perfect breeding ground for gnats. 

Tips to prevent gnats from coming back 

  • Eliminate food sources. Gnats won't come back if they don't have anything to feast on.
  • Wipe and clean up any food or drink spills immediately. Don't allow food or drinks to sit out after meals.
  • Place fruit in the refrigerator instead of leaving them out. Exposed fruit in the bowl can attract gnats.
  • Don’t overwater plants,especially indoor plants.  This leads to damp soil, which is the perfect breeding ground for a gnat infestation. 
  • Use a sealed trash can, and take it out every night to prevent a gnat infestation. 

If you're bedeviled by other pests, we've also get tips on how to get rid of mosquitoes, how to get rid of moths as well as how to get rid of ants and how to get rid of fleas

Cynthia Lawrence
Content Editor, Homes

As the Homes Content Editor, Cynthia Lawrence covers all things homes, interior decorating, and garden-related. She has a wealth of editorial experience testing the latest, ‘must-have’ home appliances, writing buying guides and the handy ‘how to’ features. 


Her work has been published in various titles including, T3, Top Ten Reviews, Ideal Home, Real Homes, Livingetc. and House Beautiful, amongst many.


With a rather unhealthy obsession for all things homes and interiors, she also has an interior design blog for style inspiration and savvy storage solutions (get rid of that clutter!). When she’s not testing cool products, she’ll be searching online for more decor ideas to spruce up her family home or looking for a great bargain!