Cobalt Hollow

How to Make a Gnat Trap and When to Use a Fly Trap

Fill a jar with vinegar and a few drops of dish soap for fruit flies; use sticky cards and drier soil for fungus gnats. Here are the recipes, placement and when to switch.

CH

The Cobalt Hollow Team

November 25, 2026 · 6 min read

Jar, vinegar and dish soap on a counter, how to make a gnat trap

How to make a gnat trap comes down to one jar, a sweet and sour liquid, and a drop of dish soap. Pour apple cider vinegar or another fermented bait into a jar, add soap so insects sink instead of landing, and set it near where you see them. This works for fruit flies; fungus gnats need a different approach, covered below.

Both pests get called gnats, so the first step is to identify which one you have. The bait, the placement and the point where a light trap makes sense all depend on that.

Fruit flies or fungus gnats: identify the pest first

The two are not the same insect. Fruit flies are tan or brown, hover around ripe produce, drains and trash cans, and are drawn to fermenting smells. Fungus gnats are slim, dark and weak fliers, and you find them around houseplants and damp potting soil.

Watch where they gather for a day. Insects circling the fruit bowl or sink are fruit flies. Insects walking on soil or rising when you water a pot are fungus gnats.

SignFruit flyFungus gnat
Where you see themFruit bowl, sink, trash, recyclingHouseplants, seedling trays, windowsills
What attracts themRipe fruit, fermenting liquid, spillsDamp soil, decaying plant matter
Bait trapFits: vinegar or wine baitsPoor fit; use sticky cards and dry soil
Main fixRemove the food source, then trapLet the soil surface dry, then trap
Overripe fruit bowl on a kitchen counter with tiny flies hovering
Fruit flies gather where ripe or fermenting food sits out.

How to make a gnat trap at home

This is the standard jar trap for fruit flies. It needs no special parts.

What you need

  • A small jar or glass
  • Apple cider vinegar (see swaps below)
  • Dish soap
  • Plastic wrap and a rubber band, or a paper cone
  • A toothpick

Steps

  1. Pour about an inch of apple cider vinegar into the jar.
  2. Add a few drops of dish soap and stir gently so it does not foam.
  3. Cover the opening with plastic wrap and secure it with the rubber band.
  4. Poke several small holes in the wrap with the toothpick. Insects enter but have a hard time finding the way out.
  5. Set the jar next to the fruit bowl or sink and leave it out overnight, then check it.

The soap breaks the surface tension of the liquid. Without it, a fly can stand on the vinegar and drink. With it, the insect sinks, which is the sink and drown principle behind most homemade gnat killer recipes.

Replace the liquid every few days, or sooner if it looks cloudy or the jar is full.

Field note

Use a paper cone instead of plastic wrap: roll paper into a funnel, trim the tip so the opening is small, and set it point-down in the jar. Tape the seam closed.

Bait swaps when you have no apple cider vinegar

You can make a gnat trap without apple cider vinegar. The goal is a fermenting or sweet smell, so several pantry items work.

BaitHow to set it up
White vinegarAdd a spoonful of sugar for a sweet note, then the soap
Red wineA splash in a glass, then a few drops of soap
Overripe banana or other fruitPlace a piece in a jar, cover with wrap and poke holes
Fruit juiceMix in a little vinegar, then add the soap

Keep the soap step in every version that uses liquid. For a fruit-only jar, the wrap with small holes does the holding work.

The same recipes cover how to make a gnat trap indoors. Place a few small jars in the rooms where you see insects rather than one large jar in a single spot.

Where to place gnat traps

Placement matters as much as the recipe. Put traps close to the source, because the insects are drawn to the bait when they find its smell.

  • Beside the fruit bowl, compost caddy or trash can
  • Near the sink drain and under the sink
  • On a counter away from open windows, where air does not scatter the scent
  • On a windowsill or shelf near houseplants, with sticky cards for fungus gnats

