How to Get Rid of Gnats Inside and Outside Your Home

by Stacey

By Stacey Kelleher

Regardless of how clean, organized, and tidy your home and yard may be, you may still encounter areas that are infested by pesky gnats. Gnats are so common because they are drawn to substances we all have in our homes: moisture and organic materials like food and soil. And while gnats are not necessarily dangerous, they certainly are a nuisance.

Keep reading to learn more about gnats, why they invade our homes, and some natural and effective ways to get rid of gnats indoors and outside.

how to get rid of gnats

Photo via Shutterstock

How to Identify Gnats 

Identifying gnats is the first step to keeping them out of your home. Gnats ( fungus gnats in particular) are part of the fly family (Diptera). They have small, grayish-black bodies and long legs. Gnats tend to accumulate in large groups and are actually surprisingly clumsy and slow fliers.

You’ll know you have a gnat infestation by spotting these pesky bugs, or if your plants suddenly start wilting or experience stunted growth.

Because gnats have a short life span (around 3-4 weeks) you might think you have gotten rid of them, only for a brand new group of gnats to be born. Until you stop that cycle, you will continue to have new gnats every few weeks—indefinitely. 

Are Gnats Dangerous?

Adult gnats do not bite or pose a risk to humans. However, their larvae feed on organic matter like soil and plant roots. This can stunt plant growth and damage any cuttings and seedlings with fragile roots. 

Gnats are also able to transmit diseases and fungi from plant to plant. So if you’re a devoted “plant parent” you definitely want to get rid of any gnats in your home. This can also be a real problem for places that harvest seedlings and young plants with vulnerable root systems—like greenhouses, nurseries, and sod farms.

Are Gnats the Same as Fruit Flies? 

While gnats and fruit flies are often confused, they are actually completely different insects. They hail from different biological families, are drawn to different materials, and look slightly different too. 

Fruit flies are brownish in color, and a bit larger than gnats. Compared to gnats, they have a rounder body and bigger wings. Fruit flies are more common during the end of summer into fall because they are attracted to sugars in maturing and rotting fruits that fall from trees at summer’s end.

Beyond fruits, fruit flies like to hang out in moist areas coated with any type of fermenting material including mops, dishrags, trashcans, sink drains, and sponges. Fruit flies are a bit more concerning than gnats because they lay their eggs on the upper surface of foods and other damp, organic materials and can potentially contaminate food with bacteria and other organisms.

If you spot little pests swarming around your garbage disposal or fruit bin, they are most likely fruit flies. Although gnats and fruit flies may appear similar at first glance, each requires different methods to remove them.

what attracts gnats to your home

Photo via Stacy Ling | Bricks 'n Blooms

What Attracts Gnats to Your Home 

Fungus gnats tend to stick around indoor plants and outside around damp, decaying vegetation. As mentioned above, the biggest problem with gnats (besides the annoying factor) is their larvae that feed off plant roots when they run out of other food sources. 

A gnats’ life cycle consists of four stages: egg, larvae, pupa, and adult. Female adult gnats lay anywhere from 30 to 200 eggs in organic debris outside or potting soil inside, preferably wherever fungus is growing. She can produce multiple groups of eggs throughout the year. 

How to Get Rid of Gnats with Sticky Traps 

Now that we’ve become acquainted with the fungus gnat and understand why they’re hanging around the home, let’s explore ways to get rid of them. To ensure the safety of the people and pets in your home, we’ve opted for natural, toxin-free ingredients to banish fungus gnats in and around your houseplants.

Because fungus gnats gravitate toward bright colors, yellow sticky traps are one easy, cost-effective way to catch them. Just keep in mind, because adults are the only fliers, you may have to combine this option with another method to tackle the larvae growing beneath the soil of your plants.


Position sticky traps anywhere you notice fungus gnat swarms, most likely close to potted plants. Hanging traps are effective in areas with multiple plants together, but they can be unsightly. You can try smaller sticky traps on stakes that are ideal for potted plants and are a bit less obvious.

This method is super easy because all you have to do is wait and give the traps time to do their job. Keep in mind that even if you catch most of the adult gnats, if they have laid eggs, you’ll have to wait for those to grow and fly. 

Wait several weeks before removing the sticky traps to be sure all of the adults are gone and have stopped producing eggs. Once the trap is full of gnats, you can wrap it in newspaper and dispose of it in the garbage.

How to Get Rid of Gnats with Hydrogen Peroxide 

Next, you can try something you probably already have in your pantry: hydrogen peroxide. This is a great option because it tackles every stage of the fungus gnat life cycle, killing them on contact. 

Tools and Materials Needed

  • 3-percent hydrogen peroxide 
  • Water 
  • Spray bottle 

Step 1: Make a Hydrogen Peroxide Solution 

Add one part hydrogen peroxide (as opposed to the industrial-strength version) and four parts water to your spray bottle. Swirl bottle to combine.

Step 2: Spray Your Plants 

Prior to spraying your plants, allow the soil to dry slightly. Spray the top layer of the soil with the hydrogen peroxide solution, allowing it to reach down a few inches. For larger infestations, you can actually water the entire plant with the solution, without harming them.

Step 3: Repeat the Process 

Treat your plants with hydrogen peroxide solution once a week until all of the fungus gnats are gone. 

How to Get Rid of Gnats with Microbial Insecticide 

Insecticides are any substances used to kill insects. They can contain a wide range of chemicals and ingredients, and many are toxic to humans, animals, and the planet. Fortunately, there is a natural and highly effective insecticide available to get rid of gnats in plants.

Bacillus thuringiensis israelensis (Bti) is a naturally occurring bacteria that is lethal for both mosquito larvae and fungus gnat larvae, but harmless to all other living things. 

