The most effective DIY gnat trap is a small jar filled with apple cider vinegar and a drop of dish soap. But the best trap depends on which type of gnat you’re dealing with, because different species are attracted to different things. Vinegar traps work well for fruit flies, while fungus gnats respond better to yellow sticky traps, and drain flies need a completely different approach focused on cleaning their breeding site.
Identify Your Gnat First
All three common household gnats are tiny (2 to 4 mm), but they look and behave differently. Getting this right matters because a vinegar trap that catches dozens of fruit flies will barely touch a fungus gnat problem.
- Fruit flies have red eyes and cluster around ripe fruit, garbage disposals, and recycling bins. They’re the ones most reliably caught by vinegar traps.
- Fungus gnats are dark gray to black, smooth, and slender with long legs, almost mosquito-like. They hover near houseplant soil and are drawn to light, so you’ll often spot them near windows. Their larvae live in moist potting mix and feed on fungi and plant roots.
- Drain flies are fuzzy and moth-like with a triangular shape when resting. They flutter weakly near bathroom or kitchen drains, especially at night, and rarely travel far from the pipes where they breed.
Apple Cider Vinegar Trap
This is the classic for fruit flies and works because the fermenting scent of apple cider vinegar mimics rotting fruit. The dish soap is the secret ingredient: water normally has enough surface tension for tiny flies to land on it without sinking, but a single drop of soap breaks that tension and causes them to fall through and drown.
Pour about one-third cup of apple cider vinegar into a small jar or shallow bowl. Add two tablespoons of water and one drop of liquid dish soap. Just one drop. Too much soap can mask the vinegar scent. Set the jar wherever you’re seeing the most gnats. You can also add one to two tablespoons of sugar to the mix if you’re not catching much after a day or two.
For a more contained version, cover the jar with plastic wrap and poke several small holes in the top. Flies crawl in through the holes but struggle to find their way back out. The open-bowl method tends to catch more quickly, though, since there’s no barrier to entry.
Place multiple traps if your kitchen is large or gnats are in several rooms. Replace the vinegar every two to three days as its scent fades.
Why Vinegar Traps Sometimes Fail
If your vinegar trap sits for days and catches almost nothing, you’re likely dealing with fungus gnats or drain flies rather than fruit flies. Fungus gnats aren’t strongly attracted to fermenting fruit scents. Drain flies stay close to their pipe breeding grounds and won’t fly across the kitchen to investigate a jar of vinegar.
Other common problems: white vinegar doesn’t work nearly as well as apple cider vinegar because it lacks the fermented fruit compounds. Stale traps lose potency. And if you’re catching a few gnats but the population isn’t shrinking, the trap is only picking off adults while eggs keep hatching. You need to eliminate the breeding source, not just the adults you can see.
Yellow Sticky Traps for Fungus Gnats
Fungus gnats are strongly attracted to the color yellow. Commercial yellow sticky traps are cheap, but you can make your own by coating bright yellow index cards or pieces of yellow cardstock with a thin layer of petroleum jelly or honey on both sides. Use cards at least 3 by 5 inches so there’s enough surface area to be effective.
Place these traps horizontally near the soil surface of your houseplants, since fungus gnats emerge from and rest on the growing media. You can also set them vertically near windows where adults tend to gather. Stake a card into the pot using a chopstick or skewer with the sticky card attached at soil level. Check and replace them every few days as they fill up.
Sticky traps catch adults, but the real population lives in the soil as larvae. To break the cycle, you need to address the soil directly.
Hydrogen Peroxide Soil Drench
Mix one part standard 3% hydrogen peroxide with four parts water and pour it over the soil of affected plants. The solution fizzes on contact and kills fungus gnat larvae without harming plant roots. Water your plants with this mixture in place of a normal watering, and repeat once a week for two to three weeks to catch newly hatching larvae.
The other simple fix is to let your soil dry out between waterings. Fungus gnat larvae need consistently moist soil to survive. Allowing the top inch or two of potting mix to dry completely between waterings makes the environment hostile to eggs and larvae. A layer of coarse sand or decorative pebbles on top of the soil also discourages adult gnats from laying eggs.
Drain Fly Traps and Removal
Drain flies breed in the slimy biofilm of bacteria and algae that builds up inside pipes, floor drains, and plumbing fixtures. Trapping adults with vinegar jars will catch a few, but it won’t solve the problem because the eggs and larvae live inside the drain itself. Chemical drain cleaners don’t reliably kill the eggs either.
Start by scrubbing inside the drain opening with a stiff pipe brush to physically break up the biofilm. Then combine half a cup of salt, half a cup of baking soda, and one cup of vinegar. Pour this down the drain, let it sit overnight, and flush with boiling water in the morning. The fizzing reaction helps loosen organic buildup the brush can’t reach.
For maintenance, pour a medium pot of boiling water down the drain once or twice a week. This prevents biofilm from reforming. If drain flies persist, repeat the brush-and-baking-soda treatment every few days until you stop seeing adults.
To catch remaining adults while you’re cleaning out their breeding site, set a shallow dish of apple cider vinegar with dish soap near the drain at night, when drain flies are most active.
How Long Traps Need to Stay Active
Gnats reproduce fast. At typical room temperature (around 75°F), fungus gnat eggs hatch in about three days, larvae develop over roughly ten days, and adults emerge about four days after pupation. That’s a full generation in just 17 days. Warmer homes produce even faster cycles.
This means a single round of trapping won’t end an infestation. Even if you catch every adult today, eggs already laid will produce a new wave in two to three weeks. Plan to keep traps in place and refreshed for at least three to four weeks, and combine trapping with source elimination (drying out soil, cleaning drains, removing overripe fruit) to break the breeding cycle for good.
Eliminating the Source
Traps reduce adult numbers, but lasting results come from removing whatever the gnats are breeding in. For fruit flies, that means storing ripe fruit in the refrigerator, taking out kitchen trash daily, cleaning garbage disposals, and checking that recycling bins don’t have sticky residue from bottles or cans. Wet pet food left out for more than 30 minutes is another common attractant. Make sure refrigerator door seals are tight, since even small gaps let fruit flies reach produce inside.
For fungus gnats, repot plants in fresh, well-draining soil if an infestation is severe. Avoid overwatering and remove any decaying leaves sitting on the soil surface. For drain flies, the pipe brush and boiling water routine is non-negotiable. No amount of trapping compensates for an active breeding site that keeps producing new generations every few weeks.