How to Get Rid of Gnats in Kitchen and Bathroom

Those tiny flies swarming your kitchen counter or hovering near your bathroom mirror are almost certainly one of three insects: fruit flies, drain flies, or fungus gnats. Each one breeds in a different spot, which means the fix depends entirely on which type you have. The good news is that all three can be eliminated without an exterminator in most cases, as long as you find and remove their breeding source.

Which Type of Gnat You’re Dealing With

All three species are tiny, generally less than 4 mm long, but they look and behave differently enough to tell apart with the naked eye.

Fruit flies are the most common kitchen culprit. They have round, stout bodies and usually red eyes (though a dark-eyed variety exists). You’ll notice them hovering around fruit bowls, trash cans, and sink drains. They’re attracted to anything fermenting: overripe bananas, spilled juice, beer bottles in the recycling bin, even a damp mop head.

Drain flies are the fuzzy, moth-shaped ones. They tend to rest on bathroom walls near sinks, showers, or toilets. Their wings are broad and held flat, giving them a distinctly different silhouette from fruit flies. If you see them mostly in the bathroom, especially near drains you don’t use often, drain flies are the likely suspect.

Fungus gnats are the ones that look like tiny mosquitoes, with long slender legs and thin dark wings. They live in the soil of houseplants and are drawn to moist potting mix with decaying organic matter. If you have indoor plants and the gnats seem to congregate around them, this is your species.

Why They Love Your Kitchen

Fruit flies don’t need much to establish a colony. A single bruised tomato, a bag of potatoes in the pantry, or a few drops of wine in an unwashed glass can become a breeding site. They’re especially drawn to the wet bottoms of trash cans where plastic liners have leaked, recycling bins with unrinsed containers, and debris trapped under kitchen appliances. Spilled syrup or juice in crevices behind the stove or under the fridge is a classic hidden source.

The garbage disposal is another frequent offender. Food scraps accumulate inside the splash guard and along the interior walls, creating a layer of decaying organic matter that fruit flies and phorid flies (a less common but similar-looking species) use as a nursery. Phorid flies specifically breed in moist decaying material of all kinds, including old onions or potatoes, food that has rolled under appliances, and the inner lining of compost bins.

Why They Love Your Bathroom

Bathroom gnats are almost always drain flies. Their larvae develop in the thin layer of slimy buildup, called biofilm, that coats the inside of drain pipes. This gunk is made of soap scum, body oils, bacteria, and fungi. Larvae feed on it and pupate inside it, which means the breeding ground is hidden inside your plumbing.

The worst drain fly infestations happen in drains that are used infrequently. A guest bathroom shower drain, a floor drain in the basement, or even the overflow hole in a bathroom sink can collect stagnant water where larvae thrive. Leaky pipes and dripping faucets create the same conditions: dark, wet spots where organic matter builds up undisturbed. Sink drains, toilets, tub drains, and leaky shower pans are all potential breeding sites.

An ongoing infestation that persists even after you’ve thoroughly cleaned every visible drain can signal a broken pipe or leak under a slab or in a crawlspace beneath your home. That’s the point where a plumber, not a pest control company, is the right call.

How to Find the Breeding Source

Killing the adults you see flying around is pointless if the larvae keep hatching. The single most important step is locating where they’re reproducing.

For fruit flies, start with the obvious: any exposed produce, open containers, or wet organic waste. Then check less obvious spots. Pull out the fridge and stove to look for fallen food. Inspect the underside of trash can lids and the can itself for sticky residue. Check the drain strainer in your kitchen sink and the inside of the garbage disposal splash guard.

For drain flies, a simple overnight test works well. Place a strip of clear tape over a suspect drain before bed, sticky side down, leaving small gaps so air still flows. If drain flies are breeding below, newly emerged adults will get stuck to the tape by morning. Test every drain in your bathroom, including the overflow hole in the sink.

For fungus gnats, press raw potato chunks into the soil of your houseplants. After a few days, pull them out and check for small translucent larvae. This tells you exactly which pots are infested.

