How to Get Rid of Gnats: Find the Type, Then the Source

Illustration: a strip of tape laid half across a kitchen sink drain, a vinegar jar trap and a fruit bowl on the counter, a houseplant with a yellow sticky card on the windowsill.
To get rid of gnats, first work out which kind you have, then remove what they breed in: overripe fruit for fruit flies, wet potting soil for fungus gnats, slimy drains for drain flies. Trap the adults that are left with a vinegar trap or yellow sticky cards. You’re done when a fresh trap stays empty.
Cost: about $6–21 in supplies. Difficulty: moderate. Call a pro if you see swarms of small humpbacked flies on the first floor, which can mean a broken drain or sewer line under the house, or you still can’t find the source after checking fruit, plants, drains and trash.
This guide covers telling the four indoor gnats apart, finding and clearing the source, trapping the rest, which plan fits your home and what it costs. We haven’t run our own tests; it rests on University of Kentucky, University of Maryland, UC IPM and Texas A&M guidance and store list prices.
Saw gnats tonight? Put ripe fruit in the fridge and take out the trash. Pour apple cider vinegar into a jar (no cider vinegar? wine, beer or fruit juice also draws fruit flies), add a drop of dish soap, stretch plastic wrap over the top and poke one tiny hole. Lay tape half across each drain and check it in the morning. Skip the bug spray.
What Works and What Doesn’t Against Gnats
Removing the breeding source works; spraying the flies doesn’t.
| Method | Works? | Cost | Main limitation |
|---|---|---|---|
| Clearing ripe fruit, trash and recycling | Yes, for fruit flies | Free | Must keep produce cold until they’re gone |
| Letting potting soil dry, watering from below | Yes, for fungus gnats | Free | Some plants can’t take dry soil |
| Scrubbing drains, then boiling water | Yes, for drain flies | $7.99–$14.97 brush | Bleach adds no benefit (Texas A&M) |
| Covered vinegar jar trap | Yes, for fruit fly adults | $1.29 vinegar | Won’t catch fungus gnats or drain flies |
| Yellow sticky cards | Yes, for fungus gnat adults | $4.97 for 12 | Catches adults only; the source keeps breeding |
| Bti granules in plant water | Yes, for stubborn fungus gnats | $19.98 | Repeat about every five days indoors (UC IPM) |
| Indoor insecticide spray | No | Varies | Eggs and larvae keep hatching (UMD Extension) |
| Cinnamon on the soil | No | Low | “Won’t relieve you of fungus gnats” (UC IPM) |
Which Gnats Do You Have?
“Gnat” isn’t one insect. The University of Kentucky calls it an umbrella term for many small flies from different families. Indoors, the usual four are fruit flies, fungus gnats, drain flies and phorid flies, and each breeds somewhere different.
| What you see | Probably |
|---|---|
| Tan fly, about 1/8 inch, often red eyes, hovering over fruit, trash or wine | Fruit fly |
| Slender dark fly like a tiny mosquito, near houseplants and windows, weak flier | Fungus gnat |
| Fuzzy, moth-shaped fly resting on bathroom or kitchen walls, moves in short hops | Drain fly |
| Small fly that runs across counters instead of flying off, near trash or leaky appliances | Phorid fly |
Sizes overlap, so go by shape, behavior and location. Tiny bugs that jump rather than fly, in a sink or plant soil, are probably wingless springtails, and the fix is drying things out, covered in getting rid of springtails.
Mixing them up is a common complaint in gnat threads. One Reddit poster wrote that their “apple cider traps were working for a bit then not working,” then noticed the new flies lacked the red eyes of the first wave. A fruit fly trap won’t clear fungus gnats or drain flies.

