Special Offer: Use code ILOVEPLANTS for 25% off on all digital products! Shop Now →

Tiny black flies drifting up every time you water, crawling on the soil or bumping into your screen? Those are almost certainly fungus gnats, the most common houseplant pest. They are annoying, they multiply fast, and they love the same thing many indoor plants get too much of: wet soil.
The good news is that fungus gnats are easy to beat once you target the larvae living in the soil, not just the flies you can see. This guide shows you exactly how to get rid of fungus gnats in 7 simple steps, how long it takes, which home remedies actually work, and how to keep them from coming back.
Short answer: To get rid of fungus gnats, let the top 1 to 2 inches of soil dry out between waterings, catch the adults with yellow sticky traps, and kill the larvae in the soil with a BTi drench (mosquito bits soaked in water) or a diluted hydrogen peroxide drench. Keep it up for 3 to 4 weeks to break the life cycle, then prevent them by watering less, bottom watering and topping the soil with sand.
In this guide
What are fungus gnats?
Fungus gnats are tiny, dark grey to black flies, about 1/8 inch (3 mm) long, with long legs and see-through wings. They are weak fliers, so you usually see them walking on the soil or flying in short, zigzag hops near the pot.
The adults are harmless and only live about a week, but each female can lay 100 to 300 eggs in moist soil. The eggs hatch into tiny white larvae with shiny black heads that live in the top 1 to 2 inches of soil, feeding on fungi, decaying matter and sometimes fine roots. The whole life cycle takes about 3 to 4 weeks, which is why one treatment is never enough.
| Stage | Where it lives | How long |
|---|---|---|
| Eggs | Top layer of moist soil | About 3 days |
| Larvae | Top 1 to 2 inches of soil | About 10 to 14 days |
| Pupae | In the soil | About 3 to 4 days |
| Adults | Flying around the plant, laying eggs | About 7 to 10 days |
Fungus gnats vs fruit flies
Fruit flies are tan with red eyes and hang around the fruit bowl and trash. Fungus gnats are darker, slimmer, with long legs, and hang around your plants and soil. If the flies rise from the pot when you water, they are fungus gnats.
Do fungus gnats harm plants?
For most established houseplants, fungus gnats are more of a nuisance than a danger. But in large numbers the larvae can damage roots, especially on seedlings, cuttings and young plants, causing wilting, yellow leaves and slow growth. Their feeding wounds can also let root diseases in. And a fungus gnat problem is a warning sign: the soil is staying wet too long, which can lead to root rot.
How to get rid of fungus gnats in 7 steps
The secret is to attack both stages at once: trap the flying adults so they cannot lay more eggs, and kill the larvae in the soil. Work through these steps together for 3 to 4 weeks.
1. Let the soil dry out

This is the single most effective step. Fungus gnat eggs and larvae need moist soil to survive. Let the top 1 to 2 inches of soil dry completely before you water again. Push a finger into the soil, and only water when it feels dry at that depth. For plants that like to stay moist, dry just the top inch. Our watering guide explains how to tell when a plant really needs water.
2. Put up yellow sticky traps

Adult gnats are attracted to bright yellow. Stick yellow sticky traps into the soil or lay them flat just above it, one per pot or one for every couple of plants. They catch adults before they lay eggs and also show you how bad the problem is. Replace them when they are full. Traps alone will not solve the problem, because they do not touch the larvae.
3. Kill the larvae with BTi (best treatment)

BTi (Bacillus thuringiensis subsp. israelensis) is a natural soil bacterium that kills fungus gnat larvae but is safe for plants, people and pets. It is sold as mosquito bits or dunks for ponds.
- Soak about 1 to 2 tablespoons of mosquito bits in a gallon of water for 30 minutes (or follow the label).
- Strain or leave the bits in, and use this water for your normal watering.
- Repeat every time you water for 3 to 4 weeks to catch every new batch of larvae.
4. Or use a hydrogen peroxide drench
A quick alternative is hydrogen peroxide. Mix 1 part 3% hydrogen peroxide with 4 parts water and water the plant when the top inch of soil is dry. It fizzes on contact and kills larvae, then breaks down into water and oxygen. Repeat once a week if needed. Test on one plant first, and avoid it on very delicate seedlings.
5. Top-dress the soil with sand or gravel

