Despite their small size, gnats can become a big annoyance and can easily take over your house or garden — especially if you overwater your plants, forget to clean your drain or let ripened fruit sit on the counter. These tiny, flying insects reproduce quickly, so it's important to take action immediately.

To learn how to get rid of gnats quickly, we tapped experts from the National Pest Management Association (NPMA) and pros from the Good Housekeeping Institute, including Home Improvement and Outdoor Director Dan DiClerico. We also tested simple home remedies, like homemade fly traps made from apple cider vinegar, and reliable pest control products (some of which earned the Good Housekeeping Seal).

What is a Gnat?

Gnats are tiny, winged insects. They're typically found in swarms and are known for their ability to hover in place, whether it's in damp environments, like the kitchen drain, or over freshly watered houseplants. These are the three pesky insects most commonly referred to as gnats:

  • Fungus gnats are black with long legs. They're typically congregate around overwatered houseplants or gardens.
  • Fruit flies are brown with red eyes and usually more round in shape. They're drawn to over-ripe fruit and vegetables.
  • Drain flies are fuzzy with moth-like wings. They prefer moist environments around drains, sewers, gutters and outdoor puddles.

    How to Get Rid of Gnats in Your Home

    Whether it's fruit flies buzzing around your produce or fungus gnats hovering over your houseplants, gnats are unlikely to go away on their own. Luckily, there are simple ways to get rid of gnats quickly:

    1. Use a bug zapper.

    Plug-in traps, like the Zevo Flying Insect Trap, can be extremely effective. Bug zappers typically attract flying insects with a UV light, then trap and collect the small bugs. Most modern zappers are safe for indoor use, so you can plug one in adjacent to your gnat problem.

    2. Make a vinegar trap.

    This is an effective home remedy — and you likely have everything you need on hand. Our Cleaning Lab experts found the best three methods for killing gnats with vinegar:

    how to get rid of gnats
    Danielle Daly
      • Make a trap with apple cider vinegar and plastic wrap: Pour a little apple cider vinegar into a glass or just remove the cap from the bottle. Cover the opening with plastic wrap and secure it with a rubber band. Then, poke a few small holes in the plastic. The fruit flies will enter but will not be able to make their way out.
      • Make a trap with a paper cone, vinegar and old fruit: Place a little vinegar and a chunk of very ripe fruit in a jar. Then, roll printer paper into a cone and stick it into the jar, placing the narrow opening down. The smell of rotting produce will help entice the fruit flies into the mixture, but the paper cone will make it difficult for them to escape.
      • Leave out a bowl of vinegar and dish soap: Add three drops of dish soap to a bowl of vinegar, and leave it uncovered in the problem areas. The soap cuts the surface tension of the vinegar, so the flies that are enticed by the vinegar will sink and drown.

      3. Pour boiling water down the drain.

      Drains are a gnat's safe haven. Even without baking soda, vinegar and drain cleaner, you can pour boiling hot water into the sink to kill their eggs. This will also help get rid of any excess food and bacteria build-up.

      4. Try a spray solution.

      Invest in an insecticidal spray that's safe for indoor use. The Zevo Fly, Gnat & Fruit Fly Flying Insect Spray, a GH Seal holder, uses geraniol and lemongrass oil, which are bio-insecticides that don't need to be registered with the EPA, to kill gnats on contact. Though safe around people and pets, don't allow the spray to come into contact with eyes or skin, and the flammable liquid should never be used near electrical wiring.

      Zevo Fly Gnat & Fruit Fly Insect Spray

      Zevo Fly Gnat & Fruit Fly Insect Spray

      5. Put out a beer or wine trap.

      Along with vinegar, fruit flies like the smell of fruity beer and wine. Leave out an almost-empty open bottle of stale beer or old wine — the skinny neck will keep the flies trapped.

      6. Rely on sticky traps.

      From hanging ribbons and cards to sticky stands specifically designed for potted plants, sticky traps are an easy way to catch a cluster of gnats. Gnats are attracted to bright colors, like yellow. You'll just have to keep an eye on it and replace the trap once it's full.

      closeup of fungus gnats being stuck to yellow sticky tape
      Akchamczuk//Getty Images

      7. Buy a natural trap.

      If you need something that's safe around food, humans and pets, try Aunt Fannie's FlyPunch. The mixture includes sodium lauryl sulfate (a surfactant used in soaps) and malic acid (found in fruit). Just open the top, set it on your counter and watch the cycle of life unfold.

      8. Make a candle trap.

      Position a tall candle into a candlestick, before placing it in a small pan filled with water. Put your pan on the counter, add a bit of dish soap to the water and light the candle before turning the lights off. Since the gnats are attracted to the flame, they'll either hit the flame itself or fall into the water and drown. While the candle is lit, we recommend staying in the room to observe the flame until it's time for it to be blown out.

      How to Get Rid of Gnats Outside

      Many of the above methods — especially vinegar and sticky traps — can deter gnats from buzzing around your garden and other outdoor spaces. But there's more you can do outside to avoid an infestation:

      1. Address moisture issues.

      Gnats breed in stagnant water — think bird baths, water in flower pots and puddles. Fix drainage problems in the backyard, including clearing drains and gutters, and install water features far away from the house.

      2. Replace outdoor lights.

      Your outdoor string lights and pathway lights may look great — but you may be drawing gnats into your entertaining areas. Gnats are attracted to bright white light. Instead, install yellow or amber-colored LED lights that are less appealing to pests.

      gnat around a lamp at night
      tzahiV//Getty Images

      3. Clear trash and debris.

      From decaying leaves and excessive mulch to rotting food, gnats are likely to congregate — and breed — in backyard debris.


      How to Prevent Gnats

      1. Minimize moisture.

      Gnats thrive in moist, humid environments, so a dehumidifier in dank areas of your home can help deter them. "Running a dehumidifier, especially during sultry summer weather, will keep the relative humidity level in your home below 55%, the point at which gnats start to thrive," says Dan DiClerico, the Good Housekeeping Institute's Home Improvement and Outdoor Lab director.

      2. Don't let garbage build up.

      Whether in the trash can or in the form of rotting fruit on the counter, allowing trash to sit in your home will attract gnats. Clean counters and take out the garbage daily.

      3. Don't overwater houseplants.

      "Fungus gnat infestations are often caused by sources of damp soil, such as houseplants, or decaying or damaged plant roots," says Dr. Jim Fredericks, a board-certified entomologist and senior vice president of public affairs at the National Pest Management Association (NPMA). To prevent fungus gnats, regularly repot your houseplants in new soil and ease up on overwatering them.

      4. Keep drains clean.

      Drain flies prefer bacteria, sewage and gunk. This means you'll usually find them in kitchen and bathroom drains, garbage disposals and seldom-used toilets. To prevent drain flies, clear and clean plumbing lines frequently, especially during humid summer weather.

      5. Store fruit properly.

      To prevent fruit flies in your home, rinse and dry produce as soon as you get home from the store, then keep them inside bins or in the fridge as much as possible. Fruits that ripen quickly — apples, grapes, melons, pears, peaches and plums — can be kept in a low-humidity crisper drawer; produce that is prone to wilting, including leafy greens and broccoli, belong in the high-humidity crisper drawer. While bananas are best left on the countertop, you can transfer them to the fridge once ripe, or peel and store them in the freezer.

      Headshot of Alyssa Gautieri
      Alyssa Gautieri
      Associate Lifestyle Editor

      Alyssa Gautieri (she/her) is the associate lifestyle editor for Good Housekeeping, where she covers all things home and interior design. Prior to joining GH in 2022, she wrote for publications including ELLE Decor, Chairish, BobVila.com, Unique Homes Magazine and LODGING Magazine, in addition to crafting product copy for home brands like BrylaneHome and VIGO Industries.

      Headshot of Mariah Thomas
      Mariah Thomas
      Assistant Editor

      Mariah Thomas (she/her) is an assistant editor for Good Housekeeping, where she covers home and lifestyle content. Mariah has more than four years of editorial experience, having written for TLC, Apartment Therapy, Women's Health and Avocado Magazine. She received her master's degree in journalism at the Craig Newmark Graduate School of Journalism and published her first book, Heart and Soul: Poems of Thoughts and Emotions, in 2019. She's also the founder of RTF Community, a platform for creatives of color to connect, learn and showcase their work.