Illustration: a fruit fly on a banana, a fungus gnat on potting soil, a fuzzy drain fly on tile beside a drain, and a humpbacked phorid fly on a counter near a trash can.
Are Gnats Harmful?
Mostly they’re a nuisance. The University of Kentucky says these four small flies don’t bite or transmit diseases, but they can carry bacteria onto food, so keep food covered.
Fungus gnat adults don’t bite people or damage plants either; only large numbers of larvae hurt roots, especially in seedlings.
Why Do I Have Gnats in My House?
Most indoor gnats are breeding in one of three places: wet potting soil, overripe fruit or a slimy drain. Most of these flies live outdoors and come in through doors and windows or on potted plants, then stay where they can breed: overripe produce, recycling and damp mops (fruit flies), soggy potting soil (fungus gnats), the slimy film inside drains (drain flies), and garbage or leaks under appliances (phorid flies).
Step 1: Find Where the Gnats Are Breeding
Give each check a few days:
- Tape the drains. Lay tape across each drain without covering it completely, so air still flows. Flies stuck to it mean that drain is a source.
- Test the soil. Push a chunk of raw potato, cut side down, into each suspect pot. After a few days, lift it: tiny clear worms with shiny black heads are fungus gnat larvae.
- Map with sticky cards. Put yellow sticky cards in several rooms. The University of Kentucky says the most flies stick nearest the source.
Step 2: Get Rid of the Gnats’ Breeding Site
Fruit flies. Getting rid of fruit flies starts in the kitchen: throw out overripe produce, keep fruit in the fridge, rinse recycling and let mops dry. University of Maryland Extension calls sanitation the primary control.
Fungus gnats. Dry soil kills the larvae; the houseplant steps are just below.
Drain flies. Scrub inside the drain with a stiff, long-handled brush, then flush with boiling water. Texas A&M AgriLife says bleach adds no benefit, and never to follow a caustic drain cleaner with bleach, which can release chlorine gas. The full routine is in how to get rid of drain flies; vinegar and baking soda are judged in drain fly home remedies.
Phorid flies. Hunt for anything decaying: trash cans, water under a fridge or washer, drains. If the tape and cards point nowhere, see when to call a pro below.
How to Get Rid of Fungus Gnats in Houseplants
Gnats around your plants are fungus gnats, and the larvae live in the top of wet potting soil. Starve them:
- Let the top inch of soil dry before you water again, and empty the saucers.
- Water from the bottom. Set the pot in a saucer of water so the roots drink while the surface stays dry (Wisconsin Horticulture).
- Stick yellow sticky cards in the pots to catch the adults before they lay more eggs.
- Top the soil with ½ to 1 inch of coarse sand or fine gravel, which keeps the surface dry and less attractive for egg-laying. Repot or toss plants that stay badly infested.
- Add Bti if they hang on. Mix the mosquito granules (a bacterium) with water and pour it on the soil as the label directs. The University of California’s IPM program says to repeat about every five days, since it doesn’t last indoors.
The full routine, including which plants can’t take dry soil, is in getting rid of fungus gnats.
Does cinnamon kill fungus gnats? No. A UC IPM myth-busting post says “potato chunks and cinnamon won’t relieve you of fungus gnats”; drying the soil is the fix.
How to Get Rid of Gnats in the Kitchen
Kitchen gnats are usually fruit flies, which peak indoors in late summer and fall. Clear the fruit bowl, produce bins, recycling, sponges and the trash can itself. Then check two drain fly spots: the sink drain and the drip pan (condensate pan) under the fridge.

