If you keep swatting tiny black flies near the shower drain or hovering around the toilet, you are almost certainly dealing with drain flies, not true gnats. Figuring out how to get rid of gnats in my bathroom starts with correctly identifying which insect you have, because drain flies, fruit flies, and fungus gnats each demand a different treatment. Get the diagnosis right and you can clear the infestation in 7 to 10 days using under $30 in supplies.
Part of our Bathroom Remodeling & Flooring guide — explore the full guide →
Identify What You Actually Have
True gnats rarely live in bathrooms. The fuzzy, moth-like fliers near the shower are drain flies (Psychodidae), about 1/8 inch long with heart-shaped wings held over the body like a tent. Fruit flies are tan with red eyes and prefer kitchens but visit bathrooms with damp organic matter. Fungus gnats are slim and dark, usually traced back to overwatered houseplants on the bathroom counter.
Tape a 3-by-5 inch piece of clear packing tape, sticky side down, across the drain overnight. Drain flies emerging from the trap will stick to it, confirming the source within 12 hours.
Clean the Source First
Spraying adult flies is pointless if the larvae keep hatching. Drain fly larvae live in the gelatinous biofilm that builds inside P-traps, tub drains, and overflow holes. You have to physically remove that biofilm, then keep it from rebuilding.
Pour 2 cups of boiling water down the affected drain. Follow with a stiff metal drain brush, the kind with bristles 18 to 24 inches long, available at any hardware store for $8 to $12. Scrub the inside of the drain pipe vigorously for 60 seconds. Repeat with the sink overflow opening using a smaller pipe brush.
The Enzyme Cleaner Treatment
Bleach and chemical drain openers like Drano kill larvae on contact but do not break down the biofilm itself, so the problem returns. Enzyme-based bio-cleaners are the contractor-grade solution. Look for products like Bio-Clean, Earthworm Drain Cleaner, or Green Gobbler Drain Foamer. Expect to pay $15 to $25.
Use the foaming version for vertical pipe walls. It clings to the surface for several minutes while live enzymes digest organic matter. Apply at bedtime so the product works undisturbed overnight. Repeat every other night for one week, then once weekly for maintenance.
Trap the Adult Flies
While treatment runs, capture adults to break the breeding cycle. Two traps work well:
- Apple cider vinegar trap: half a cup of ACV plus 3 drops of Dawn dish soap in a small bowl, covered with plastic wrap pierced with pencil-tip holes. Place on the counter near the source.
- Yellow sticky cards: Hot Shot or Trappify cards run about $1 each. Stick them within 12 inches of the drain or affected plant.
Within 72 hours you should see a sharp drop in adult sightings. If you do not, the source is misidentified, often in a secondary drain you have not treated.
Check Hidden Breeding Sites
Bathrooms have more standing water than people realize. Walk through this checklist:
- Toilet tank, especially if leaking into the bowl through a worn flapper.
- Sink overflow holes, which almost never get cleaned.
- Tub drains under removable stoppers, with hair and soap buildup beneath.
- Floor drains in older homes, often dried out and harboring biofilm in the trap.
- Loose toilet base, where seepage saturates the subfloor.
If a floor drain has gone dry, pour a quart of water plus a tablespoon of mineral oil down it. The oil floats on top and slows evaporation, keeping the trap sealed against sewer gases and breeding flies for several weeks.
The Houseplant Question
If you keep pothos, ferns, or peace lilies in the bathroom, fungus gnats are a likely culprit. Their larvae live in moist potting soil. Let the top 1 to 2 inches of soil dry completely between waterings, then drench with a Bacillus thuringiensis israelensis (Bti) solution. Mosquito Bits are the common brand at $10 a bag, available at Home Depot. Sprinkle on the soil surface or steep in water for 24 hours before watering.
Yellow sticky cards in the pot catch emerging adults. Most plants resolve in 10 to 14 days with this combination.
Preventing the Comeback
Drain flies and fruit flies recolonize fast if conditions stay right. After clearing the infestation, run boiling water down every bathroom drain weekly, and use a maintenance dose of enzyme cleaner monthly. Replace the toilet flapper if you hear phantom refills, since even small leaks dampen the bowl and feed gnat populations.
Ventilate after showers. Running the bathroom exhaust fan for 20 minutes after each shower drops humidity from 80 percent down to 50 percent or lower, which suppresses biofilm growth. If your fan is undersized, the IRC recommends at least 50 CFM for bathrooms under 100 square feet. Panasonic WhisperCeiling fans at $130 to $180 are a popular contractor upgrade.
When to Call a Plumber or Pest Control
If you have treated all visible drains, deployed traps for two weeks, and adults still appear, the source may be inside the wall. A broken vent stack, a cracked drain line in a wet wall, or sewage leaking under a shower pan can sustain populations indefinitely. A licensed plumber can run a camera inspection for $200 to $450 to confirm.
Pest control companies like Terminix or Orkin charge $150 to $300 for a targeted bathroom treatment, often combined with an IGR (insect growth regulator) like Gentrol that prevents larvae from maturing. For most homeowners, though, the DIY route resolves the issue without a service call.
What Does Not Work
A few popular remedies make almost no difference. Pouring boiling water alone clears nothing without follow-up enzyme treatment, because the biofilm rebuilds within days. Spraying adult flies with aerosol kills the visible ones but does nothing about the larvae continuing to hatch in the drain. Bleach alone disinfects the surface but does not break down the organic film. Skip these unless paired with a real source treatment.
Old wives’ remedies like coffee grounds, salt, or cinnamon down the drain have no measurable effect according to entomology research. Save the time and use enzyme cleaner correctly. The 7 to 10 day timeline assumes consistent treatment, not weekend warrior attempts spaced two weeks apart.