How to Get Rid of Gnats in Your Home

Get rid of gnats by identifying the type, removing its breeding source, using the right trap, and preventing a repeat infestation.

By · Reviewed by LeafyPixels Review Board · Published · Updated · 11 min read

A close view of a home setup for identifying and managing gnats

The quickest way to get rid of gnats is not to spray every flying insect you see. It is to identify what is attracting them, remove the place where they are feeding or breeding, and use a trap to catch the adults that remain. A vinegar trap can help in a kitchen, but it will not solve fungus gnats developing in damp potting soil. Scrubbing a drain can help with drain flies, but it will not explain a cloud of insects rising from a houseplant.

This distinction matters because “gnat” is a loose name for several tiny flying pests. Some are harmless nuisances, some damage plants, and some may bite. Use the location of the insects, the way they move, and the material around them as clues. Then follow the matching treatment instead of trying every home remedy at once.

Start by finding where the gnats are breeding

Watch the insects for five minutes before cleaning anything. Are they hovering over a potted plant, circling a bowl of fruit, clustering at a sink, or appearing near a trash can? Look for moisture as well as food. A small leak under a cabinet, a saucer that never dries, damp compost, and residue inside a drain can all support a population even when the visible room looks clean.

The adult insects are the part you notice, but the next generation is usually hidden. Eggs and larvae may be in the top layer of plant soil, a wet organic film in plumbing, or fermenting food residue. Killing adults gives temporary relief; removing that material breaks the cycle.

Use this quick decision rule:

Where you see themMost likely groupFirst place to inspect
Flying low around plant potsFungus gnatsDamp soil, saucers, and nearby plants
Swarming over fruit, recycling, or drinksFruit fliesProduce, bottles, spills, and trash
Resting on walls near sinks or tubsDrain fliesDrain openings and the organic film inside pipes
Biting outdoors or near screensBiting flies or another insectScreens, doors, standing water, and outdoor breeding sites

The table is a starting point, not a laboratory identification. Tiny flies are easy to confuse. If the insects do not fit one pattern, take a close photograph, place a sticky card near the activity, and inspect every damp organic source rather than committing to a single treatment.

Identify the tiny flying insect before treating it

Fungus gnats around houseplants

Fungus gnats are small, dark, delicate flies that often rise from soil when a pot is moved or watered. Adults may drift around a sunny window or hover just above the soil. Their larvae live in moist growing media and feed on fungi and decaying material; a heavy population can also irritate or damage tender roots and seedlings.

The strongest clue is the combination of plant pots and persistently wet soil. Check several plants, not only the one closest to the window. A shared watering routine can spread the problem across a collection, while a single pot with poor drainage can act as the source for the whole room.

A fungus gnat prevention setup focused on identifying the pest before treatment

Fruit flies around food and fermentation

Fruit flies are usually concentrated in the kitchen, especially around ripe or damaged produce, juice, wine, kombucha, recycling containers, garbage disposals, and sticky spills. Their small size makes them seem to appear from nowhere, but a thin film of sweet or fermenting material can be enough to sustain them.

Do not stop at the fruit bowl. Inspect the underside of a trash-can lid, the bottom of a recycling bin, a forgotten onion or potato, a damp dishcloth, and bottles waiting to be recycled. If adults gather at one trap but new ones continue to appear, the source is probably still present or hidden nearby.

Drain flies around wet plumbing

Drain flies are tiny, fuzzy-looking flies that often rest on nearby walls and make short, weak flights. They develop in the slimy organic film lining a drain or overflow opening. Pouring a liquid into the drain may kill some adults, but it does not reliably remove the film where larvae live.

To test a suspect drain, cover the opening overnight with a clear container or an upside-down piece of tape that does not seal a fixture needed for safety. Activity beneath the cover points to that drain as a source. Check bathroom basins, showers, floor drains, utility sinks, and rarely used fixtures.

The same-day plan for reducing indoor gnats

Isolate plants and remove obvious food sources

Move suspect plants away from the main group, but keep them in suitable light. Empty standing water from saucers, discard fallen leaves, seal food, rinse recyclables, take out wet trash, and wipe sticky spills. Fix or report leaks rather than placing a towel over them indefinitely. If a compost container is indoors, empty it or use a lid that closes tightly.

Work from clean to dirty when wiping surfaces, and wash tools afterward. Avoid carrying a plant from the infested area to another room before checking its pot, saucer, and drainage holes. Isolation is useful because it tells you whether activity drops when one source is removed.

Set traps where adults are actually flying

Traps are most useful as a reduction and monitoring tool. Put them beside the suspected source, not across the room where they are convenient to place. A yellow sticky card near a plant can catch fungus gnat adults. A vinegar trap can attract some kitchen flies. A covered trap with a small opening can reduce escape, but it will not replace sanitation.