Depending on which Bti product you choose, the precise application process may vary. Generally, you would mix the product with water according to the product instructions in a container or watering can. Use that solution to water your plants, soaking the top few inches of the soil. 

Like the hydrogen peroxide method, you need to repeat the process several times to capture the adult fungus gnats, destroy the larvae, and end the reproduction cycle. You can treat your plants according to your regular watering schedule. 

how to get rid of gnats outside

How to Get Rid of Gnats with a Bug Zapper 

It can be quite frustrating to sit down to enjoy your patio, garden, or deck on a beautiful day only to be swarmed by gnats. You’ll probably find them hovering around any moist, decaying organic matter, including piles of dead leaves, rotting firewood, compost bins, and grass, soil, or mulch that is saturated with water. 

Getting rid of gnats outside requires a bit more time, manpower, and supplies compared to indoor infestations—but the results are well worth it. 

Bug zappers are an easy way to kill gnats on the spot. There are electric models, solar-powered zappers, and even zappers that look like racquets so you can swat away gnats. 

Although bug zappers are eco-friendly (and it’s admittedly satisfying to see those insects sizzle), they are, again, only effective for killing adult gnats. If you go this route, you will still need to treat gnat larvae.

Set up your device according to the product instructions and place it near the area of gnat activity, taking precautions to keep the zapper out of reach of children and pets. Most zappers need to be cleaned routinely to remove insects and prevent clogs.

How to Get Rid of Gnats with Neem Oil

Neem oil is a bitter, yellowish oil derived from the seeds of the neem tree. It is an effective pesticide, disrupting the ability of various insects to reproduce and lay eggs. Neem oil and its most active component, azadirachtin, are used in a wide range of commercial pesticide products. Luckily, you can make your own DIY neem oil solution at home. 

Tools and Materials Needed

  • Rubber gloves
  • Bucket 
  • Water
  • Pure 100-percent neem oil 
  • Mixing tool
  • Liquid castile soap 
  • Watering can or lawn sprayer

Step 1: Prep the Area 

Before applying the neem oil solution, it is important to move any dead or decaying debris, leaves, and wood that may be harboring gnat larvae to an inconspicuous area of your yard or completely remove it by following your city or town’s yard waste collection process. We also recommend wearing rubber or plastic gloves when working with neem oil, as it can be irritating to the skin. 

Step 2: Mix the Solution 

Fill a bucket with one gallon of water. Add two tablespoons of castile soap and four tablespoons of neem oil. Mix well until the ingredients have combined. 


Step 3: Apply

Once the solution is fully mixed, you can apply the solution to the affected area using a watering can for potted plants or small spaces, or a lawn sprayer for mulch and other large areas. Use as much solution as needed to fully saturate the area.

Step 4: Wait 

Like all of the other methods, now it is time to wait and let the neem solution do its thing. Retreat areas weekly until all of the gnats are gone. 

Tips to Prevent Gnats Inside and Outside Your Home 

The key to keeping fungus gnats out of your home and yard is to remove any materials that make a good spot for their eggs. Without damp, fermenting soil and other matter, larvae cannot survive and continue the cycle to reach adulthood. 

Here are a few practical ways to repel fungus gnats in and around your home: 

Don’t Give Them a Good Home 

When it comes to houseplants and repelling fungus gnats, the easiest thing you can do is resist overwatering and allow your soil to dry out fully between waterings. 

If possible, water your plants from the bottom to help keep that outer layer of soil dry and inhospitable to female gnats. If your plant’s container has drainage holes, set it in a sink, bathtub, or large container that is filled with a few inches of water. After 20 minutes, your plant will have absorbed the appropriate amount of water through its drainage holes.

Self-watering bulbs and stakes are another option to ensure you’re watering below the top layer of soil. And they’re available in lots of unique colors, shapes, and materials, so they won’t detract from your decor. 

Add a Layer of Dirt or Gravel 

Remember that fungus gnats only lay their eggs on the very top layer of dirt and soil. If you replace that top layer with horticulture sand or gravel, you're removing that nutrient-dense fungus that larvae feed on. 

Keep Potting Soil in An Airtight Container 

Be smart about how and where you store unused potting soil. It is not the plants that gnats are after, so much as the soil that houses them. Gnat eggs cannot survive without air, so if you keep soil in a sealed bin, existing eggs will die and new gnats cannot enter. 

Replace Lights With Anti-Bug Bulbs 

Deter gnats from your yard before they even have a chance to find a spot to lay eggs. Most insects are attracted to bright lights, so consider switching out your exterior lights with yellow bug lights specifically designed to discourage pests. 

Avoid Overwatering Lawns and Gardens

This tip echos our tip for your indoor greenery. Resist overwatering your lawn, and give your grass and garden time to dry out between waterings to prevent gnats from setting up shop. 

Landscape With Inorganic Materials 

Consider landscaping with rocks, gravel, rubber mulch, and other hard materials that do not require water and won’t attract gnats and other insects. These materials are easier to clean, require less maintenance, and save water, too! 


Common fungus gnats are not as menacing as some other insects, but they are undoubtedly among the most annoying. Fortunately, there are several easy, inexpensive, and effective methods to get rid of gnats in your home and outside in the yard. With a few simple supplies and some time and patience, you can finally be gnat-free for good. Have you had success in getting rid of gnats? We’d love to hear your tips—share them below!

Frequently asked questions
Have a question about this project?
  1 question
  • Maisha Maisha on Dec 15, 2021

    How about gnats that seem to come from the drains? Or gnats that appear seemingly from nowhere, when one does not own any house plants.

Join the conversation