Those tiny flies hovering around your bathroom sink or shower are almost certainly breeding inside your drains. The slimy buildup that coats the inside of pipes creates a perfect nursery for several species of small flies, and the warm, humid conditions in a bathroom keep the cycle going. The good news: once you eliminate the breeding site, the problem resolves quickly because these insects have short lifespans.
What Kind of Gnats Live in Bathrooms
The most common culprit is the drain fly, a fuzzy, moth-shaped fly about 1/8 inch long that tends to rest on walls near sinks and showers. They’re weak fliers and often just hop short distances when disturbed. You might also see fungus gnats, which look more like tiny mosquitoes with long, segmented antennae and slender legs. Fungus gnats are about 1/16 to 1/8 inch long with light gray or clear wings, and they’re drawn to light, so you’ll often spot them near bathroom windows. A third possibility is phorid flies (also called humpback flies), which are slightly more active and tend to run across surfaces rather than fly.
All three share something in common: their larvae need moist organic matter to survive. In a bathroom, that means the biofilm inside your pipes.
Why Your Bathroom Drains Are the Problem
The inside of a bathroom drain collects a slimy layer of hair, soap scum, skin cells, bacteria, and fungi over time. Female drain flies lay their eggs directly on the surface of this biofilm. The larvae hatch in less than two days at room temperature and spend the next nine to 15 days feeding on the decaying organic matter, bacteria, and grease in that slime. They actually breathe by extending tiny tubes through the biofilm’s surface. After a brief pupal stage lasting one to two days, adults emerge. The full cycle from egg to adult takes about 21 to 27 days, and it speeds up in warmer conditions.
The specific spots where larvae thrive include:
- Sink drain traps and the inner walls of the sink basin
- Shower and bathtub drains, especially under the drain cover
- Overflow holes and pipes in sinks and tubs, which trap moisture and organic matter in hidden channels
- Along pivot rods and under stoppers in pop-up sink drains
- The base of the toilet tank, particularly if there’s a slow leak
- Leaking pipes behind walls or under floors, where wet organic debris accumulates out of sight
Overflow holes are an overlooked hotspot. Most bathroom sinks have a small hole near the rim designed to prevent flooding. The pipe behind that hole rarely gets cleaned and stays perpetually damp.
How to Confirm the Source
Before treating anything, verify which drain is producing the flies. Coat the inside of a clear plastic cup or glass jar with petroleum jelly or vegetable oil, then place it upside down over a suspected drain overnight. You can also tape a clear plastic bag or a strip of clear packing tape (sticky side down) over the drain opening. Any adults emerging from the pipe will get trapped. Check each drain in your bathroom this way for a couple of nights. This test pinpoints the exact breeding site so you’re not guessing.
Cleaning the Drain to Kill Larvae
Killing adult gnats does nothing if the breeding site stays intact. The biofilm inside the pipe is what sustains the population, so removing it is the only real fix.
Start mechanically. Remove the drain cover and pull out any visible hair or debris. A small drain brush or a zip-strip drain cleaner tool (a long, flexible plastic strip with barbs) works well for physically scrubbing the pipe walls. This step matters more than any liquid treatment because the biofilm clings to pipe surfaces and resists rinsing alone.
After brushing, flush the drain with very hot water. Some people use boiling water, though very hot tap water is safer for PVC pipes. A common DIY approach is to pour half a cup of baking soda into the drain, follow it with one cup of white vinegar, let the mixture fizz for about 10 minutes, then flush with hot water. The fizzing action helps loosen organic residue, though it works best as a follow-up to manual cleaning rather than a standalone fix.
Enzyme-based drain cleaners are a step up from baking soda. These products contain bacteria or enzymes that digest the organic matter coating the pipes over several applications. They’re generally safe for all pipe types and work well for ongoing maintenance. Use them according to the label directions, typically once every week or two, until you stop seeing adults.
Don’t forget the overflow hole. Pour your cleaning solution into that opening as well, or use a small bottle brush to reach inside it.
Trapping the Adults
While you’re eliminating the breeding site, trapping adults prevents them from laying new eggs. A simple and effective trap: fill a small jar or bowl with about 1/3 cup of apple cider vinegar and 2 tablespoons of water, then add a single drop of liquid dish soap. The vinegar attracts the gnats, and the soap breaks the surface tension so they sink and drown instead of landing and flying away. Place one near each problem drain.
A variation that works well is to cut a plastic bottle in half, invert the top portion into the bottom like a funnel, and tape the seam. Pour the vinegar mixture inside so it sits close to the funnel opening without touching it. Gnats fly in and can’t find their way back out.
These traps won’t solve the problem alone, but they reduce the adult population while your drain cleaning takes effect. Since the full lifecycle runs three to four weeks, expect to maintain traps for at least that long.
Preventing Gnats From Coming Back
Bathroom gnats are a moisture and hygiene problem, so prevention comes down to keeping drains clean and your bathroom dry. The EPA recommends indoor humidity levels between 30 and 50 percent, and no higher than 60 percent. Bathrooms routinely exceed that after showers. Running your exhaust fan during and for 15 to 20 minutes after every shower makes a meaningful difference. If your bathroom lacks a fan, opening a window or using a portable dehumidifier helps.
Check for less obvious moisture sources. Sweating pipes, especially cold-water pipes in a warm bathroom, drip condensation that creates damp spots where gnats breed. Pipe insulation sleeves are inexpensive and solve this. Inspect around the toilet base for slow leaks, and look under the sink for poor pipe connections or cracked fittings. Even a small, steady drip behind a wall can sustain a gnat population indefinitely.
For drain maintenance, flush each bathroom drain with very hot water once a week and use an enzyme-based cleaner monthly. Clean hair out of shower drains after each use with a simple drain screen. Keep wet mop heads, damp rags, and dirty trash cans out of the bathroom, as these also provide breeding habitat. With the organic buildup gone and humidity under control, gnats lose every condition they need to reproduce.