An apple cider vinegar gnat trap is one of the simplest DIY pest solutions: a small container of vinegar with a drop of dish soap, set near where you see the bugs. It works well for fruit flies but poorly for other types of gnats, so knowing which pest you’re dealing with makes the difference between a clean trap and a full one.
How to Make the Trap
Pour 3 to 4 tablespoons of apple cider vinegar into a glass, jar, or small bowl. Add one or two drops of liquid dish soap and give it a gentle swirl. That’s the basic version, and it catches fruit flies reliably.
For a more advanced setup, roll a piece of paper into a cone with a small opening (about 3/4 to 1 inch wide) at the narrow end. Set the cone into the glass so the tip points down toward the vinegar without touching the liquid. This funnel design lets flies enter easily but makes it harder for them to find their way back out. Make sure there are no gaps between the paper and the rim of the glass.
If you want to boost the trap’s pulling power, drop a small piece of ripe banana or apple into the vinegar. A pinch of sugar also helps. Both add extra fermentation scent that draws flies from farther away.
Why Apple Cider Vinegar Works
Apple cider vinegar is a fermentation product, and it releases the same volatile compounds that ripe and rotting fruit does. Fruit flies detect these chemicals through specialized smell receptors on their antennae. Research published in PLOS ONE identified two compounds, ethyl acetate and acetoin, as the main attractants. These trigger the strongest response in the flies’ olfactory neurons. Interestingly, acetic acid (the sour smell you notice) isn’t what draws them in at all.
The dish soap plays a critical role. Water and vinegar have enough surface tension for a tiny insect to land on the liquid and walk across it. A drop of dish soap breaks that tension. When a fly touches the surface, it sinks and drowns instead of skating away. Without the soap, you’ll attract flies but catch very few.
Where to Place It
Set the trap as close as possible to where you’re seeing the most activity. In a kitchen, that typically means next to the fruit bowl, beside the trash can, or near the recycling bin. Keep it away from the sink, where splashing water can dilute the mixture and weaken the scent. If you have kids or pets, place it somewhere stable and out of reach.
Check the trap once a day. Replace the mixture when it gets cloudy, crowded with dead flies, or starts to look diluted. A fresh batch every two to three days keeps the scent strong. Don’t hide the trap inside a cabinet. It needs to be in the open where flies can find it.
Which Bugs It Actually Catches
This is where most people run into trouble. “Gnat” is a catch-all term, and the tiny flies in your home could be one of several species that need completely different approaches.
- Fruit flies: Small, tan or brown, usually hovering near fruit, trash, or drains. These are what apple cider vinegar traps are designed for, and they work extremely well.
- Fungus gnats: Darker, more mosquito-shaped, and they crawl out of the soil in your potted plants. They are not strongly attracted to vinegar. Both Colorado State Extension and the University of Wisconsin Horticulture program note that vinegar bait is far less effective on fungus gnats than other methods.
- Drain flies: Fuzzy-winged, moth-like flies that appear near sinks and shower drains. They breed in the organic buildup inside pipes and won’t be drawn to a vinegar trap.
- House flies: Too large for vinegar traps. Sticky fly tape or UV light traps work better.
If your trap sits untouched for a day or two, you’re likely dealing with something other than fruit flies.
What to Do About Fungus Gnats
Fungus gnats breed in consistently moist potting soil. The adults are mostly a nuisance, but the larvae feed on roots and organic matter in the soil, which can damage plants over time. The fix starts with watering habits: let the top 1 to 2 inches of soil dry out completely between waterings. Switching to bottom-watering (filling the saucer and letting the plant drink from below) keeps the soil surface dry and far less appealing for egg-laying.
Yellow sticky traps, available at any garden center, are the most effective way to catch adult fungus gnats. The bright color attracts them, and they stick on contact. Place the traps right next to the affected plant, either standing upright in the soil or laid horizontally nearby.
To kill larvae already in the soil, mix one part 3% hydrogen peroxide with four parts water and pour it over the soil as you would a normal watering. The solution fizzes on contact with larvae and breaks down into water and oxygen, so it won’t harm most plants. Let the soil dry out afterward. For persistent infestations, a biological larvicide containing Bacillus thuringiensis israelensis (Bti) targets fungus gnat larvae specifically without affecting plants, pets, or people.
What to Do About Drain Flies
If the flies cluster around sinks, shower drains, or floor drains, the breeding ground is almost certainly organic buildup inside the pipes. Fats, oils, food residue, and even body oils from handwashing create a sludge layer that drain flies use as food, habitat, and nursery all at once. As long as that buildup exists, the flies keep multiplying.
For a mild problem (just a few flies), pour a kettle of boiling water down the drain to melt and flush the buildup. You can also pour half a cup of baking soda followed by one cup of white vinegar down the drain, let it fizz for 15 minutes, then flush with hot water. For stubborn infestations, scrub inside the drain opening with a stiff brush to physically remove the sludge, or use a commercial drain cleaner formulated to break down organic buildup. The key is eliminating the breeding site. Killing the adults without cleaning the pipes just means a new generation in a week or two.
Preventing Flies From Coming Back
Traps catch flies that are already in your home. Preventing the next wave means cutting off what attracted them. Store ripe fruit in the refrigerator or inside sealed containers. Empty kitchen trash cans frequently, and rinse recycling containers before they sit in the bin. Wipe down counters where juice, wine, or sugary liquids have spilled.
For drain-related problems, run water through infrequently used drains at least once a week to prevent stagnant buildup. Clean garbage disposal units regularly. In bathrooms, keep drains clear of hair and soap scum, both of which create the organic layer that drain flies need. If you grow houseplants, avoid overwatering and remove any decaying leaves sitting on the soil surface. A thin layer of sand or decorative gravel on top of the potting mix can also discourage fungus gnats from laying eggs.