A few tiny flies around a sink or houseplant can turn into a noticeable nuisance surprisingly quickly. The frustrating part is that killing the adults you can see rarely solves the underlying problem.
If you want to know how to get rid of gnats, start by identifying where they are breeding. Fungus gnats usually develop in moist potting soil, drain flies breed in organic film inside drains, and fruit flies gather around fermenting produce and other food residue. Remove the breeding source first, then use traps to catch remaining adults. CSU Engagement & Extension
That source-first approach matters because “gnat” is an informal label people use for several kinds of tiny flying insects. A vinegar trap may catch fruit flies while doing little to solve fungus gnats reproducing in a flowerpot.
How to Get Rid of Gnats: Start With the Source
The most effective strategy has three parts:
- Identify the type of small fly.
- Remove or treat its breeding site.
- Trap remaining adults while the life cycle is interrupted.
Before putting vinegar bowls throughout the house, spend a few minutes figuring out where the insects are most concentrated.
Check your houseplants, kitchen counters, fruit bowl, trash and recycling containers, garbage disposal, sink drains, floor drains, and other consistently damp areas.
Use Location as Your First Clue
Where you repeatedly see the insects can tell you a lot.
| Where you see them | Likely pest | Common breeding source | Main solution |
|---|---|---|---|
| Around houseplants | Fungus gnats | Damp potting mix | Reduce soil moisture |
| Around fruit or produce | Fruit flies | Fermenting organic matter | Remove food source |
| Around sinks and drains | Drain flies | Organic film inside plumbing | Mechanically clean drain |
| Around garbage | Fruit/phorid flies | Decaying organic material | Clean and sanitize |
| Around windows near plants | Fungus gnats | Nearby plant containers | Treat potting medium |
Don’t rely on location alone. Different small flies can occasionally share the same environment.
Know Which Type of Gnat You Have
Correct identification is one of the most overlooked parts of learning how to get rid of gnats.
Fungus Gnats
Dark-winged fungus gnats, including Bradysia species in the family Sciaridae, are slender, dark flies that resemble miniature mosquitoes. Adults are roughly 1/8 inch long and have long legs and antennae.
They are strongly associated with moist growing media. Their larvae live primarily in the upper portion of the potting mix, feeding on fungi, algae, decaying organic matter and sometimes plant roots. CSU Engagement & Extension
Fungus gnats often appear:
- Flying just above potting soil
- Crawling across the soil surface
- Resting near plant containers
- Gathering around windows or lights
Adults are primarily a nuisance and do not bite. Severe larval populations can sometimes affect roots, particularly in young or stressed plants. CSU Engagement & Extension
Fruit Flies
Fruit flies are commonly confused with gnats.
Instead of concentrating around soil, they are typically associated with fermenting or decomposing food and liquids. Common sources include overripe produce, spilled sugary drinks, food residue, recycling containers and garbage.
If the insects suddenly gather around bananas, tomatoes or a recycling bin rather than your plants, inspect food sources first.
Drain Flies
Drain flies, sometimes called moth flies, look noticeably different when viewed closely. They are tiny, fuzzy flies with broad, hairy wings.
Their larvae can develop in the gelatinous organic film that builds up inside drains and traps. Kitchens, bathrooms, basements and floor drains are common problem areas. They may also reproduce around sewer leaks, dirty garbage containers, condensate pans and other persistently wet organic material. University of Maryland Extension
What About Phorid Flies?
Another small household fly is the phorid fly.
Because several species of tiny flies can look similar from a distance, a persistent infestation that does not respond to normal fruit-fly, plant or drain treatment may require closer identification.
This is especially important when insects appear to be emerging from structural spaces rather than an obvious plant, drain or food source.
How to Get Rid of Gnats in the House
Once you’ve identified the likely breeding area, concentrate your effort there rather than spraying every adult you see.
1. Remove Decaying Food
Inspect the kitchen thoroughly.
Discard overripe or spoiled fruits and vegetables. Check less obvious places too: potatoes and onions stored in cabinets, produce behind appliances, food scraps under trash liners and residue inside recycling containers.
Refrigerate ripe produce temporarily while you’re dealing with an infestation.
Clean:
- Countertops
- Under small appliances
- Garbage cans
- Recycling bins
- Food storage areas
- Sticky drink spills
- Empty beverage containers
One forgotten piece of decomposing produce can keep a small-fly problem going.
2. Empty and Wash Garbage Containers
Taking the trash outside isn’t always enough.
Juice, food residue and organic material can remain on the bottom and sides of the container. Wash the bin and allow it to dry before inserting a fresh liner.
Do the same with compost and recycling containers.
3. Check Hidden Moisture
Small flies need suitable breeding conditions, and moisture is a recurring factor.
Look underneath sinks and around:
- Leaking plumbing
- Refrigerator drip or condensate pans
- Air-conditioning condensate areas
- Wet mops and cleaning equipment
- Plant saucers
- Damp organic debris
Fix leaks rather than simply treating insects around them.
4. Vacuum Visible Adults
A vacuum can provide immediate population reduction when many adults are resting around windows, walls or plants.
It won’t solve the infestation by itself because eggs and larvae remain at the breeding site, but it removes adults without spraying insecticide throughout your living space.
How to Get Rid of Gnats With Vinegar
An apple cider vinegar trap is useful mainly as an adult trap, particularly for fruit flies attracted to fermenting odors.
A simple trap can be made using:
- Apple cider vinegar
- A small bowl or jar
- A small amount of dish soap
Pour a little vinegar into the container and add a drop or two of dish soap.
Place it close to the area where the flies are active.
Commercial and home-care sources commonly recommend vinegar traps for reducing adult small flies, but trapping alone should not replace removing their breeding source. This Old House
Why Dish Soap Is Added
The soap changes the surface characteristics of the liquid so insects that contact it are more likely to become trapped rather than simply landing and leaving.
Why Vinegar Traps Sometimes Fail
If you put out apple cider vinegar and still see gnats every day, the trap may not be targeting the pest you actually have.
For example, fungus gnats are developing in potting medium. Catching a few adults does nothing about larvae continuing to mature in wet soil.
The practical rule is simple:
Use traps to reduce adults; treat the breeding source to eliminate the infestation.
How to Get Rid of Gnats in Plants
Houseplants are one of the most common sources of fungus gnats.
The problem frequently starts with watering.
Moist growing medium encourages fungi and decaying organic material that fungus gnat larvae feed on. Colorado State University Extension identifies allowing the growing medium—particularly the upper 1–2 inches—to dry between waterings as one of the most important management measures. CSU Engagement & Extension
Let the Soil Dry Appropriately
Stop watering on a fixed calendar.
Instead, check whether the plant actually needs water. Allow the surface layer to dry to an appropriate degree for that particular plant without allowing a moisture-sensitive plant to wilt severely.
University of Minnesota Extension similarly recommends letting the soil surface dry as much as possible between waterings while keeping the plant healthy. University of Minnesota Extension
Also make sure:
- Pots have drainage holes.
- Containers aren’t standing in water.
- Saucers are emptied after watering.
- Dead leaves and flowers are removed.
- The growing medium isn’t constantly saturated.
This addresses the environment fungus gnats need rather than merely catching adults.
Use Yellow Sticky Traps
Yellow sticky cards are useful for catching and monitoring adult fungus gnats.
Place them near the potting-medium surface or around affected plants.
Sticky traps can tell you whether the population is declining, but don’t depend on them as the only treatment. Eggs and larvae remain in the growing medium. University of Minnesota Extension
Check for Larvae With a Potato Slice
Here’s a useful diagnostic trick that many homeowners don’t know.
Place a roughly 1/4-inch slice or wedge of raw potato on the growing medium. Fungus gnat larvae may migrate toward it and feed. Check the underside after a few days for small, translucent, wormlike larvae with dark heads. CSU Engagement & Extension
This can help confirm that the plant soil is actually the breeding source.
Consider Bti for Persistent Fungus Gnats
If changing your watering practices and using sticky traps aren’t enough, Bacillus thuringiensis subsp. israelensis (Bti) can be used in appropriately labeled products as a soil treatment targeting fungus gnat larvae.
Bti works against the larval stage rather than simply killing adults flying around the room. University extension guidance specifically identifies Bti as a biological option for fungus gnat larvae. CSU Engagement & Extension
Always use a product specifically labeled for the intended application and follow its label directions.
Beneficial Nematodes Are Another Option
The beneficial nematode Steinernema feltiae can also target fungus gnat larvae in growing media.
These microscopic roundworms enter susceptible larvae and are used as a biological-control option, particularly in plant-growing environments. CSU Engagement & Extension
For an ordinary minor household infestation, correcting excess moisture may be all that’s necessary. Biological treatments become more useful when populations persist.
Repot When the Growing Medium Is the Problem
Old potting mix can break down and retain excessive moisture.
If a plant stays wet for too long even after you’ve reduced watering, repotting may help. Use a clean container and fresh potting medium with drainage appropriate for the plant.
University of Minnesota Extension recommends clean pots and new potting soil rather than garden soil when potting indoor plants. University of Minnesota Extension
How to Get Rid of Gnats in Drains
If small flies repeatedly appear around your kitchen or bathroom sink, don’t automatically assume pouring something down the drain will solve the problem.
First establish that the drain is actually the source.
Test the Suspected Drain
Monitor activity around individual drains. University of Maryland Extension suggests covering a suspected plant or drain with screen or cheesecloth and checking for flies to help determine the source. University of Maryland Extension
Identifying the correct drain saves time when a room contains several potential breeding sites.
Clean the Organic Film
Drain-fly larvae don’t simply live in drain water. They develop in the moist organic slime coating the drain and trap.
That’s why mechanically removing buildup is valuable.
Where safely accessible:
- Remove obvious hair and debris.
- Clean the drain opening.
- Scrub accessible pipe surfaces with a suitable drain brush.
- Clean the trap when appropriate.
- Use an appropriate drain-cleaning product according to its directions.
- Flush as directed.
University of Maryland Extension specifically recommends mechanically cleaning traps and drains or using an appropriate over-the-counter drain cleaner followed by hot water. University of Maryland Extension
Don’t Mix Drain-Cleaning Chemicals
More chemical does not mean better pest control.
Never casually combine bleach, ammonia, acids, drain openers or other household cleaners. Dangerous reactions and toxic gases can result.
Follow the manufacturer’s label and ventilation instructions for whatever cleaning product you use.
Check Drains You Rarely Use
Floor drains, basement drains and little-used sinks deserve attention too.
Drain flies can also develop around sewer leaks, backups and other wet areas containing organic material. If cleaning a sink doesn’t change the population, broaden the inspection instead of repeatedly treating the same drain. University of Maryland Extension
Why Gnats Suddenly Appear in Your House
A gnat infestation may feel as though it appeared overnight, but there is usually an environmental change behind it.
Common triggers include:
- Overwatered houseplants
- New plants carrying insects
- Aging potting medium
- Ripe or forgotten produce
- Organic residue in drains
- Dirty garbage or recycling containers
- Plumbing leaks
- Persistent indoor humidity or moisture
Fungus gnats can reproduce continuously indoors when conditions remain favorable. At typical room temperatures, their egg-to-adult life cycle can be completed in roughly three to four weeks. Female fungus gnats may lay up to about 200 eggs during their short adult lives. CSU Engagement & Extension
That’s why an apparently minor problem can continue if damp growing media remain available.
How Long Does It Take to Get Rid of Gnats?
Don’t expect every fly to disappear the day you treat the source.
Adult insects may already be present, while immature stages can still be developing.
Fungus gnat larvae can become fully grown in approximately two to three weeks and then pupate before adults emerge. Under normal indoor conditions, the complete life cycle can take roughly three to four weeks. CSU Engagement & Extension
Drain flies also have a multistage life cycle; University of Maryland Extension reports total development can take roughly 7–28 days depending on conditions. University of Maryland Extension
So don’t judge a treatment solely by what happens during the first 24 hours.
Instead, look for a consistent decline in adults over the following days and weeks.
Quick Takeaway: Seeing a few gnats after treatment doesn’t automatically mean the treatment failed. A steadily declining number is a better sign that you’ve interrupted the breeding cycle.
What Kills Gnats Instantly—and What Solves the Problem?
This distinction prevents a lot of wasted effort.
An insecticide, vacuum or sticky trap may kill an adult immediately. But an adult gnat is only the visible portion of an established infestation.
| Method | Reduces adults | Targets larvae/source | Long-term value |
|---|---|---|---|
| Vacuum | Yes | No | Low alone |
| Vinegar trap | Yes, mainly suitable small flies | No | Low alone |
| Yellow sticky card | Yes | No | Good for monitoring |
| Drying plant soil appropriately | Indirectly | Yes | High for fungus gnats |
| Bti soil treatment | No | Yes | High when properly used |
| Steinernema feltiae | No | Yes | Useful biological control |
| Scrubbing drain biofilm | Indirectly | Yes | High for drain flies |
| Removing spoiled produce | Indirectly | Yes | High for fruit flies |
| General insecticide spray | Sometimes | Usually limited | Variable |
This is why spraying every insect you see often creates a cycle of temporary relief followed by another wave.
Common Gnat Remedies That Don’t Fix the Root Cause
Several popular methods aren’t necessarily useless; they’re simply incomplete.
Vinegar Everywhere
Vinegar traps can catch certain adult flies.
They cannot dry wet potting soil, remove drain biofilm or clean decomposing material from beneath a garbage liner.
Sticky Traps Alone
Sticky cards are excellent monitoring tools for fungus gnats and can reduce the number of adults. But University of Minnesota Extension cautions that they shouldn’t be relied upon as the only management method. University of Minnesota Extension
Spraying Adults Repeatedly
Killing adults provides visible results, which makes spraying feel effective.
But fungus gnat larvae are living inside the growing medium. Treatments aimed only at adults do not directly affect those larvae. CSU Engagement & Extension
Treating Every Tiny Fly as the Same Pest
This is probably the biggest mistake.
A fungus gnat problem needs soil management. A drain fly problem needs drain sanitation. A fruit-fly problem requires finding fermenting organic material.
Identification changes the treatment.
How to Prevent Gnats From Coming Back
Once the population falls, prevention is mostly about eliminating favorable breeding conditions.
Change How You Water Houseplants
For fungus gnats, moisture management is the strongest long-term tool.
Allow the growing medium to dry appropriately between waterings, make sure pots drain properly, and don’t leave containers standing in water. Overwatering and poor drainage encourage fungus gnat problems. University of Minnesota Extension
Inspect New Plants
New plants can introduce household pests.
Colorado State University Extension recommends carefully checking new plants and quarantining them separately for a few weeks to reduce the chance of introducing pests to an existing collection. CSU Engagement & Extension
Keep Produce Under Control
Use ripe fruit promptly and inspect produce regularly.
During an active fruit-fly problem, refrigerating suitable produce can remove an easy food and breeding source.
Clean Food and Drink Spills Quickly
Pay special attention to sugary liquids, juice, wine, soda and food residue.
Check underneath appliances and containers rather than cleaning only visible countertop surfaces.
Maintain Drains
You don’t need to wait for flies to appear before addressing slow or dirty drains.
Remove accumulated organic debris and deal with drainage or plumbing problems before they create a long-lasting moist environment.
Remove Dead Plant Material
Dead leaves, flowers and decaying roots add organic material to plant containers.
University of Minnesota Extension recommends keeping the soil surface clear of dead leaves, stems and flowers as part of good indoor-plant sanitation. University of Minnesota Extension
Fix Persistent Moisture Problems
Repeated infestations sometimes indicate something more significant than a dirty countertop.
Check for plumbing leaks, sewer problems, condensate buildup and consistently damp structural areas.
If insects repeatedly return despite treating obvious sources, don’t just increase the number of traps—look for the moisture or organic material you’re missing.
Are Gnats Harmful?
That depends on what you’re calling a gnat.
Adult fungus gnats are generally harmless to people and do not bite. They are primarily nuisance insects. Their larvae feed mostly on fungi, algae and decomposing material, although they can also feed on plant roots. CSU Engagement & Extension
Other insects commonly called gnats outdoors can bite, so an insect swarming around a person’s skin outside shouldn’t automatically be assumed to be the same fungus gnat found in houseplant soil.
For indoor infestations, correct identification remains the safest starting point.
When Should You Call a Pest-Control Professional?
Most small household infestations can be handled by finding and eliminating the breeding source.
Professional investigation becomes more reasonable when:
- Large numbers continue appearing after several weeks.
- You cannot locate the breeding site.
- Flies appear to be emerging from walls or structural spaces.
- You suspect a hidden plumbing or sewer problem.
- Multiple drains remain infested after thorough cleaning.
- The infestation repeatedly returns despite correcting plant, food and moisture sources.
At that point, identification matters more than simply applying stronger pesticides.
A pest-management professional can determine which fly is present and search for breeding material that may be inaccessible.
The Most Reliable Way to Get Rid of Gnats for Good
The key to how to get rid of gnats isn’t finding the strongest spray or building the biggest vinegar trap. It’s finding where the insects are reproducing.
If they’re around houseplants, reduce excessive soil moisture, use yellow sticky cards to monitor adults and consider an appropriately labeled Bti treatment for persistent larvae. If they’re emerging from drains, remove the organic film where larvae develop. If they’re concentrated around produce or garbage, eliminate the fermenting food source.
Then keep monitoring for a few weeks rather than stopping the moment the visible adults disappear.
Treat the breeding site first and the flying adults second. That’s the difference between temporarily catching gnats and actually breaking their life cycle.
