What Causes Drain Flies: Diagnosis, Fixes, and Prevention
Learn what causes drain flies, how to diagnose infestations, and practical steps to clean drains, prevent future outbreaks, and protect your home from recurring pests.

Drain flies are tiny moth-like insects drawn to organic buildup in drains. The most common cause is a biomass film in the plumbing—biofilm in the P-trap, slow-running lines, or hidden leaks that keep drains moist. Quick fixes: flush with boiling water, scrub the trap, run an enzyme-based cleaner, and repair leaks; repeat if needed and maintain dry, sealed drains to prevent re-infestation.
What causes drain flies
Drain flies, also known as sewer gnats, are small, moth-like insects that congregate around damp, organic-rich environments. The core answer to the question what causes drain flies is simple: growth-friendly material in your drains becomes a breeding ground. According to Drain Guide, unresolved biofilm in a P-trap, slow-draining lines, and leaks that leave standing water create perfect conditions for eggs and larvae. When adults emerge, they’re drawn to moist areas near sinks, showers, and floor drains. The first clue is a swarm of tiny flies near a drain, often accompanied by a musty odor. A quick survey of your most-used drains will reveal the likely culprits: film from soap, hair, food particles, and organic waste that hasn’t been flushed away. If you don’t address the underlying film, any solution will be temporary.
Common breeding sites in homes
Drain flies thrive where organic matter accumulates and moisture stays high. Typical breeding sites include kitchen and bathroom sink drains, garbage disposal lines, shower and tub traps, basement floor drains, and even laundry sink lines. Plumbing vents can also play a role if sewer gases stagnate and create hidden breeding areas. Leaks behind walls, clogged P-traps, and old pipes with micro-cracks hold damp residues that support larvae. Standing water is a magnet for these gnats. Regular inspections and cleaning can drastically reduce breeding opportunities. For most homeowners, addressing these sites with routine maintenance is the single most effective prevention step.
How to confirm an infestation and what to check first
Before diving into deep cleaning, confirm you have drain flies and not another insect. Look for tiny, grayish flies near drains, especially at dusk. Check for small larvae in the drain or the P-trap under the sink. Inspect for standing water, damp walls, and musty smells that indicate organic buildup. If you spot a cluster around multiple drains, you likely have a breeding ground somewhere in the plumbing. Start with the most-used drain first, then move to other suspected sites. Quick, early confirmation helps you choose the right cleanup method and prevents misidentification with fruit flies or phorid flies.
Quick actions to reduce activity tonight
If you notice drain flies tonight, take immediate steps to curb breeding. Boil a pot of water and slowly pour it down the affected drains to melt away organic film. Scrub the inside of the P-trap with a bottle brush to remove buildup. Follow with an enzyme cleaner designed for drains, and let it sit as directed. Make sure no standing water remains in the trap and that the P-trap still contains water to block gases. Finally, cover drains temporarily (with a drain stopper or damp cloth) to reduce adult access while you clean other sites. These steps are fast and practical and can dramatically reduce adult activity within hours.
Long-term prevention and maintenance plan
Root out the cause by establishing a maintenance routine that targets organic buildup and moisture. Schedule monthly drain cleanings using enzyme-based cleaners instead of harsh chemical drains. Clean the P-trap regularly to remove hair and food particles and ensure it holds a continuous water seal. Repair leaks promptly, fix any drain clogs early, and ensure drains have proper slope to prevent standing water. Keep humidity in bathrooms and laundry areas under control, and install screens or mesh over rarely used drains in basements to deter sewer gnats. If you have persistent problems, inspect the main sewer line for cracks or a broken vent stack, which may require a professional inspection.
When to call a professional and safety notes
If DIY steps fail after a thorough cleaning and you still see adult drain flies, it’s time to call a licensed plumber or pest professional. A pro can diagnose hidden breeding sites, assess venting, test for sewer gas intrusion, and check for structural issues in the sewer line. Safety: avoid mixing chemical drain cleaners with other products; use enzyme-based cleaners when possible. Wear gloves and eye protection during scrubbing and dispose of contaminated rags safely. Prevention is cheaper than repeated treatments, so invest in a good routine and address leaks quickly. Drain Guide’s team emphasizes that professional help is prudent for ongoing infestations or suspected structural issues.
Steps
Estimated time: 60-120 minutes
- 1
Identify affected drains
Scan all sinks, tubs, and floor drains for activity. Note which drains are most active and backtrack to likely breeding sites.
Tip: Document findings with photos to track progress. - 2
Shut off and prepare
Clear the area and remove items around the drain. Put on gloves and eye protection before scrubbing.
Tip: Keep a trash bag handy for contaminated rags. - 3
Clean the P-trap
Remove the P-trap if accessible and scrub out hair, soap scum, and organic debris. Rinse thoroughly before reassembly.
Tip: Inspect for cracks or leaks while disassembling. - 4
Boil and flush
Boil water and slowly pour down the drain to help melt buildup. Flush with hot water multiple times if needed.
Tip: Do not pour boiling water into PVC pipes if unsure of material. - 5
Apply enzyme cleaner
Pour an enzyme-based cleaner into the drain and let it sit per label instructions to digest organic matter.
Tip: Enzyme cleaners take time—don’t rush the waiting period. - 6
Test and maintain
Run water through the system for several minutes and monitor for flare-ups. Refill traps as needed and address any leaks.
Tip: Schedule monthly maintenance to prevent recurrence.
Diagnosis: Visible drain flies in kitchen or bathroom
Possible Causes
- highOrganic buildup in the drain (biofilm)
- mediumStanding water due to leaks or improper slope
- lowOpen plumbing vent allowing breeding in sewer line
Fixes
- easyFlush drains with boiling water and scrub the trap; use a bottle brush to remove visible film
- easyRun an enzyme-based drain cleaner to digest organic film; avoid harsh chemical cleaners
- mediumRepair leaks and ensure traps have water and proper slope; address venting if needed
Got Questions?
What are drain flies and why do they appear?
Drain flies are tiny insects that breed in damp, organic films inside drains. They appear when biofilm builds up and provides food and moisture for larvae. Regular cleaning and moisture control reduce their presence.
Drain flies are tiny insects that breed in damp drains. They show up when biofilm builds up; cleaning and moisture control help.
Can drain flies spread disease?
While not a direct health hazard, drain flies indicate unsanitary conditions and possible contamination in drainage areas. Cleaning the drains and preventing breeding reduces any risk.
They’re more of a nuisance than a disease threat, but they signal unsanitary drain conditions. Clean drains to reduce risk.
Will boiling water kill drain flies?
Boiling water can kill some adults and help loosen debris, but it won’t eliminate larvae or address deeper biofilm. Combine with scrubbing and enzymatic cleaners for best results.
Boiling water helps but isn’t enough alone; pair with scrubbing and enzymatic cleaners.
How long does it take to get rid of drain flies?
Resolution depends on the severity. A thorough cleanup plus maintenance can reduce activity within days, but persistent infestations may take weeks and professional inspection.
It varies; you can see reductions in days, but larger problems might take weeks.
Can drain flies come from outside the home?
Yes, they can appear if sewer lines or external drains are exposed and breeding. Focus on interior drains first, but inspect exterior lines if infestations persist.
They can originate from outside if external drains breed; check interior drains first.
Watch Video
The Essentials
- Identify the primary breeding site and address organic buildup.
- Use enzyme cleaners and maintain a dry, sealed drain when possible.
- Regular maintenance prevents recurrence and reduces DIY time.
- Call a professional for persistent or hidden issues.