Cover the soil with a half-inch layer of coarse sand, fine gravel or decorative grit. The surface stays dry, so adults cannot lay eggs and new adults struggle to climb out. Do not use bark or moss as a top layer, because they hold moisture and attract gnats.
6. Try a vinegar trap for adults
Fill a small dish with apple cider vinegar and a drop of dish soap, and set it next to infested plants. Adults are drawn to the smell and drown. It is a helpful extra, but like sticky traps it does not reach the larvae.
7. Repot badly infested plants
If a pot is crawling with larvae, the soil is soggy, or the plant is small, repot into fresh, dry, well-draining mix. Gently remove as much old soil as possible, rinse the roots if needed and use a clean pot. See our repotting guide and potting soil guide for the best mix.
How long does it take? You should see far fewer adults within a week, but it takes 3 to 4 weeks of consistent treatment to break the full life cycle. Keep going even after the flies seem to be gone.
Home remedies: what works and what does not
| Remedy | Does it work? | Notes |
|---|---|---|
| Letting soil dry out | Yes, very well | The foundation of every treatment. |
| Yellow sticky traps | Yes, for adults | Catch flies and show how bad it is; do not kill larvae. |
| BTi (mosquito bits) | Yes, very well | Best larvae killer; safe for plants and pets. |
| Hydrogen peroxide drench | Yes | 1 part 3% peroxide to 4 parts water; repeat weekly. |
| Beneficial nematodes | Yes | Steinernema feltiae hunt larvae; great for large collections. |
| Sand or gravel top layer | Yes, as prevention | Keeps the surface dry so gnats cannot lay eggs. |
| Apple cider vinegar trap | Partly | Catches some adults only. |
| Cinnamon on soil | Little evidence | May slow fungus on the surface, but will not clear an infestation. |
| Neem oil soil drench | Partly | Can reduce larvae but less reliable than BTi. |
How to prevent fungus gnats

- Do not overwater. Water only when the top of the soil is dry. Overwatering is the number one cause.
- Bottom water plants that allow it: set the pot in a tray of water for 15 to 30 minutes so the roots drink while the surface stays drier.
- Use a well-draining mix and pots with drainage holes; empty saucers after watering.
- Store potting mix sealed and dry. Opened bags are a common source of gnats.
- Check new plants before bringing them home, and keep them apart for a week or two.
- Remove dead leaves and debris from the soil surface.
- Water less in winter, when soil dries more slowly. See our winter care guide.
If a plant looks badly damaged, our guide on how to revive a dying houseplant can help. For other bugs like mealybugs, spider mites and scale, see our complete houseplant pests guide.
Are fungus gnat treatments safe for pets?
Most of the methods here are pet-friendly. BTi only affects the larvae of certain flies and mosquitoes and is considered safe around cats and dogs. Keep sticky traps out of reach, because fur and paws get stuck on them, and keep peroxide and vinegar dishes where pets cannot drink them. Looking for plants that are safe too? See our pet-friendly houseplants.
Fungus gnats usually mean the soil is staying wet too long, and that can lead to bigger trouble below the surface.
The Houseplant Rescue Guide matches 26 common plant problems to a clear photo, then gives you simple steps to fix each one and stop it coming back. No jargon, 50 pages, with printable checklists.
Quick action checklist
- Let the top 1 to 2 inches of soil dry before watering.
- Put yellow sticky traps in every affected pot.
- Water with BTi (mosquito bits) water every time for 3 to 4 weeks.
- Or drench with 1 part 3% hydrogen peroxide to 4 parts water weekly.
- Add a half-inch layer of sand or gravel on top of the soil.
- Repot badly infested plants into fresh, dry mix.
- Switch to bottom watering where possible.
- Store potting mix sealed and check new plants.
- Keep treating for 3 to 4 weeks, even after flies disappear.
- Log watering in a printable plant journal to avoid overwatering.
Fungus gnats FAQ
How do I get rid of fungus gnats?
Let the top 1 to 2 inches of soil dry out between waterings, catch adults with yellow sticky traps, and kill the larvae with BTi (mosquito bits soaked in water) or a diluted hydrogen peroxide drench. Keep it up for 3 to 4 weeks to break the life cycle.
What causes fungus gnats in houseplants?
Fungus gnats are attracted to moist soil rich in organic matter. Overwatering, poor drainage, opened bags of potting mix and new plants from the store are the most common sources.
How long does it take to get rid of fungus gnats?
Adult numbers drop within about a week, but it takes 3 to 4 weeks of consistent treatment to kill every stage of the life cycle and fully get rid of them.
Do fungus gnats hurt plants?
Adults are harmless, but large numbers of larvae can damage fine roots, especially on seedlings, cuttings and young plants. A fungus gnat problem also means the soil is staying too wet.
Does hydrogen peroxide kill fungus gnats?
Yes. Watering with 1 part 3% hydrogen peroxide mixed with 4 parts water kills fungus gnat larvae in the soil. Repeat weekly if needed and use traps for the adults.
Will fungus gnats go away on their own?
Rarely. As long as the soil stays moist, they keep breeding. Letting the soil dry out and treating the larvae is the fastest way to get rid of them.
Are fungus gnats the same as fruit flies?
No. Fruit flies are tan with red eyes and gather around fruit and trash. Fungus gnats are darker and slimmer with long legs and live around plant soil.
Sources and further reading
Want to go deeper? These university extension and expert resources cover the same topic:
- UC Statewide IPM Program: Pest Notes: Fungus gnats
- Oregon State University Extension: I have fungus gnats everywhere. Can you help?
- UC Statewide IPM Program: Pest Notes: Houseplant problems (PDF)



