How To Get Rid Of Gnats

This post may contain affiliate links that won’t change your price but will share some commission.

If you’ve found swarms of tiny black insects in your home, these tips on how to get rid of gnats will help. Read on for ways to keep them out of your house, control the infestation, and kill the ones already inside with homemade gnat traps.

Gnat in the house

Gnats in the House – What You Need to Know

When searching for ways to get rid of gnats, people often mean any one of several small, flying insects that are swarming in their homes.

Indoor gnats are usually fungus flies. They enter our homes when we buy houseplants or bring potted plants indoors for the winter. Sometimes, we mistake fruit flies or drain flies for gnats.

Outdoor gnats can get inside, too. These include buffalo gnats, midges, and “no-see-ums.” Outdoor gnats come through holes in window screens, fly through open doors, or hitch rides on humans and pets.

Do They Bite?

Indoor gnats don’t bite, but the female of many outdoor species does feed on blood and can transmit disease. Their bites are painful, too. That’s because they have four “cutters” in their mouths. Unlike mosquitos, they don’t break the skin. They slice it.

Plus, biting gnats inject an anti-clotting agent, so the wound doesn’t heal quickly. You’ll probably notice some swelling and redness in the area along with a small red pinprick, which is the gnat bite.

Their bites are itchy, too. Scratching gnat bites can cause infection. If it still itches after a few hours, try some hydrocortisone cream, or see your doctor.

How to Get Rid of Gnats

Since people so often use the term “gnat” to describe different types of indoor flying insects, getting rid of them depends on where you most often see them.

General Tips

  • Make sure your window screens fit well.
  • Repair torn window screens and screen doors.
  • Midges are attracted to light, so turn off outdoor lights near open windows or close windows near outdoor lights.
  • Keep doors closed, including screen doors.
  • Don’t allow puddles to accumulate in your yard. They’ll breed gnats as well as mosquitoes. (Here are tips on natural mosquito control and a homemade mosquito repellent.)

Near Houseplants

These are probably fungus flies. They breed and hatch in damp soil. To get rid of them, let houseplant soil completely dry between waterings.

Spray a homemade fungus killer. After each watering, mist the top of the dirt lightly with a mixture of 1 cup water, 1 tablespoon baking soda, and 3 drops liquid dish detergent.

Keep plants well-tended. Remove dead leaves and repot plants that have grown too big for their container to promote air circulation that prevents fungal growth.

In the Kitchen

These are most likely fruit flies. They feed and breed on overripe fruit, vegetables, and other foods left on your counter. They’re also attracted by things like cat litter boxes and kitchen trash.

To get rid of them, refrigerate or cover any fruit and vegetables. Empty your kitchen trash daily, and keep the cat’s litterbox scooped. For bad infestations, follow these additional steps to get rid of fruit flies.

Near Drains

Also known as “drain flies,” this kind of gnat lays its eggs in the biofilm and other residue lining sink drains. They are especially attracted to odors. Keep your sink clean and free of dirty dishes, and run your garbage disposal several times a day. Here is how to clean stinky drains.

Near Pet Beds

These are probably outdoor gnats or midges that have made their way into your home. Since they are biting insects, they’ll annoy your pet as much as they do you.

Brush your pet outside after prolonged time in the yard or walks in tall grass, wooded areas, or other places where gnats are likely to swarm.

Also, keep in mind that gnats are attracted to odors, and dirty pet beds smell awful. Wash your pet’s bedding weekly in hot water, adding vinegar to the rinse cycle to kill gnat eggs. Do not use fabric softener, though: it contains protein-based surfactants that attract pests. This homemade flea killer also kills gnat eggs.

Near Your Computer

If you find gnats swarming your computer monitor or phone at night, you need to remember that they’re most active during the day. Electronic screens emit blue light, so they confuse it for daylight.

Keep them from pestering by turning on a bright light on the opposite side of the room. If possible, place a homemade gnat trap (recipe below) beneath the bulb, so it shines directly on the liquid’s surface. The light and the scent will lure the gnats away from your screen.

Gnat Trap Recipes

Keeping gnats out of your home is only the first step to controlling an infestation. You need to kill the ones flying around indoors, too. The easiest way to do this is by using a homemade trap.

Gnat Trap Recipe

Gnat Trap Recipe

