How to Get Rid of Tiny Black Flies on Plants

Those tiny black flies hovering around your houseplants are almost certainly fungus gnats, small mosquito-like insects that breed in moist potting soil. They’re one of the most common indoor plant pests, and while the adults are mostly a nuisance, their larvae live in the soil and feed on organic matter and root hairs. The good news: they’re very manageable once you understand what’s driving the problem.

How to Identify Fungus Gnats

Fungus gnats are small, dark-bodied flies about 1/8 inch long with long legs and translucent wings. They look similar to tiny mosquitoes and tend to fly weakly around the soil surface or hover near the base of the plant. You’ll often notice them when you water or disturb the pot, since the movement stirs them up from the soil where they rest and breed.

The adults don’t bite and don’t feed on your plants directly. They’re attracted to moist, organic-rich soil where they lay their eggs. If you’re seeing tiny flies that sit on the leaves themselves rather than flying near the soil, you may be dealing with something different, like whiteflies or shore flies. Fungus gnats are drawn specifically to the soil, not the foliage.

Why They Show Up

Fungus gnats thrive in moist conditions. Consistently damp potting soil is the single biggest factor. Overwatering, poor drainage, and pots without drainage holes all create the exact environment these flies need to reproduce. They lay their eggs in damp organic media, and the larvae feed on fungi, decaying plant material, and fine root hairs in the top layers of soil.

Bagged potting soil can sometimes come with eggs or larvae already present, especially if the bag has been sitting open or stored in humid conditions. Bringing new plants home from a nursery or garden center is another common way fungus gnats enter your home. Once a few adults arrive, the population can build quickly because their lifecycle is fast: at room temperature (around 75°F), a new generation can go from egg to reproducing adult in roughly 17 days. Eggs hatch in about 3 days, larvae develop over 10 days, and adults emerge after a 4-day pupal stage.

Can They Hurt Your Plants?

A small number of fungus gnats won’t cause visible damage to a healthy plant. The larvae mainly feed on soil fungi and decomposing organic matter. But when populations get large, larvae can start chewing through fine root hairs, which weakens the plant’s ability to take up water and nutrients. Young seedlings and cuttings are especially vulnerable because their root systems are small and delicate.

Signs of a heavy infestation include unexplained wilting despite adequate watering, yellowing leaves, and stunted growth. These symptoms mimic overwatering, which makes sense since the same soggy conditions that cause root problems also attract the gnats in the first place. If you’re noticing both flies and declining plant health, the larvae are likely part of the problem.

Dry Out the Soil First

The most effective first step is also the simplest: let the soil dry out between waterings. Fungus gnat eggs and larvae need consistent moisture to survive. Allowing the top inch or two of soil to dry completely before watering again makes the environment hostile to every stage of their lifecycle. This alone can break a mild infestation.

Switching to bottom watering helps reinforce this. Instead of pouring water over the surface, set the pot in a tray of water and let the soil absorb moisture from below. The top layer stays dry, which discourages adult females from laying eggs there. It takes a bit longer, but it’s one of the most reliable preventive habits you can build.

Trapping the Adults

Yellow sticky traps placed near the soil surface catch adult gnats effectively. The flies are strongly attracted to the yellow color and get stuck on contact. Sticky traps won’t eliminate an infestation on their own since they don’t touch the larvae in the soil, but they reduce the number of adults laying new eggs and give you a clear visual gauge of how bad the problem is. If the traps are filling up quickly, you know the soil still needs treatment.

Treating the Soil

Hydrogen Peroxide Drench

A hydrogen peroxide soil drench is a popular home remedy that works well for mild to moderate infestations. Mix one part standard 3% hydrogen peroxide with four parts water and pour it directly over the soil. The mixture will fizz on contact as it kills larvae. It breaks down into water and oxygen, so it won’t harm your plant’s roots. Let the soil dry out thoroughly afterward before watering again.

BTI (Bacterial Larvicide)

For persistent or heavier infestations, a biological larvicide containing the bacterium BTI is one of the most effective options. BTI is a naturally occurring soil bacterium that produces a protein toxic specifically to the larvae of gnats and mosquitoes. It doesn’t affect plants, pets, or people. You can find BTI sold as granules or liquid concentrate marketed for fungus gnat control. Mix it into your watering routine, applying it every time you water for two to three weeks to catch multiple generations as new eggs hatch.

Beneficial Nematodes

Microscopic predatory nematodes offer another biological control option. These tiny worms actively hunt fungus gnat larvae in the soil, infecting and killing them. They work best as a preventive measure applied to moist soil, but they can also knock back moderate larval populations as a curative treatment. For best results, water the soil the day before applying nematodes so they can move freely through the media. Soil temperatures should be between 60 and 70°F for peak activity, and you’ll want to apply in the evening or on a cloudy day since nematodes are sensitive to UV light and heat. Repeat applications every two weeks until the problem resolves.

Physical Barriers That Prevent Egg-Laying

Once you’ve dealt with the active infestation, a physical barrier on top of the soil can prevent it from coming back. A layer of coarse horticultural sand or fine gravel over the soil surface stops adult gnats from reaching the moist organic material where they lay eggs. Use builder’s sand or horticultural-grade sand with larger particles, not fine beach sand, which can compact and retain moisture. The barrier doesn’t kill larvae chemically, but it breaks the breeding cycle by making the soil surface inaccessible.

Decorative pebbles, aquarium gravel, or even a layer of diatomaceous earth serve a similar purpose. The key is covering the soil completely, including around the base of the stem, so there are no gaps for the flies to reach the soil through. If your pots have drainage holes on the bottom, consider adding a layer of sand beneath the pot as well, since gnats can enter from below if pots sit in saucers of standing water.

Preventing Reinfestation

Fungus gnats are persistent because their lifecycle is so short. A single generation takes just over two weeks in warm indoor conditions, meaning a few survivors can rebuild a population fast. Consistency matters more than intensity when it comes to prevention.

Avoid leaving standing water in saucers. Check new plants carefully before bringing them inside, and consider isolating them for a week or two to watch for signs of gnats. If you repot plants, use fresh, well-draining potting mix, and consider adding perlite or coarse sand to improve drainage and reduce moisture retention. Store unused potting soil in sealed containers rather than leaving bags open where adults can lay eggs.

Keeping the top layer of soil dry between waterings remains the single most important long-term prevention strategy. Combine that habit with a sand barrier on susceptible plants, and fungus gnats rarely become a recurring problem.