How to Get Rid of Fungus Gnats on Indoor Basil

Fungus gnats on basil are one of the most frustrating problems any herb gardener faces — whether you grow your plants indoors on a windowsill or outside on a patio. These tiny, dark flies look harmless at first glance, but their larvae chew through basil roots and stunt growth in ways that can kill a healthy plant within weeks. The good news is that with the right approach, you can eliminate fungus gnats on basil completely and keep them from coming back. This guide walks you through every step, from identification to long-term prevention.
Table of Contents
What You’ll Need
- Yellow sticky traps
- A moisture meter or your finger (for checking soil depth)
- Bacillus thuringiensis var. israelensis (Bti) — a natural biological larvicide, sold as ‘Gnatrol’ or similar products
- Hydrogen peroxide (3% solution, standard drugstore grade)
- Diatomaceous earth (food-grade)
- Well-draining potting mix
- Neem oil or insecticidal soap
- A spray bottle
- Fine-grit sand or perlite (for a top-dressing layer)
Step 1: Confirm You’re Actually Dealing with Fungus Gnats on Basil
Not every tiny fly hovering around your herbs is a fungus gnat. Shore flies and fruit flies are common look-alikes. Fungus gnats on basil are slender, dark grey to black, and about 2–3 mm long. They have long, dangly legs and clear wings with a distinctive Y-shaped vein — a detail you can spot with a magnifying glass.
The most telling sign is where they congregate. Fungus gnats on basil spend most of their lives in the soil, not in the air. You’ll see adults walking across the soil surface or resting on lower leaves. If you lift the pot and see tiny white worm-like larvae (they have a shiny black head) wriggling in the roots or top couple of inches of soil, you’ve confirmed the problem.
Fruit flies, by contrast, hover near ripe fruit or food scraps and have reddish-brown eyes. Shore flies are stockier and have five white spots on each wing. Correct identification means you’ll choose the right treatment from the start and not waste time on products that won’t work.
Step 2: Understand Why Your Basil Is Attracting Them
Fungus gnats on basil are drawn to two things above all else: moisture and decaying organic matter. Consistently damp potting soil provides the perfect environment for females to lay eggs — a single female can lay up to 200 eggs in her short lifespan. Peat-heavy mixes that hold water for a long time are especially inviting.
Rich potting composts full of bark, coir, or decomposing plant material also feed the larvae directly. This is why fungus gnats on basil appear so frequently when gardeners use standard all-purpose compost without amending it for drainage. Indoor environments make things worse because there are no natural predators, like ground beetles or parasitic wasps, to keep populations in check.
Recognising the root cause — literally — helps you pick the most effective combination of treatments rather than just reacting to the adult flies you can see.
Step 3: Adjust Your Watering Routine Immediately
This is the single most powerful step you can take against fungus gnats on basil, and it costs nothing. Let the top 5–7 cm (roughly 2 inches) of soil dry out completely between waterings. Fungus gnat eggs and young larvae cannot survive in dry soil — they dehydrate and die within a day or two.
Use your finger or a cheap moisture meter to check soil depth before you water. If the top layer is still damp, wait another day. Basil tolerates slightly dry conditions much better than most people think, and a brief dry spell won’t hurt the plant — but it will devastate a gnat population.
Also check that your pot has adequate drainage holes and that you’re not leaving water sitting in a saucer for hours. Standing water underneath the pot keeps the lower soil constantly saturated, which is exactly what fungus gnats on basil need to thrive.
Step 4: Place Yellow Sticky Traps to Catch Adult Gnats
Yellow sticky traps won’t solve a severe infestation on their own, but they serve two critical roles: they dramatically reduce the adult population (which stops new eggs from being laid) and they act as a monitoring tool so you can see whether your other interventions are working.
Push the traps into the soil right at the base of your basil plant, or hang them just above soil level. Adults are weak fliers and spend most of their time close to the ground, so positioning matters. Replace the traps every one to two weeks or when they’re full.
When dealing with fungus gnats on basil, we recommend using at least two traps per medium-sized pot during active infestations. Check trap counts daily. If you see numbers dropping week over week, your combined approach is working.
Step 5: Apply a Biological Larvicide (Bti) to Kill Larvae in the Soil
This is where you go after the real problem: the larvae living in the root zone. Bacillus thuringiensis var. israelensis (Bti) is a naturally occurring soil bacterium that’s toxic to fungus gnat larvae but completely harmless to plants, humans, pets, and beneficial insects like bees. It’s our top recommendation for anyone fighting fungus gnats on basil in an edible herb garden.
Mix Bti products (sold under brand names like Gnatrol or as ‘mosquito dunks’) according to package directions and water your basil with the solution. The larvae ingest the bacteria as they feed through the soil and die within 24–48 hours. You’ll need to repeat applications every 5–7 days for at least three to four weeks to break the full life cycle, which spans about 17–28 days from egg to adult.
Bti is endorsed by university extension programs across the US as one of the safest and most effective options for fungus gnats on basil and other edible plants. It’s widely available at garden centres and online.
Step 6: Use a Hydrogen Peroxide Soil Drench for a Fast Knockdown
If your infestation is severe or you want a faster-acting option while Bti builds up, a hydrogen peroxide drench works well. Mix one part 3% hydrogen peroxide (the standard concentration sold at pharmacies) with four parts water. Water your basil with this solution until it drains out of the pot’s drainage holes.
The hydrogen peroxide kills larvae on contact through oxidation. You’ll notice a slight fizzing in the soil — that’s normal and actually helpful, as it aerates compact soil at the same time. It breaks down quickly into water and oxygen, so there’s no harmful residue left behind.
When managing fungus gnats on basil, don’t use hydrogen peroxide more than twice in a two-week period, as repeated applications can slightly affect beneficial soil microbes. Think of it as a reset, not a routine treatment. Follow up with Bti applications to keep larval populations suppressed.
Step 7: Apply Top Dressings to Block Egg-Laying
Even after you’ve knocked back the larval population, adult fungus gnats on basil will keep trying to lay new eggs if the soil surface is exposed and moist. A physical barrier on top of the soil prevents this. There are two main options worth using.
The first is a layer of coarse sand or perlite, about 1–2 cm deep, spread across the top of the potting mix. Female gnats prefer to lay eggs in soft, moist organic material. Sand and perlite are unattractive to them and also help the soil surface dry out faster after watering.
The second option is food-grade diatomaceous earth (DE). Sprinkle a thin layer across the soil surface. DE is made from fossilised algae with microscopic sharp edges that damage the soft exoskeleton of insects and larvae passing through it. It’s non-toxic to humans and pets, making it well-suited for edible herbs. Reapply after watering, since moisture reduces its effectiveness. Using a top dressing consistently is one of the most underrated strategies for keeping fungus gnats on basil from rebounding.
Step 8: Repot with Fresh, Well-Draining Soil If the Problem Persists
If you’ve followed Steps 1–7 for three to four weeks and fungus gnats on basil are still a serious problem, it’s time to consider a full repot. Some heavily infested soils contain so many eggs and larvae that even diligent treatment can’t fully eliminate them.
Gently remove the basil from its pot, shake off as much old soil as possible, and rinse the roots under lukewarm water. Inspect the roots — healthy roots are white or light tan; damaged roots from larval feeding are brown, mushy, or hollow. Trim away any damaged roots with clean scissors.
Repot into a mix that drains quickly: a blend of standard potting compost, perlite, and a small amount of coarse sand works well. Avoid mixes that are heavily peat-based or that contain large amounts of bark compost, as these stay wet too long and are magnets for fungus gnats on basil. After repotting, begin your Bti treatment cycle from scratch to protect the new soil environment.
For further reading on managing fungus gnats in UK gardens, the Royal Horticultural Society provides solid guidance on identification and biological controls. The UC Davis Integrated Pest Management program also offers detailed guidance on life cycles and control methods.
Common Mistakes to Avoid
- Only targeting adults: Adult fungus gnats on basil are the visible symptom — the larvae in the soil are the real damage-doers. Sticky traps alone won’t fix the problem.
- Overwatering after treatment: Many gardeners reduce watering during treatment, then resume their old habits once adults disappear. Gnats come straight back. Keep letting the top 2 inches of soil dry out as a permanent practice.
- Using neem oil as your only soil drench: Neem oil can deter adults but it’s inconsistent against larvae. Use it as a supplement to Bti, not a replacement.
- Ignoring neighbouring plants: Fungus gnats on basil can spread from other infested pots sitting nearby. Check and treat all plants in the same space at the same time.
- Repotting into the same type of soil: If you repot into a heavy, moisture-retaining mix, you’ve just reset the conditions that caused the infestation in the first place.
- Expecting overnight results: The fungus gnat life cycle takes three to four weeks. Stick with your treatment plan for at least a full month before judging success.
Final Thoughts
Dealing with fungus gnats on basil is genuinely annoying, but it’s a very solvable problem when you tackle all three stages of the pest’s life — eggs, larvae, and adults — at the same time. The most common reason treatments fail is that gardeners focus only on what they can see: the adult flies buzzing around the surface. The larvae feeding silently in the root zone are the real threat to your basil plant’s health.
Combine dry-down watering habits, Bti soil drenches, sticky traps, and a physical top dressing, and you have a complete, chemical-free system that protects an edible herb. Fungus gnats on basil are persistent, but they don’t stand a chance against a consistent, layered approach. Give the plan a full four weeks, stick with better watering habits long-term, and this is a problem you should only ever need to solve once.
If you enjoy keeping your home productive and organised, you might also find our Best Robot Vacuum for Pet Hair guide useful — keeping a clean indoor space is another way to reduce the conditions that attract household pests. And if you work from home near your herb garden, check out our guide to the Best Standing Desk for Small Spaces to make that environment as comfortable as possible.
Frequently Asked Questions
Can fungus gnats on basil actually kill the plant?
Yes, in serious infestations they can. The adults are harmless to the plant itself, but larvae feed on root hairs and young roots, impairing the plant’s ability to absorb water and nutrients. A mild infestation causes yellowing and wilting; a heavy one can kill a basil plant entirely, especially young seedlings with small root systems.
Is it safe to eat basil from a plant that has fungus gnats?
The leaves themselves are generally safe to eat — fungus gnats on basil don’t directly contaminate the foliage with anything harmful. That said, always rinse basil thoroughly before using it. Address the infestation so the plant stays healthy enough to keep producing good-quality leaves.
How long does it take to get rid of fungus gnats on basil?
Expect three to four weeks of consistent treatment. Because the full gnat life cycle lasts two to four weeks depending on temperature, you need to maintain your approach long enough to interrupt every generation. You’ll usually notice adult numbers dropping within the first week if your method is working.
Do fungus gnats on basil spread to other houseplants?
Absolutely. Adults fly freely between pots, and any moist, organic-rich soil is a potential egg-laying site. If you spot fungus gnats on basil, check every other plant in the same room. Treat them all simultaneously, even if only one shows obvious signs — otherwise the population simply cycles between pots and your basil never fully clears.


