How to Get Rid of Fruit Flies

How to Make a Homemade Fruit Fly Trap

DIY fruit fly trap

The Spruce / Melissa Ling

Battling a swarm of fruit flies in your kitchen or bathroom? Get rid of them quickly with this simple, homemade trap.


  • Apple cider vinegar
  • Dish soap
  • A jar or small bowl
ingredients for a fruit fly trap
The Spruce / Ana Cadena 


Although vinegar is the main ingredient, and it is considered safe for consumption, liquid dish soap is not. Keep this solution out of the reach of children.


Before You Begin:

Toss out any overripe fruit that may be attracting fruit flies.

  1. Pour a cup of apple cider vinegar into a jar or small bowl.

    pouring vinegar into a jar
    The Spruce / Ana Cadena  
  2. Add a couple of drops of dish soap to the jar.

    squeezing a few drops of soap into a jar
    The Spruce / Ana Cadena  
  3. Place the trap in the area where you've seen the fruit flies, and wait for it to do its job.

    fruit fly trap on a kitchen counter
    The Spruce / Ana Cadena 

Why This Works

Vinegar is a versatile, environmentally-friendly kitchen product. In addition to its cooking uses, it is an inexpensive ingredient in many cleaning DIYs. Plus, unlike many commercial products, vinegar does not emit harmful, harsh fumes.

Fruit flies are attracted to the smell of the vinegar and will attempt to land on its surface. However, they're in for a surprise—since the dish soap breaks the surface tension of the vinegar, the fruit flies fall in and drown. Say goodbye to that annoying swarm.


  • A bottle with a small neck can also be used.
  • Keep a fruit fly trap on your kitchen counter, even after you've trapped your fruit flies. It'll prevent future infestations from occurring. You can keep it in a pretty container, so it doesn't stand out. The vinegar evaporates over time, so top it off whenever you notice it's getting low.

Alternative Method

If you don't have any vinegar on hand, you can also trap fruit flies by placing a piece of overripe fruit in an open plastic bag. Just wait for the fruit flies to congregate on the fruit. Then, carefully seal the bag, trapping them inside.

How to Prevent Future Infestations

Often infestations occur when you bring home infected fruit from the grocery store or produce stand. If you notice fruit flies when you're shopping, skip any produce that they're near. You can bet there are plenty of fruit fly eggs on that produce just waiting to hatch out in your kitchen. And when you consider that a single fruit fly can lay 500 eggs, that's a pretty compelling reason to go home without the bananas that you planned to buy.

Be diligent about eating fruits and vegetables before they become overripe or go bad. Fruit flies like to lay their eggs on ripe or fermented produce.

Take your trash and recyclables out regularly. Small amounts of juice or wine left at the bottom of bottles are enough to catch the attention of a fruit fly. If you can't remember the last time you scrubbed out your kitchen trash can and recycling bins, take care of that before the fruit flies remind you that you're overdue.

Watch Now: DIY Citrus and Herb Sprays for a Cleaner Green Home