To get rid of drain flies in your toilet, you must destroy their breeding ground: the sticky biofilm inside your plumbing. Scrub the bowl, apply a professional enzyme drain cleaner like Invade Bio Drain to eat the sludge, and fix any water leaks. Pouring bleach won’t work because it glides right over the protective biofilm where the eggs hatch.
Identification Guide
Before treating the bowl, confirm you are dealing with drain flies (also known as moth flies or sewer gnats) and not another indoor pest. Look for these visual signs around your toilet:
- Fuzzy appearance: They look like tiny, dark gray or brown moths due to the heavy hairs on their wings.
- Size: They are incredibly small, usually measuring about 1/8 inch in length.
- Behavior: They are weak flyers. They typically rest on bathroom walls, mirrors, or the toilet tank and hop just a few inches when disturbed.
- Crushed marks: When you swat them against the drywall, they leave a dark, powdery smudge behind.
Understanding their fast lifecycle explains why they return so quickly. A female can lay up to 300 eggs in plumbing sludge. These hatch into larvae within 48 hours, feeding on the bacteria in the drain. Within 9 to 15 days, they mature into adult flies, ready to mate and repeat the cycle.

Root Causes
Drain flies don’t just appear out of nowhere; they are a direct symptom of stagnant water and organic buildup. They lay their eggs exclusively in the gelatinous slime (biofilm) that coats pipes and traps human waste, hair, and soap scum.
In toilets, this usually happens under the rim where water flow is weak, or deep in the P-trap if the fixture is rarely used. If you have a guest bathroom or basement toilet that goes weeks without a flush, the water in the trap stagnates and grows bacteria rapidly.
Hard water deposits also play a significant role. Mineral scaling creates a rough, porous surface inside the porcelain trap. This rough texture gives the biofilm a perfect foundation to cling to, making it much harder to flush away through normal toilet use.
Another serious cause is a failing wax ring at the base of the toilet. If sewer gas and moisture are leaking under the floorboards, flies will breed directly in the wet subfloor. If you notice a spike in arachnids hunting these flies around the baseboards, you might want to review our guide on how to get rid of spiders permanently.
Step-by-Step Solution
Forget boiling water and standard household bleach; they only kill the adult flies they touch and leave the eggs unharmed inside the thick sludge. Here is the professional protocol to eradicate the colony at its source.
- Step 1: Deep Clean the Bowl and Rim Start by physically removing as much organic material as possible. Use a stiff toilet brush and a heavy-duty bowl cleaner to scrub the inside of the porcelain. If the bowl has severe hard water rings, carefully use a pumice stone to smooth it out.
Pay special attention to the small water jets under the rim. Use a pipe cleaner or an old toothbrush to dig at least 1 to 2 inches into those jets to break up any hidden mold or bacteria. Flush the toilet twice to rinse away the loosened debris. - Step 2: Apply an Enzyme Gel This is the most critical step in pest control. You need a bacterial enzyme cleaner that digests the organic slime. Pour 4 to 8 oz of a professional product like Bio-Clean or Invade Bio Drain directly down the overflow tube inside the toilet tank. Also, wipe a thick layer of gel tightly under the bowl’s rim.
Do this right before bed so the enzymes can sit undisturbed for at least 8 hours. It is crucial not to flush the toilet during this time; otherwise, you will wash the treatment down the sewer line. Repeat this every night for 5 to 7 days. - Step 3: Treat the Tank and Surrounding Drains Lift the lid off the toilet tank and inspect the water. If you see black mold or sludge on the walls, turn off the water valve, flush to empty the tank, and scrub the interior. Drain flies often commute, so you must treat your bathroom sink and shower drains simultaneously.
While you might use different dry DIY methods for other insects, like applying boric acid for carpenter ants, drain flies require these specific wet biological cleaners to destroy their aquatic habitat. - Step 4: Adult Control While the enzymes destroy the eggs in the plumbing, you can kill the flying adults using an aerosol spray containing Pyrethrins, like PT 565. Spray a quick burst in the bathroom and close the door for 15 minutes.
For an added layer of professional control, apply an Insect Growth Regulator (IGR) like Gentrol IGR behind the toilet tank. This disrupts the life cycle of the flies, causing any surviving adults to become permanently sterile.

Expert Comparison
It’s easy to misidentify small flying bugs in your bathroom. Treating the wrong pest means wasting time and money on the wrong chemicals.
- Drain Flies: Fuzzy, moth-like appearance. Extremely weak flyers. Found strictly near plumbing fixtures, P-traps, and toilets. They breed purely in organic slime.
- Fungus Gnats: Look like tiny mosquitoes with long, dangling legs. They breed in overwatered indoor houseplants and potting soil, not in your plumbing.
- Fruit Flies: Smooth bodies, often featuring bright red eyes. They hover around rotting fruit, indoor garbage cans, or fermented liquids left on the counter.
Pro-Tip: If you’ve used enzyme cleaners for a week and the flies are still swarming the base of your toilet, your wax ring is compromised. Tape over the gap between the toilet base and the floor with masking tape overnight. If flies are stuck to the underside of the tape in the morning, pull the toilet and replace the wax ring immediately before the subfloor rots out.
What to Read Next
If you’re dealing with failing wax rings, plumbing leaks, and hidden moisture issues under your toilet, you might inadvertently attract highly destructive pests that thrive in wet structural wood. Learn to identify the early warning signs before your floorboards collapse in our diagnostic guide on termite damage vs wood rot.
People Also Ask (FAQ)
Will bleach kill drain flies in my toilet?
No. Bleach is largely ineffective against drain flies because it flows rapidly over the slime layer where the eggs and larvae live. The protective biofilm shields the bugs, meaning the bleach only acts as a temporary, surface-level fix that can damage your pipes without solving the root infestation.
Can drain flies come up through the toilet trap?
Yes, but it’s rare if the toilet is used regularly. The water barrier in the P-trap normally blocks sewer gases and insects. However, if the toilet sits unused for weeks and the water level drops by just a few inches, the trap dries out, giving sewer flies a direct flight path into your bathroom.
Is it safe to pour boiling water in a toilet to kill bugs?
Absolutely not. Never pour boiling water (around 212°F) into a cold porcelain toilet bowl. The extreme and sudden temperature shift can cause the porcelain to crack instantly, resulting in catastrophic water damage and a very expensive plumbing replacement. Stick to chemical treatments.
Why are there tiny worms in my toilet bowl?
If you see tiny, black or brown worm-like creatures swimming in the bowl, you are looking at drain fly larvae. They thrive in the anaerobic environment of the plumbing P-trap. Seeing larvae confirms the infestation is actively breeding deep within the pipes.