Remove the attractant as you set traps. Wash produce, take out trash, rinse recycling and wipe spills. A trap catches adults, but fresh food keeps new ones arriving.

Outside

Outdoors, a jar by the patio table can catch a few flies, but open air gives insects plenty of other places to go. Cover food and drinks, empty standing water from saucers and buckets, and keep trash lids closed. Our guide to what a bug zapper is, how it works and where it fails explains one outdoor option and its limits.

Houseplants on a windowsill with a yellow sticky card in the soil
Sticky cards sit at soil level, where fungus gnats land.

How to trap fungus gnats

A vinegar jar draws few fungus gnats, because they come from the soil rather than from fermenting food. The larvae live in damp potting mix, so the fix has two parts: trap the adults and change the watering.

  1. Press yellow sticky cards into the soil of affected pots, upright on a stake, so the adults land on them.
  2. Let the top layer of soil dry out between waterings. Check the pot with your finger before you water.
  3. Empty any water left in the saucer.
  4. Water from the bottom when you can, so the surface stays dry.
  5. Replace the cards when they are covered with insects.

A thin layer of coarse sand on top of the soil gives gnats a dry surface. If a pot stays infested, repot it with fresh dry mix and check for soggy roots.

Common mistakes with homemade traps

  • Skipping the dish soap, so insects land and fly off again
  • Leaving the jar uncovered, which lets in dust and lets insects escape
  • Letting the bait sit for weeks until it is dry or moldy
  • Setting one trap far from the source
  • Using a vinegar trap for fungus gnats and expecting it to solve a soil problem
  • Overwatering houseplants while trapping

If you are choosing between recipes, the jar with apple cider vinegar and soap is a good fit for fruit flies, and white vinegar with sugar is a reasonable swap. A homemade trap is one tool, and removing the source still comes first.

When to switch to an indoor fly trap

Homemade traps are fine for a small problem. Consider an indoor trap that uses light and a sticky board when:

  • Insects keep returning after you remove food and dry the soil
  • You have many plants and sticky cards are hard to place
  • You do not want an open jar of liquid where children or pets can reach it
  • The insects gather in a spot with an outlet, such as a kitchen or sunroom

Light traps pull in insects that fly toward the glow and hold them on a sticky surface. Follow the manual for placement and unplug before changing the board. You can also browse our Pest Control collection for other traps and tools. Keep fresh food covered and soil dry, because a light trap catches adults and leaves the source in place.

If the pest turns out to be a mouse or rat

Tiny flying insects are one problem, but droppings, gnawing or scratching in the walls point to a rodent. A jar of vinegar does nothing there. VoltRid is a plug-in electric rodent trap for mice and rats: you bait the plates, connect the AC adapter and set the unit where rodents travel. An LED indicator shows the trap status, and the unit opens for emptying and rinsing the plates. It includes an automatic shutoff that engages when the trap is opened.

Our guide to what to do next with a mouse in a trap, including disposal and resetting covers the cleanup steps.

VoltRidIn this guideVoltRid$119.99

Frequently asked questions

Yes. White vinegar with a spoonful of sugar, a splash of red wine, or a piece of overripe fruit in a covered jar all give off the fermenting smell that draws fruit flies. Add a few drops of dish soap to any liquid bait so insects sink.

No. Fruit flies are drawn to ripe fruit, drains and fermenting spills. Fungus gnats are slim, dark insects found around damp potting soil and houseplants. The fix differs: bait jars suit fruit flies, while sticky cards and drier soil suit fungus gnats.

Fruit flies come for ripe produce, trash, recycling and spills. Fungus gnats come for damp soil in houseplants and seedling trays. Removing the food source or letting the soil surface dry addresses the cause, and traps then catch the adults that remain.

Fill a jar with an inch of apple cider vinegar, add a few drops of dish soap, cover with plastic wrap and poke small holes. The soap breaks the surface tension, so insects that reach the liquid sink. Change the liquid every few days.