Eliminating Kitchen Gnats

Remove every potential food source first. Refrigerate or discard overripe produce. Take out the trash and scrub the inside of the can. Rinse all recyclables before they go in the bin. Wipe down counters, clean under appliances, and run the garbage disposal with a cleaning brush or ice and salt to knock debris off the interior walls.

While you’re removing breeding sites, a simple trap helps knock down the adult population. Fill a small jar with about a quarter cup of apple cider vinegar and add a few drops of liquid dish soap. The vinegar attracts the flies, and the soap breaks the surface tension so they sink and drown instead of landing and flying away. Punch a few small holes in the lid (or cover with plastic wrap and poke holes) to let flies in but make escape difficult. Place one near the sink and one near the trash can.

These traps are surprisingly effective, but they only catch adults. If you haven’t removed the breeding source, new flies will keep emerging.

Eliminating Bathroom Drain Flies

The target is the biofilm inside your pipes, and this is where a lot of common advice falls short. Pouring bleach down the drain kills adult flies on contact but does not penetrate the biofilm layer where larvae live. The biofilm has a protective structure that resists chemical penetration, so new adults emerge within days. Boiling water has the same limitation: it cools rapidly as it travels through the pipe and contacts only a fraction of the buildup.

Enzymatic drain cleaners are a step up because they’re designed to digest organic matter, but they work slowly and rarely eliminate the entire biofilm in a single treatment. They require repeated applications over days or weeks, and in long pipe runs, the cleaner applied from the drain opening simply can’t reach the full extent of the colony.

The most effective approach combines mechanical and biological methods. Use a stiff drain brush to physically scrub the inside of the pipe as far as you can reach, breaking up the biofilm. Follow up with an enzymatic cleaner, repeating every few days for at least two weeks. For drains you rarely use, simply flushing them with water regularly prevents stagnant conditions from developing in the first place.

Eliminating Fungus Gnats in Houseplants

Overwatering is the root cause of nearly every fungus gnat problem. The larvae need consistently moist soil with decaying organic matter to survive, so the simplest fix is letting the top inch or so of soil dry out completely between waterings. Improving drainage by mixing perlite or sand into the potting mix also helps.

For active infestations, a biological soil drench is the most reliable treatment. Products containing Bti (a naturally occurring bacterium toxic only to fly larvae) are widely available at garden centers under names like Mosquito Bits and Gnatrol. Mix them with water and pour through the soil as a drench. Because Bti doesn’t reproduce or persist indoors, you’ll need to reapply every five days or so until the infestation clears.

Another effective option is beneficial nematodes, specifically the species Steinernema feltiae. These microscopic organisms actively hunt fungus gnat larvae in the soil, and because they reproduce on their own, they can provide ongoing control after a few initial applications. They work best when soil temperatures are between 60 and 90 degrees and the soil stays moist.

For a low-tech monitoring tool, yellow sticky traps placed near the soil surface catch adult gnats and help you gauge whether the population is declining. The raw potato chunk method doubles as both a detection tool and a trap: the larvae are strongly attracted to the potato, so you can remove infested chunks every few days and replace them with fresh ones to gradually pull larvae away from plant roots.

When the Problem Won’t Go Away

If you’ve cleaned every drain, removed all exposed food, dried out your plant soil, and the gnats keep coming back, the breeding source is somewhere you haven’t found yet. In kitchens, check for a slow leak under the sink that’s keeping the cabinet floor damp, or food debris trapped in the seal of a dishwasher door. In bathrooms, a recurring drain fly infestation despite thorough cleaning points to a plumbing issue: a cracked pipe, a leak under the slab, or a compromised shower pan creating a hidden wet zone where biofilm thrives out of reach.

A plumber with a camera inspection can identify pipe damage that no amount of drain cleaning will fix. In older homes with cast iron drain lines, interior corrosion creates rough surfaces where biofilm accumulates much faster than in smooth PVC pipes, making drain fly problems chronic until the pipe is lined or replaced.