Never place an open bait trap beside food that is being served, and keep traps away from children and pets. Empty or replace them when they become dusty or full. Record whether the catch declines over several days; one quiet afternoon is not proof that the breeding site is gone.

A close view of a home setup for identifying and managing gnats

How to get rid of fungus gnats in houseplant soil

Start with the least disruptive change: allow the surface of the soil to dry to the depth the plant can tolerate before watering again. Do not apply this rule blindly to seedlings, moisture-loving plants, newly repotted plants, or a plant already wilting from drought. Instead, check the root zone with a finger or wooden stick and learn how quickly that specific pot dries.

Improve drainage if water sits in the saucer, the pot has no drainage opening, or the mix stays wet for many days. Empty the saucer after watering. Reduce the amount of water only if the root ball is actually staying wet; watering a little every day can keep the surface damp indefinitely. A thorough watering followed by an appropriate drying interval is easier to manage than constant sips.

Group plants by similar water needs rather than watering an entire shelf on the same day. Increase air movement around crowded foliage, leave space between pots, and remove dead leaves resting on the soil. These changes make the surface less hospitable without forcing every plant into a dry, bright location.

Use sticky cards to catch adults while the soil-management change works. Adult numbers may fall before the final larvae mature, so keep monitoring after the room appears clear. A visible improvement followed by a second wave usually means the soil stayed wet or another pot was missed.

When to repot and when not to

Repotting is justified when the soil is sour, compacted, infested across the root ball, or staying wet because it has broken down. It is not automatically the best first step for every gnat sighting. Repotting can stress a plant, spread contaminated soil, and create more watering problems if the new container is too large.

If you repot, use a clean pot with a drainage opening and fresh, appropriate potting mix. Remove loose old mix without aggressively tearing healthy roots, wash the old saucer, and isolate the plant while you monitor it. Do not reuse soil from a clearly infested pot in another container. A new pot alone will fail if the plant is immediately overwatered again.

Fungus gnats around a houseplant, showing why the growing medium matters

How to get rid of fruit flies in the kitchen

Build a simple vinegar trap

Pour a small amount of apple cider vinegar into a glass or jar and add a drop of dish soap. The bait attracts some adult fruit flies, while the soap reduces the surface tension so insects that land on it are less likely to escape. Set the trap near the cluster, replace it when it becomes dirty, and use multiple traps if activity is in more than one area.

You can also cover the container with plastic wrap and make a few small holes. The holes help guide insects toward the bait, but this is not a sealed pest-control device. Keep the trap stable, label it if necessary, and remove it when the infestation is under control.

Clean the overlooked food sources

Wash the fruit bowl and inspect produce individually. Throw out damaged items or refrigerate sound fruit. Rinse bottles and cans before placing them in recycling, scrub the inside and underside of the trash container, clean sticky drawer liners, and wipe syrup or juice from counters and cabinet edges.

Check the garbage disposal splash guard, sink overflow, mop bucket, reusable grocery bags, and damp cleaning cloths. A small amount of residue in one of these places can continue producing adults after the obvious fruit has been removed. Keep food sealed while monitoring, especially overnight.

How to get rid of drain flies

Scrub the breeding film instead of relying on chemicals

Remove the drain cover if it is designed to come off, then scrub the inside surfaces and the underside of the cover with a stiff brush and an appropriate cleaner. Follow the cleaner label, ventilate the room, and never mix bleach with ammonia, acids, or other products. Hot water or a drain product may be part of a labelled cleaning routine, but neither substitutes for removing the organic film.

Clean the overflow opening as well as the main drain. A drain can look clear while residue remains in a side channel. Rinse according to the product directions and repeat the inspection after several days. If a drain is slow, smells persistently foul, or activity continues despite cleaning, a plumbing problem may be maintaining the wet breeding site.

Why common gnat remedies fail

Only killing adults: Aerosols and swatting can reduce what you see, but they do not remove eggs and larvae. Use adult control to make the room more comfortable while you correct the source.

Using vinegar for every gnat: Vinegar is bait for some kitchen flies, not a universal lure. It is a poor match for fungus gnats in plant soil and does nothing to scrub a drain.

Watering plants a little every day: Frequent small drinks can keep the surface continuously damp. Water according to the plant, pot, light, and drying rate, then empty the saucer.

Repotting without correcting the routine: Fresh soil becomes another breeding site if it is kept saturated. Pair repotting with a drainage check and a monitoring period.

Pouring harsh products into an uninspected drain: Chemical fumes, damaged plumbing, and dangerous combinations are not worth guessing. Read the label and scrub the residue first.

Moving the problem around: Carrying an infested plant through the house, leaving open compost indoors, or placing a trap far from the source can spread activity or hide the pattern. Isolate, inspect, and monitor.

Prevent gnats from returning

Keep produce and pantry foods covered, empty wet trash promptly, and rinse recycling. Clean drains regularly, run water through rarely used fixtures, and address leaks under sinks or near appliances. Keep compost containers closed and clean any drips around pet bowls or plant-watering stations.

