How to Get Rid of Gnats Indoors

Gnats indoors are almost never a mystery. Something is rotting, or wet, or both – and gnats found it before you did. They’re not wandering in from outside looking for adventure. They’re breeding somewhere in your house right now, probably in a place you haven’t thought to look. The good news is that eliminates the source, and the population collapses on its own. The bad news is that the source is sometimes gross.

The mistake most people make is reaching for a spray first. You can kill every gnat you see and a fresh batch will emerge from the drain or the potting soil within days. Fix the source, then deal with the ones already flying. In that order.

Breeding Source Elimination

This is where the infestation actually lives. Every gnat you’re swatting hatched from somewhere damp and organic, and until you deal with that spot, you’re in a loop.

Check for hidden breeding spots first – fruit flies and fungus gnats hide in places most people never think to look. A potato going soft at the back of a cabinet. The sediment at the bottom of a recycling bin. The drip tray under a plant that’s been sitting in standing water for two weeks. These are gnat nurseries.

Remove decaying organic matter as soon as you find it. Don’t investigate it – throw it out. Old produce, coffee grounds sitting in an open compost bucket, that sad bag of onions you forgot about.

Eliminate standing water wherever it’s sitting. Plant saucers, the tray under the fridge, pet water bowls left unchanged. Fungus gnats in particular need consistently damp soil to breed – letting houseplant soil dry out between waterings cuts off their entire lifecycle.

Remove exposed soil indoors if you’re dealing with a fungus gnat problem that keeps coming back. A layer of sand or gravel over the top of potting soil is a physical barrier that female gnats can’t penetrate to lay eggs. Simple and effective.

Wipe up moisture around sinks, under appliances, and along windowsills. Gnats don’t need a flood – a persistent damp patch on the cabinet floor under the sink is enough.

Sanitation and Food Control

Once the breeding sites are gone, the goal is making your house less attractive in general.

Keep food packaging tightly closed. Open bags of flour, loose fruit on the counter, half-eaten items left out – these are feeding stations. Move produce to the fridge or sealed containers. The fruit bowl that looked charming in spring is a gnat magnet in summer.

Take out the trash regularly. Not every few days – every day or every other day when you’re dealing with an active infestation. The bag inside is fine; the residue at the bottom of the bin is what attracts them. Wash the bin occasionally, especially in warm months.

Clean drains regularly. Kitchen drains and bathroom drains accumulate a biofilm of organic matter that drain gnats and some fruit fly species will happily breed in for months while you assume the problem is coming from somewhere else. Enzyme-based drain cleaner breaks down the material they’re reproducing in. Boiling water down the drain weekly is a cheap maintenance habit that helps.

Traps and Contact Treatments

For the gnats already airborne while you fix the root causes, traps and sprays reduce the visible population fast.

Sticky traps – the yellow kind – are honest performers. Gnats are attracted to yellow, and a few hung near houseplants, near the sink, or near where you’re seeing activity will catch large numbers within 24 hours. They’re not a long-term solution, but they’re satisfying and they confirm where the problem is concentrated.

Spray vinegar directly at surfaces where gnats are congregating. A diluted apple cider vinegar spray along windowsills and drain edges kills on contact and breaks down the organic residue they’re attracted to. It’s not glamorous but it works.

Use insect repellent sprays around entry points and window frames for persistent pressure from outside. Most indoor gnat problems are breeding indoors, but if you’re near standing water or heavy vegetation outside, a barrier spray at doors and windows reduces incursion.

Exclusion

Gnats are small. They don’t need much of a gap to get in from outside, and if conditions outside are bad (standing water, decomposing organic matter in the yard), you’ll have ongoing pressure regardless of how clean the inside is.

Close windows and doors during peak gnat hours, typically dusk and early evening in summer. Or fit mesh screens if ventilation is needed. A standard fly screen keeps them out while letting air through.

Use basil leaves near entry points and on windowsills. Gnats don’t like the scent. It’s a minor measure and won’t solve a problem by itself, but a pot of basil on the kitchen windowsill is pulling double duty.

Where It Shows Up

Gnats with prevention – the source-focused approach for persistent indoor problems. If you’ve got gnats coming back in the same spots no matter what you try, the root cause is still there. This guide goes deep on finding and eliminating every breeding site, keeping drains clear, and controlling soil moisture in houseplants.

How to get rid of gnats indoors with prevention

Gnats with traps and repellents – the active-management approach for clearing gnats that are already flying around. Covers sticky traps, vinegar sprays, basil, insect repellent barrier treatments, and keeping food sealed to cut off the supply that keeps them coming back.

How to get rid of gnats indoors with traps and repellents