Those tiny flies hovering around your kitchen or buzzing near your houseplants are almost certainly one of three species: fungus gnats, fruit flies, or drain flies. Each breeds in a different spot in your apartment, so identifying which one you have is the fastest way to eliminate them. The good news is that all three can be handled without professional help in most cases.
Which Type of Gnat You’re Dealing With
The word “gnat” is a catch-all, but the fix depends entirely on what’s actually flying around. Here’s how to tell them apart:
- Fungus gnats are dark, mosquito-like flies about 1/16 to 1/8 inch long with long segmented antennae and light gray or clear wings. They’re weak fliers and tend to hover close to potted plants rather than zooming around the room. You’ll spot them crawling on soil or resting on nearby walls.
- Fruit flies are tan or brownish with distinctive red eyes. They’re stronger fliers and congregate near fruit bowls, trash cans, recycling bins, and anything fermenting. If they scatter when you approach your kitchen counter, you’re likely looking at fruit flies.
- Drain flies look completely different. They’re fuzzy, moth-shaped, and tend to sit motionless on bathroom or kitchen walls near sinks. They breed in the slimy organic film that coats the inside of drainpipes.
If your gnats cluster near houseplants, start with the fungus gnat section below. If they’re in the kitchen near food, jump to fruit flies. If they’re in the bathroom or near sink drains, focus on drain flies.
Fungus Gnats: The Houseplant Problem
Fungus gnats are the most common apartment gnat, and houseplants are almost always the source. Females lay tiny eggs in moist organic debris or potting soil, and the larvae (small, white, legless worms with shiny black heads) feed on fungi and decaying matter in the top layer of soil. Overwatered plants create the exact damp conditions these gnats need to reproduce, and a single pot can produce dozens of adults within a couple of weeks.
The adults themselves are harmless. They don’t bite, and they’re such weak fliers that they rarely stray far from the pot they emerged from. The real concern is the larvae, which can damage roots in large numbers and keep the cycle going indefinitely as long as the soil stays wet.
Cutting Off the Breeding Cycle
The single most effective thing you can do is let your soil dry out. Fungus gnat larvae need moisture in the top inch or two of soil to survive. Switching to a bottom-watering routine, where you place pots in a tray of water and let the soil wick moisture upward, keeps the surface dry while still hydrating the roots. For most houseplants, allowing the top inch of soil to fully dry between waterings is enough to kill existing larvae and prevent new eggs from hatching.
A physical barrier works well alongside drying. Spreading a 1/4-inch layer of coarse sand or perlite on top of the soil prevents adult gnats from reaching the moist soil beneath to lay eggs. The layer doesn’t stop seeds from sprouting if you’re growing anything, but it does block the gnats. Diatomaceous earth (the food-grade kind) serves the same purpose and also damages the soft bodies of larvae on contact, though it loses effectiveness when wet and needs to be reapplied after watering.
Yellow sticky traps placed near the soil surface catch adults before they can lay more eggs. These won’t solve the problem alone since they don’t touch the larvae, but they reduce the breeding population and give you a visual gauge of how bad the infestation is. If you’re still catching dozens after two weeks of drying out the soil, consider repotting the plant with fresh, sterile potting mix.
Fruit Flies: The Kitchen Problem
Fruit flies breed on ripening or decaying fruit, spilled juice, fermented liquids, and any sugary organic residue. In an apartment, the usual culprits are a fruit bowl with overripe bananas, an uncovered trash can, a recycling bin with empty beer or wine bottles, or a forgotten piece of produce that rolled behind something on the counter. They can also breed in damp mops or sponges that haven’t been wrung out.
Eliminating the breeding source is non-negotiable. No trap will keep up with a fruit fly population that has a steady food supply. Move ripening fruit into the refrigerator, take out kitchen trash daily, rinse recycling containers before storing them, and wipe down counters to remove any sticky residue. Once the food source is gone, the remaining adults live only about a week.
The Apple Cider Vinegar Trap
To catch the adults still flying around, pour about 1/4 cup of apple cider vinegar into a small jar or bowl and add a few drops of liquid dish soap. The vinegar smells irresistibly sweet to fruit flies and draws them in. The dish soap breaks the surface tension of the liquid so the flies can’t land on top and instead sink and drown. Place a trap near each problem area. You should see flies collecting within hours, and the trap stays effective for several days before it needs refreshing. This method specifically targets fruit flies; it won’t do much for fungus gnats or drain flies.
Drain Flies: The Plumbing Problem
Drain flies breed in the gelatinous biofilm that builds up inside sink, shower, and floor drains. This slimy layer of decomposing organic matter is a perfect nursery, and the larvae develop entirely inside the pipe. You can confirm drains are the source by placing a strip of clear tape over the drain opening overnight. If drain flies are breeding below, you’ll find adults stuck to the tape by morning.
Killing drain flies means removing the biofilm they live in, not just flushing adult flies down. A simple home treatment: sprinkle 1/2 cup of baking soda into the drain, pour 1 cup of white vinegar over it, let it fizz and sit for about 10 minutes, then flush with very hot (not boiling, which can damage PVC pipes) water. Do this for every drain in the apartment, including showers and any floor drains you may have. Repeat every few days for two weeks to catch newly hatching larvae.
For heavy buildup, an enzymatic drain cleaner works better than chemical drain openers. Enzymatic formulas contain bacteria that digest the organic film rather than just dissolving a channel through it. A stiff drain brush physically scrubbed inside the drain opening helps too. If drain flies persist after several rounds of cleaning, the biofilm may be deep in the pipe or there may be a slow leak providing moisture somewhere behind a wall, which is a maintenance issue for your landlord.
Preventing Gnats From Coming Back
Most apartment gnat infestations come down to three things: moisture, organic matter, and access. Controlling all three makes reinfestation unlikely.
For moisture, avoid overwatering plants, fix dripping faucets promptly, and don’t leave standing water in saucers, pet bowls (refresh daily), or mop buckets. For organic matter, store produce in the fridge once it starts ripening, keep trash sealed, clean drains on a monthly schedule, and don’t let damp kitchen sponges sit overnight. For access, make sure window screens are intact. Fungus gnats and fruit flies are small enough to pass through damaged screens, and they’re attracted to light.
If you’ve just brought home a new houseplant, quarantine it away from your other plants for a week or two. Nursery soil is one of the most common ways fungus gnats enter an apartment. A preventive layer of sand on top of new pots eliminates this risk entirely.
When It’s Your Landlord’s Problem
Pest control responsibility in apartments varies by state, but the general rule is straightforward. If the infestation stems from tenant behavior (leaving food out, not cleaning drains, overwatering plants), the cost of dealing with it falls on you. If the problem predates your move-in, comes from a structural issue like broken plumbing, or results from the landlord failing to maintain the property, the landlord is typically responsible under the implied warranty of habitability that applies in most states.
Drain flies coming from shared plumbing infrastructure, gnats breeding in building-wide trash areas, or infestations that started before your lease began are situations worth raising with your property manager. Check your lease for any pest control clauses, since many leases specify who handles what. Document the problem with photos and dated written communication if you need to escalate it.