For houseplants, use pots with drainage openings, do not leave water standing in saucers, remove fallen leaves, and let the surface dry as appropriate for each species. Quarantine new plants for a short observation period before placing them beside an established collection. Yellow sticky cards are useful during quarantine because they reveal low-level adult activity before it becomes obvious.

Keep window screens intact and repair gaps around doors if insects are coming from outside. Reduce unnecessary outdoor lights near open doors at night, and remove wet organic debris close to entrances. Prevention is less about making a home sterile than about removing the combination of moisture, food, and shelter that lets a small population grow.

When to call a pest professional

Call for help when biting continues, the insects are not responding to source removal, a leak or plumbing defect cannot be found, or the infestation is widespread in a building. Professional advice is also appropriate when you cannot safely identify the pest, when a vulnerable person is being bitten, or when pesticide use would be difficult to keep away from food, children, or pets.

Before the visit, note where the insects appear, when activity is highest, which traps catch them, and what you cleaned. Keep a photograph or a sealed sample only if it can be collected safely. Do not fog or spray repeatedly before an inspection; those actions may scatter insects and make the original source harder to locate.

Conclusion: remove the source, then monitor

To get rid of gnats in your home, start with the room where activity is strongest and ask three questions: what are they feeding on, where is moisture being held, and where could the next generation be developing? Match the response to the answer. Dry suitable plant soil and isolate pots for fungus gnats, remove fermenting food and use a vinegar trap for fruit flies, and scrub wet drain residue for drain flies.

Then monitor for at least several days. A declining catch and no new activity show that the plan is working; a steady catch means the source is still active or another source was missed. That simple feedback loop is more reliable than adding stronger remedies at random, and it keeps the response focused, safer, and easier to maintain.

Frequently asked questions

What is the fastest way to get rid of gnats in the house?

Remove the likely breeding source the same day, then place a trap beside it. Empty wet trash, seal food, clean spills, isolate damp plants, or inspect drains depending on the room. Traps reduce adult activity, but new gnats can continue emerging until eggs and larvae are no longer supported.

How can you tell fungus gnats from fruit flies?

Fungus gnats are usually dark, delicate flies hovering around damp houseplant soil. Fruit flies are commonly concentrated around ripe produce, recycling, spills, and fermented drinks. If the location is unclear, place a sticky card near plants and a bait trap in the kitchen and compare where adults collect.

Will a vinegar trap get rid of gnats in houseplant soil?

Usually not. Vinegar traps are better matched to some kitchen fruit flies, while fungus gnats develop in moist potting mix. For plant-related activity, let the surface dry as the plant allows, empty saucers, improve drainage, isolate the pot, and use a sticky card to monitor adults.

How long does it take to get rid of an indoor gnat infestation?

You may see fewer adults within a day or two after removing the source and setting traps, but a complete resolution can take longer because immature insects may already be present. Keep the source dry or clean, continue monitoring, and investigate again if new adults remain steady after several days.

When should you call a professional for gnats?

Ask for professional help when activity persists after careful source removal, biting continues, a leak or drain problem cannot be found, or the pest cannot be identified safely. Professional help is especially sensible when pesticides would be difficult to keep away from food, children, pets, or people with sensitivities.

How the "How to Get Rid of Gnats in Your Home" guide is reviewed?

Editorial policyReview board

Written by · Reviewed by LeafyPixels Review Board · Updated September 22, 2026

This "How to Get Rid of Gnats in Your Home" guide was researched and written by . Recommendations in the "How to Get Rid of Gnats in Your Home" guide are checked against multiple independent references before publication.

We prioritize sources that hold up under scrutiny:

  • University cooperative extension bulletins and fact sheets (Penn State, Clemson, UMD, NC State, and similar programs)
  • Botanical garden and horticultural society publications
  • Peer-reviewed plant science and veterinary toxicology references where pet safety matters (including ASPCA Animal Poison Control)
  • Established reference works on indoor plant culture

The LeafyPixels editorial team then reviews the draft for clarity, step-by-step usefulness, and fit with real apartment and home conditions-not ideal greenhouse setups. When guidance changes materially, we update the page and note the revision date.


Sources used

  1. Penn State Extension indoor pest-management guidance (n.d.) Houseplant Insect Pests. [Online]. Available at: https://extension.psu.edu/houseplant-insect-pests (Accessed: 22 September 2026).
  2. University of California Integrated Pest Management fungus gnat guidance (n.d.) Pn7448. [Online]. Available at: https://ipm.ucanr.edu/PMG/PESTNOTES/pn7448.html (Accessed: 22 September 2026).
  3. University of Minnesota Extension fungus gnat guidance (n.d.) Fungus Gnats. [Online]. Available at: https://extension.umn.edu/houseplant-pests/fungus-gnats (Accessed: 22 September 2026).