Katie Berry
Use this recipe to capture and kill gnats anywhere in your home.
Prep Time 2 mins
Course natural pest control
Servings 1 trap


  • Tall Jar
  • Plastic Wrap or Cling Film
  • Rubber Band
  • Toothpick


  • Apple Cider Vinegar
  • Liquid Dish Soap
  • Piece of fruit (optional) banana works very well


  • Fill the tall jar halfway with apple cider vinegar. The pectin in ACV is a lure. If you cannot stand the smell of vinegar, use red wine instead.
  • Add a couple of drops of liquid dish soap. The soap creates surface tension on the vinegar, which makes it difficult for gnats to escape.
  • Add some fruit. (Optional) You can make it even more attractive to them with a piece banana that's long enough to poke above the surface of the liquid.
  • Make a lid. Put a piece of plastic wrap over the jar and poke a few small holes in it. Fasten it in place with the rubber band. The holes let them into the trap, but they will not be able to find their way out.
  • Keep it fresh. Dump the jar daily, then rinse and refill it. Repeat until you go at least a couple of days without finding more dead gnats in the trap.
Keyword gnats, pests
Tried this recipe?Let us know how it was!

Gnats Near Houseplants

For fungus flies and gnats that swarm near your houseplants:

  1. Make a homemade sticky trap by wrapping a long stick with double-sided tape. (Or use a store-bought version.)
  2. Insert the stick into the plant’s soil where it will catch gnats.
  3. Replace it as needed.

Comment Policy

Comments are moderated. It may take up to 72 hours for moderated comments to appear. I welcome and encourage questions and discussion. However, I will not approve comments that are off-topic, repetitive, or contain hateful or threatening language, advertising or spam. Comments asking for information already covered in the article will not be approved.

Comments may be removed in the future if the information they contain or seek becomes outdated or gets incorporated within the article itself.


  1. Katie Berry says:

    I’m happy to have helped!

  2. Charles W. Harris says:

    Every day I clean up and spray in my bathroom butt theses little black nets just keep coming out of the vent or something it’s CRAZY..

    1. Katie Berry says:

      Hi Charles,
      You might want to take the vent cover off and make sure the duct is clean. You can add window screening behind the vent cover to keep the gnats from coming indoors.

  3. Katie Berry says:

    Hi Sandra,
    How frustrated you must be! I honestly don’t have any more secrets about dealing with fruit flies, but since you’re being so diligent I have to wonder if they’re actually gnats? Have you checked your window screens for holes? Do you have a lot of house plants? I have tips on how to get rid of gnats here and hope they help.

  4. Katie Berry says:

    Hi Linda,
    I’d encourage your husband to leave the light off when he steps out at night, and to close the door, too. They’re coming to your PC because they’re attracted to light, so try the bowl of water trick near a lamp that I mentioned.

  5. 4 stars
    The Gnats are for sure coming out of the house plants. Not sure how to get them all out, they are only in some plants the ones that like moister more tropical ones. Going to try Leca and see if that helps but didn’t know they breed in standing water as well. I heard neem oil works too?

    1. Katie Berry says:

      Neem oil can work but it smells so awful that most people don’t like to use it indoors. If you haven’t smelled it before, it’s a lot like peanut butter mixed with a lot of oily garlic. And it’s a strong odor: just a couple of drops can stink up an entire home.

  6. Louise Everett says:

    We have many gnats especially in our daylight basement. We have thrown out all the houseplants and there is no food source. I cleaned out all the drains and it is below freezing outside. We have no idea where they are coming from and they do not seem to be attracted to a vinegar trap. Any suggestions?

    1. Katie Berry says:

      Damp wood or limited air circulation can also attract fungus gnats. Make sure there aren’t any leaks and that condensation on pipes or around windows and doors isn’t a problem.

  7. Shariyfah says:

    Hi I have tried everything. I removed my plants and put them outside, I have used the vinegar caught some but I am still being bitten on my face. I even had an exterminator visit my home but I just ripped of he was no help at all.
    The bites itch and swell. It has been going on for years believe it or not.
    I do not know what else to do. I never see them flying around.
    Can anyone help?

Leave a Reply
Comments are moderated. Your comment is pending moderator approval.

Your email address will not be published. Required fields are marked *

Recipe Rating