Illustration: gloved hands poke a tiny hole in plastic wrap over a jar of apple cider vinegar; beside it, a yellow sticky card stands in a houseplant pot with dry topsoil.
Step 3: Trap the Gnats That Are Left
Traps clear the adults already flying while the source dies out:
- Fruit flies: the covered vinegar jar from the box above. The tiny hole lets flies in but not out, which an open bowl can’t do.
- Fungus gnats: yellow sticky cards, cut into squares on skewers and set in the pots.
- Drain and phorid flies: sticky cards near the source, mainly to confirm where they come from.
Kids or pets? Set the jar up high and keep sticky cards where small hands and fur can’t reach, such as on skewers in pots on a shelf. The University of California’s IPM program says Bti is toxic only to fly larvae.
Do You Need a Gnat Killer Spray?
Usually not. University of Maryland Extension says insecticide spraying is generally not effective or recommended for flies indoors: eggs and larvae keep hatching, so gnat eradication starts at the source.
For fungus gnats, insecticides are rarely warranted at home. If you use one, treat the soil with a product labeled for houseplants; never fog indoors or spray gnats in flight.
Why Do Gnats Keep Coming Back?
- The source is still there. The University of Kentucky says one female fruit fly can lay over 500 eggs.
- There’s a second type. The fruit flies are gone; fungus gnats or drain flies aren’t.
- Not enough time. Larvae already in the source keep maturing after you clean it, so expect stragglers for about one life cycle.
How long that is, from egg to adult:
| Gnat | Life cycle |
|---|---|
| Fruit fly | 8–10 days (University of Maryland Extension) |
| Fungus gnat | About 17 days at 75°F (UC IPM) |
| Drain fly | 7–28 days (University of Maryland Extension) |
If fresh traps still fill up after that, a source is still active. Getting rid of gnats for good means keeping produce cold, soil dry and drains brushed.
Gnats Swarming Outside: Usually Midges, Leave Them
Clouds of gnats over a lawn, porch or pond are usually midges. The University of Kentucky says most don’t bite, swarms often clear in a day or two, and treatment usually isn’t needed; a few relatives, the biting midges or no-see-ums, do bite. If swarms keep returning, drain standing water, switch outdoor lights to motion-activated ones or yellow, pink or orange bulbs, and use finer screens such as 20×20 mesh. Yard sprays give only temporary relief.
Which Plan Fits Your Situation
| Situation | Plan | Why |
|---|---|---|
| Gnats around houseplants | Dry the topsoil, sticky cards, Bti if needed | Fungus gnat larvae live in wet potting soil. |
| Gnats over the fruit bowl or trash | Fridge the fruit, rinse recycling, vinegar jar trap | Fruit flies breed in overripe produce. |
| Fuzzy flies on bathroom walls | Brush the drains, then boiling water | Drain flies breed in drain slime; see drain flies. |
| Kids or pets at home | Jar up high, sticky cards on skewers out of reach | Bti is toxic only to fly larvae (UC IPM). |
| You rent and suspect a leak or broken pipe | Tell the landlord in writing, with photos | You can’t open or repair it yourself. |
| Can’t find the source anywhere | Call a plumber, then a pro | Phorid flies on a first floor can mean a broken drain line. |
What It Might Still Cost
| Item | Typical cost |
|---|---|
| Apple cider vinegar, 16 oz | $1.29 |
| Yellow sticky traps, 12-pack | $4.97 |
| Long flexible drain brush | $7.99–$14.97 |
| Bti mosquito granules, 8 oz (fungus gnats only) | $19.98 |
| Pro: fungus gnats | $100–$150 |
| Pro: fruit flies | $100–$175 |
| Pro: phorid flies | $155–$275 |
| Pro: drain flies | $170–$260 |
DIY: U.S. list prices at Target and Walmart, October 1, 2026, before tax and shipping. Pro: Fixr average treatment cost by fly type (updated January 2025).
Most people can get rid of gnats in the house for $6 to $21: vinegar and sticky cards, plus a drain brush if needed. A pro makes little sense when the source is a fruit bowl, a houseplant or a drain you can reach.
Before You Start: A Quick Checklist
- Identify the gnat by shape and where it gathers.
- Tape the drains and test pots with a potato slice.
- Put ripe fruit in the fridge, and take out the trash.
- Let the topsoil dry before you water houseplants again.
- Cover the vinegar jar and poke one tiny hole, not an open bowl.
- Skip the bug spray indoors.
- Wait one life cycle, then set a fresh trap to confirm.
When to Call a Pro
- Swarms of small flies on the first floor you can’t trace. University of Maryland Extension says very large numbers of phorid flies there may mean a broken drain or sewer line under the building. Call a plumber first.
- You’ve checked fruit, trash, plants and every drain and still can’t find the source.
Renting? If you suspect a leak, a broken pipe or a drain you can’t open, tell your landlord in writing, with photos of where the flies gather.
Common questions
Fruit flies are one of several small flies people call gnats, along with fungus gnats and drain flies. Each breeds somewhere different.
The gnats in your house don’t; the ones that bite are outdoor flies such as biting midges (no-see-ums) and black flies, which do gnats bite covers.
The Bottom Line
Find what the gnats breed in, not just the flies: fruit, soil or drain. Clear it, trap the adults that are left, and give it one life cycle. Vinegar, sticky cards and a drain brush cover most homes for $6 to $21.
Sources and further reading · 7
- University of Kentucky Entomology: Small Flies (ENTFACT-657) and Non-Biting Midges and Gnats (ENTFACT-632).
- University of Maryland Extension: Fruit Flies, Fungus Gnats, Drain Flies, Phorid Fly and Flies Indoors.
- UC IPM: Fungus Gnats, Springtails and Debunking Pest Myths.
- Wisconsin Horticulture: Fungus Gnats on Houseplants.
- University of Minnesota Extension: Black Flies.
- Texas A&M AgriLife Extension: Drain Flies (E-184).
- Fixr: Fly Exterminator Cost.


