August 3, 2026• byDaily Gardenery
Those tiny black flies hovering around your houseplants, the ones that scatter every time you walk by, are almost certainly fungus gnats. They’re more annoying than dangerous to most healthy plants, but a bad infestation can stress seedlings and young plants, and let’s be honest, nobody wants a cloud of bugs every time they water. Here’s how to identify them for certain and clear them out completely.
How to Tell If You Have Fungus Gnats
Fungus gnats are small, dark, mosquito-like flies, about 1/8 inch long, with long legs and a single pair of wings. Adults are weak fliers that tend to stay close to the soil surface and scatter in short, erratic bursts rather than buzzing around a room. They’re most active when you disturb the soil, watering, repotting, or even just brushing against the plant.

Two things distinguish them from other common houseplant pests:
- They’re most visible near the soil, not on the leaves. Aphids and spider mites cluster on foliage; fungus gnats live and breed in the top inch or two of damp potting mix.
- The larvae are the real problem. They’re small, clear-to-white worms with black heads, living in the soil and feeding on organic matter, fungi, and — in heavy infestations — fine plant roots.
If you’re not sure what you’re looking at, a yellow sticky trap placed near the soil surface will confirm it within a day or two; fungus gnats are strongly attracted to yellow.
Why You Have Fungus Gnats
Fungus gnats thrive in one specific condition: consistently moist, organic-rich soil. They lay eggs in damp potting mix, and the larvae feed on decaying organic matter and fungi near the surface. The single biggest driver of an infestation is overwatering, or watering on a fixed schedule rather than checking whether the soil actually needs it.

Other common causes include:
- Potting mix that’s high in peat or compost and holds moisture near the surface
- Poor drainage or pots without adequate drainage holes
- New plants or bagged soil that arrived with eggs or larvae already present
- Standing water in saucers beneath pots
How to Get Rid of Fungus Gnats

Step 1: Let the top soil dry out completely
This is the most important step, and skipping it means every other method is just treating symptoms. Fungus gnat eggs and larvae can’t survive in dry soil. Let the top 1–2 inches of soil dry out fully between waterings — for most houseplants, this means waiting until the surface is genuinely dry to the touch, not just cooler-feeling. This alone breaks the breeding cycle for future generations, even though it won’t kill gnats that have already hatched.
Step 2: Use yellow sticky traps for the adults
Yellow sticky traps, placed horizontally on the soil surface or on a stake just above it, catch adult gnats before they can lay more eggs. They won’t solve an infestation on their own, but they dramatically reduce egg-laying while you address the larvae in the soil, and they let you track whether your other methods are working.
Step 3: Treat the soil to kill larvae
A few effective options, roughly in order of how fast they work:
- Mosquito bits or dunks (containing Bti): Bacillus thuringiensis israelensis is a naturally occurring bacterium that specifically targets fungus gnat and mosquito larvae without harming plants, pets, or beneficial insects. Soak mosquito bits in water and use that water to water your plant, or work granules into the top layer of soil. This is the most reliable larvae treatment available to home gardeners.
- Hydrogen peroxide drench: Mix 1 part standard 3% hydrogen peroxide with 4 parts water and water your plant with it as normal. It fizzes on contact with the larvae and kills them on contact, while breaking down into water and oxygen harmlessly for the plant. This needs to be reapplied every time you water until the infestation clears.
- Diatomaceous earth (food-grade): Sprinkled on the soil surface, it dehydrates and kills larvae and adults that come into contact with it, though it’s less effective once soil is consistently damp.
Step 4: Repot if the infestation is severe
If gnats persist after several weeks of dry-outs and treatment, or if you suspect the potting mix itself is heavily infested, it’s worth repotting into fresh, sterile potting mix. Rinse as much of the old soil off the roots as you reasonably can without damaging them, and dispose of the old soil outside rather than in an indoor trash can, where adults can still emerge.
Preventing Fungus Gnats From Coming Back
- Water based on soil moisture, not a schedule. Stick a finger an inch or two into the soil before watering; if it’s still damp, wait.
- Use pots with drainage holes and empty saucers after watering rather than letting water sit.
- Top-dress with sand or fine gravel. A half-inch layer of horticultural sand, pea gravel, or diatomaceous earth on the soil surface makes it much harder for gnats to lay eggs there in the first place.
- Quarantine new plants for a couple of weeks before placing them near your other houseplants, since new arrivals are a common source of infestations.
- Avoid soil with high compost or peat content for plants that are prone to gnat problems, and consider mixing in perlite for better drainage and faster surface drying.
The Bottom Line
Fungus gnats are almost always a moisture problem in disguise. Dry out the soil surface, knock back the adults with sticky traps, kill the larvae with a Bti or peroxide treatment, and adjust your watering habits going forward. Do all four, and most infestations clear up within two to three weeks without needing to toss the plant.
For long-term prevention, review How Often to Water Indoor Plants and Overwatered Plant Symptoms & How to Save Your Plant.
Last modified: October 5, 2026





