Sometimes when I’m gardening, dozens of minuscule flying creatures descend upon my legs. It’s fortunate these little black specks don’t bite, but they are so vastly annoying that I have to either go inside or put on long pants. For others, gnats are more of a problem inside.

“We deal with them a lot in our eviction and hoarding cleanups,” says pest control expert Nikki Torgerson. “They are pretty much always an issue because of how many things have been left out in an apartment or rental unit.”

If you have gnats in your home, inside or outside, here’s how to get rid of them and keep them at bay.

What Are Gnats?

Gnats are not a specific insect species, but rather a general name for tiny flying bugs that tend to swarm in clouds, especially in places where the soil is damp or something is rotting.

“Identifying the type of gnat is the first step in eliminating the problem,” says pest control expert Tony King. “For example, fungus gnats infest and reproduce in moist soil, particularly around houseplants. Fruit flies are attracted to ripe or rotting fruits and vegetables, while drain flies live in the muck inside of sink and shower drains.”

Do gnats bite?

It depends on what species of insect you’re dealing with, but generally, the term “gnats” describes non-biting flying insects. However, midges (aka no-see-ums) are often mistaken for gnats, and they do bite.

“Gnats swarm together to mate, but do not target people or bite them,” says entomologist Emma Grace Crumbley. “Instead, the primary concern with gnats is their large numbers and the annoyance they cause.”

Are gnats dangerous?

Not generally, except that they can contaminate food surfaces by leaving bacteria on them, especially when they have been traversing over spoiled fruit or garbage disposals, says King. Fungus gnat larvae can also kill houseplants by damaging their roots.

What Do Gnats Look Like?

Gnats are tiny flies with slender bodies and long, feathery wings (though you usually can’t see those well without magnification). They can be black, brown, gray or yellow. “If it’s flying, smaller than a mosquito and around something damp or rotting, it’s probably a gnat,” says pest control expert Nicole Carpenter. “They rarely show up alone and usually look like a cloud of tiny flying bugs.”

What Good Are Gnats?

“Despite being annoying if they’re in your kitchen, they’re doing a big job in nature,” says Carpenter.

Gnats serve as food for many other creatures, and their larvae break down dead and decaying organic material, returning nutrients to the soil. Some species are also minor pollinators.

“While their impact is not as significant as that of bees or butterflies, when they feed on plant nectar, they do transfer pollen in the process,” says Crumbley.

What Attracts Gnats?

Gnats love to feed, breed and hang out in cool, sludgy, moist environments like overwatered soil, animal waste, aging fruit, compost bins and clogged drains and gutters.

How To Get Rid of Gnats

Getting rid of gnats usually isn’t terribly difficult. “Gnats are a source problem,” says pest control technician Matt Smith. “If you get rid of the source they are drawn to, they will go away as well.” Some examples include:

Do Not Overwater Houseplants

Fungus gnats thrive in overwatered houseplants. To rid them from the soil, allow the first few inches to dry out, which will kill off the larvae. “In severe situations, it’s best to repot the plant in fresh, sterile potting soil,” says King. “You can also water the plant with a solution of one part 3% hydrogen peroxide to four parts water, which will kill larvae, but is harmless to most plants.”

Check for Flooding

Assess your yard for areas that collect water. “If you can’t control dampness, like wet garden soil from heavy rain, try covering it with sand or gravel, using cedar mulch or planting natural repellents like basil or lavender,” says Carpenter.

Remove Leaf Litter

During the hottest parts of the day, gnats tend to hide out in shady patches, overgrown grass, leaf piles and woodpiles, so tidying up these areas can help a lot. But, it’s also good to keep some “mess” around for pollinators, birds and other wildlife that rely on them.

“If you like the look of leaf piles or want to keep a woodpile to promote biodiversity in your yard, keep it far away from the home to prevent gnats from flying inside,” says Crumbley.

Pick Up After Pets and Plants

Animal droppings from wildlife or pets will attract gnats to your yard, so pick up waste regularly. Also, get rid of dropped fruits from trees and bushes, which will attract gnats plus other pests.

Find Where They’re Breeding

Clean your kitchen and bathroom, paying special attention to the drains. Rinse recyclables, clean and dry garbage bins, take out the garbage before it starts to stink, check for plumbing leaks and remove overripe fruit from the counter.

Once you throw it away, clean the area with a household cleaner, says Smith. “If they are in your sink, chances are that you have something in your pipes, so use a cleaner, then try not to use that sink for a couple of days and let it really dry out,” he says.

Move Trash Cans

Keep waste and recycling bins stored away from the home, especially windows and doors. Clean them out occasionally if you notice flies gathering near them.

DIY a Gnat Trap

A popular DIY solution is to trap gnats in a small jar using apple cider vinegar and a few drops of dish soap. The vinegar’s fruity smell attracts them, then the dish soap breaks the surface tension so they can’t fly away after landing.

“I would place these traps near the areas where the gnats are most active, like on kitchen countertops, trash cans or near houseplants,” says King.

This is a good solution for getting rid of adult gnats once you’ve cut off their food source and breeding grounds, but otherwise it will only work temporarily, since it doesn’t address eggs and larvae.

Also, here’s a solution for drain gnats.

How To Prevent Gnats

To keep gnats from getting a wing-hold around your home, remove all potential food and breeding sites, such as:

  • Not overwatering house and yard plants.
  • Cleaning up spills and rotting fruit promptly, especially sugary ones.
  • Taking out the trash daily, especially in the spring and summer.
  • Storing fruit in the fridge.
  • Cleaning pet bowls.
  • Washing dishes and wiping counters regularly.
  • Fixing plumbing leaks.
  • Cleaning drains and the garbage disposal.
  • Rinsing recycling items before putting them in the bin, plus keeping trash bins clean and dry.
  • Keeping indoor humidity below 60%.
  • Mending all window and door screens.

About the Experts

  • Emma Grace Crumbley is an entomologist at Mosquito Squad Plus and a self-described bug nerd who uses her expertise to educate people about the fascinating world of bugs.
  • Nicole Carpenter is president of Black Pest Prevention in North Carolina, where she’s worked for 13 years.
  • Tony King is a pest control expert and founder of The Pied Piper Pest Control Company, which has been serving in London, England, for more than 25 years.
  • Matt Smith is co-owner of Green Pest Management in New Castle, Delaware, and a licensed pest control technician. He has been working in the pest control industry for since 2009.
  • Nikki Torgerson is owner at Advanced Bed Bug Preparation, a pest control and eviction cleaning company in northeast Wisconsin.