Gnats get into your house through a surprisingly small number of routes: they fly in through gaps and screens, they hitch rides on produce you bring home from the store, and they breed in moisture sources already inside your home like drains and houseplant soil. In many cases, the gnats you’re seeing didn’t enter from outside at all. They hatched indoors.
The word “gnat” is a catch-all for several different tiny flies, and each type gets in a different way. Understanding which one you’re dealing with tells you exactly where to look and what to fix.
The Three Types You’re Probably Seeing
Most indoor gnats fall into one of three categories, and each has a distinct source.
Fruit flies are the tan or brownish ones hovering around your kitchen counter, trash can, or fruit bowl. They’re drawn to anything fermenting or overripe. Fungus gnats are darker, more delicate flies that look like tiny mosquitoes. You’ll notice them near houseplants, because their larvae live in moist soil. Drain flies (sometimes called moth flies) are fuzzy, moth-shaped, and tend to hang out near sinks, showers, or floor drains. They breed in the organic sludge that coats the inside of pipes.
Each type has a different entry story, and most infestations involve just one of the three.
They Come Home With Your Groceries
Fruit flies are the most common kitchen gnat, and they often arrive on produce you bought or picked. Tomatoes, melons, grapes, squash, bananas, potatoes, and onions are frequent carriers. The flies lay eggs near the surface of ripening or fermenting fruit, and those eggs or tiny larvae can already be present when you set a bag on your counter.
Cracked or damaged spots on fruits and vegetables are especially likely to harbor eggs. Once inside your warm kitchen, the larvae mature quickly, and a single piece of forgotten fruit can launch a full infestation. Fruit flies are also attracted to any moist, fermenting organic material: a damp sponge, a recycling bin with residue in a beer bottle, a compost pail, or the slime inside a garbage disposal.
The fix is straightforward. Refrigerate ripe produce, cut away and discard damaged portions of fruits and vegetables, and keep counters and bins clean of fermenting residue.
Houseplant Soil Is a Hidden Nursery
Fungus gnats breed in damp potting soil. Their larvae feed on fungi, algae, and organic matter in the top layer of soil, and overwatered plants create the perfect conditions. You can bring them home in a new bag of potting mix or in a plant you just purchased. Adults emerge from the soil surface and fly around your home, often gravitating toward windows and lights.
If your gnat problem is centered around your plants, overwatering is almost always the root cause. Letting the top inch or two of soil dry out between waterings makes the environment inhospitable to larvae. Yellow sticky traps placed near the soil surface catch adults and help you gauge how active the population is.
Your Drains Can Breed Them
Drain flies thrive in pipes and drains that accumulate organic buildup: soap scum, grease, hair, food particles, and the bacterial film that grows on all of it. They’re most common in drains that don’t get used often, like a guest bathroom shower or a basement floor drain, where water sits stagnant in the trap and sludge builds up undisturbed. Sink drains, toilets, tub drains, and leaky shower pans are all potential breeding sites.
In some cases, larvae are introduced from sewer pipes that back up into the home. A persistent infestation that keeps returning despite cleaning every drain can signal a broken pipe or a leak under a slab or in a crawlspace. That scenario is less common, but worth investigating if nothing else works.
Cleaning the organic film out of the drain is the only lasting solution. Pouring bleach down the drain kills what it touches on the surface but doesn’t break up the layer of buildup where larvae actually live. Enzyme-based drain gels designed to digest biofilm are more effective. With consistent treatment, you can expect to see a reduction in flies within two to three days, with full elimination in one to two weeks. If the biofilm returns, so will the flies.
Standard Window Screens Don’t Stop All Gnats
Even with screens in place, some gnats are small enough to walk right through. Most residential window screens use an 18×16 mesh, meaning 18 horizontal and 16 vertical strands per square inch. That creates openings roughly 1/20 of an inch wide. It’s enough to block mosquitoes and house flies, but gnats, no-see-ums, and other insects smaller than 1/16 of an inch can pass through without any difficulty.
Gaps around window frames, torn screens, door sweeps that don’t seal fully, and openings around utility lines or dryer vents also provide easy access. Gnats are attracted to light and moisture, so an open or poorly sealed window near a lit room on a humid evening is essentially an invitation.
Upgrading to 20×20 mesh or finer significantly reduces the opening size. Ultra-fine screens (30×30 mesh or higher) block nearly all small flying insects, though they reduce airflow and clog with dust more quickly. Caulking gaps around windows and doors is a simpler first step that addresses multiple pest entry points at once.
What Keeps Them Reproducing Indoors
The reason a gnat problem feels endless is that you’re not seeing a wave of insects flying in from outside. You’re seeing generations hatching inside your house. Most small flies complete their life cycle in one to three weeks under warm indoor conditions. A single breeding site, whether it’s a wet drain, an overwatered plant, or a forgotten banana, can produce hundreds of new adults in that time.
Gnats need two things to sustain a population indoors: moisture and organic material. Remove either one and the cycle breaks. That means fixing leaky pipes, not letting water pool under plant pots, taking out trash and compost regularly, wiping down counters, and running water through unused drains periodically to flush the trap.
If you’ve cleaned everything obvious and the gnats persist, look for less visible sources. A potato that rolled behind a bin, a spill under the refrigerator, a slow leak under the sink, or residue in a rarely used drain can sustain an infestation for weeks. Finding and eliminating the breeding site is more effective than any trap or spray, because it stops new gnats from being produced at the source.