White bowl filled with pink liquid and dead fruit flies and gnats
Sean Cate
Sean Cate
April 8, 2024 ·  3 min read

How to get rid of fruit flies and gnats

Fruit flies are small, flying insects that are often found in the kitchen. They are attracted to the sweet smell of ripening or decaying fruits and vegetables, as well as moist and dirty areas. They can be a nuisance and can contaminate food, making them a health hazard. While they may seem harmless, they can quickly multiply and become a full-blown infestation. Therefore, it’s important to take action as soon as you notice their presence. Here are 6 DIY effective DIY methods for getting rid of fruit flies and gnats.

Remove the source

lime with fruit flies on it

The first step is to eliminate the source of whatever is attracting them.1 These insects are drawn to the sweet smell of ripe or rotting fruits and vegetables. Remove any overripe or damaged fruits and vegetables from your kitchen and keep your produce in the refrigerator. Also, don’t forget to empty your trash can regularly.

Clean your kitchen

dirty kitchen with dishes and rotting food

Fruit flies and gnats love dirty and moist places. Clean your kitchen thoroughly, paying attention to areas where food particles can accumulate. Wipe down countertops, clean the sink and the drain, and scrub the inside of your garbage disposal.2 You can use a mixture of water and vinegar to clean your kitchen surfaces – a 1:1 ratio will do. The acidic nature of vinegar helps to repel the pests.

Use a homemade trap

homemade apple cider vinegar and dish soap trap

A homemade trap can be an effective way to get rid of fruit flies and gnats. Pour apple cider vinegar into a jar, add a few drops of dish soap, and cover the jar with plastic wrap. Poke several holes in the plastic wrap with a toothpick. The sweet smell of the apple cider in the vinegar will attract while the dish soap will trap when they touch the surface of the liquid3. You can also use a similar method with wine or beer, which will attract the gnats.4

Read: 7 Natural Flea Remedies for Cats and Dogs

Use a vacuum cleaner

woman wearing yellow gloves with a yellow vacuum cleaner

Using a vacuum cleaner to suck up fruit flies and gnats is a quick and easy method. Simply turn on the vacuum cleaner and point it at the insects. Be sure to empty the vacuum bag or canister outside, as the insects can survive inside and emerge later.

Use essential oils

woman smelling essential oil from diffuser in the kitchen next to a bowl of fruits

Some essential oils, such as lavender, eucalyptus, and peppermint, have insect-repellent properties. You can use a few drops of these oils on a cotton ball and place them in areas wherever your problem is present. You can also add these oils to a spray bottle with water and spray the areas where the insects are found.5

Fix water leaks

damage to wood flooring and cabinets from water leaks

Gnats are attracted to moisture, so fixing any water leaks in your home can help to get rid of them. Check your pipes, faucets, and drains for leaks and fix them as soon as possible. You can also use a dehumidifier to reduce the humidity level in your home.

In conclusion, getting rid of fruit flies and gnats requires a multi-pronged approach. Removing the source of attraction, cleaning your kitchen, using homemade traps, using a vacuum cleaner, using essential oils, and fixing water leaks are all effective methods. Try these methods, and you will be able to enjoy a fruit-fly and gnat-free home.

It’s important to note that prevention is the key to avoiding an infestation in the first place. Some preventative measures include storing produce properly, keeping your kitchen clean, and fixing any leaks or standing water. By following these tips, you can keep your home free from these pesky insects.

Remember, if you do have a fruit fly or gnat problem, it’s important to act quickly to prevent it from spreading. By following these tips and using natural, non-toxic methods, you can effectively get rid of fruit flies and gnats without harming your health or the environment.

Keep Reading: Boxelder bugs: A Household Pest You Should Never Squish


  1. How To Get Rid of Fruit Flies.” Kitchen Fun with My 3 Son. Jill Mills. March 24, 2020.
  2. How to Get Rid of Fruit Flies That Have Taken Over Your Kitchen.” Bonappetit. Camryn Rabideau. April 22, 2022.
  3. How to Get Rid of Fruit Flies.” Eating Well. Stacey Ballis. March 25, 2023
  4. How to Get Rid of Fruit Flies in Your House, Fast.” Good Housekeeping. Caroline Picard and Lauren Piro. August 11, 2022.
  5. How to Get Rid of Gnats.” Popular Mechanics. Joseph Truini. July 23, 2022.