How to Get Rid of Gnats in Your House (DIY Guide)
Tiny flying bugs swarming around your houseplants, fruit bowl, or sink? They're probably gnats — but 'gnat' is actually a catch-all term for several different tiny flies, and figuring out which one you have is the key to getting rid of them.
At a Glance
Difficulty
EasyTime Needed
15–30 minutes
DIY Cost
$0–$15
What You're Dealing With
When people say "gnats," they usually mean one of three things:
- Fungus gnats — Tiny black flies hovering around houseplants. They breed in the damp soil of overwatered plants. This is the most common indoor "gnat."
- Fruit flies — Tiny tan/brown flies near fruit, trash, and drains. We have a separate detailed guide for these.
- Drain flies — Fuzzy, moth-like flies near bathroom drains. We have a separate detailed guide for these too.
This guide focuses primarily on fungus gnats, since they're the most commonly misidentified "gnat" and the one most people are searching for when they Google "gnats in my house."
What You'll Need
- Yellow sticky traps — Small sticky cards on stakes that you insert into plant soil. Fungus gnats are attracted to yellow and get stuck.
- Hydrogen peroxide (3%) — The standard pharmacy kind. Used to kill larvae in soil.
- Sand or decorative pebbles — For topping soil to prevent egg-laying.
- Apple cider vinegar — For trapping adult gnats.
- Dish soap — For vinegar traps.
Step-by-Step Guide
Step 1: Identify Your Gnat
Look at where they're congregating:
- Around houseplants? → Fungus gnats. Continue with this guide.
- Around fruit or trash? → Fruit flies. See our fruit fly guide.
- Near drains, fuzzy and moth-like? → Drain flies. See our drain fly guide.
Step 2: Let the Soil Dry Out
Fungus gnats breed in moist soil. The simplest and most effective step is to let the top 1–2 inches of soil dry out completely between waterings. Most houseplants actually prefer this anyway — overwatering is the #1 killer of houseplants and the #1 cause of fungus gnats.
Stick your finger an inch into the soil. If it's damp, don't water. Wait until it's dry to the touch before watering again.
Step 3: Treat the Soil
Mix one part 3% hydrogen peroxide with four parts water. Water your plants with this solution. The hydrogen peroxide kills fungus gnat larvae in the soil without harming the plant. You'll see some fizzing — that's normal. Do this for 2–3 watering cycles.
Step 4: Trap the Adults
Insert yellow sticky traps into the soil of affected plants. The bright yellow color attracts adult fungus gnats, and they stick to the adhesive. Replace traps when they're full. You can also set out small bowls of apple cider vinegar with a drop of dish soap near plants to catch adults.
Step 5: Prevent Re-infestation
Top the soil of your houseplants with a ½-inch layer of coarse sand, decorative pebbles, or perlite. This physical barrier prevents adult gnats from reaching the soil to lay eggs, breaking the life cycle.
Prevention Tips
- Don't overwater houseplants — This is the cause of 90% of fungus gnat problems. Let soil dry between waterings.
- Use pots with drainage holes — Standing water in pot saucers creates the wet conditions gnats love. Empty saucers after watering.
- Use a soil topper — Sand, pebbles, or perlite on top of soil prevents gnats from reaching the soil to lay eggs.
- Inspect new plants before bringing them inside — Fungus gnats often hitchhike on nursery plants. Check the soil surface for tiny flies before buying or quarantine new plants for a week.
- Store unused potting soil in sealed containers — Open bags of potting soil in garages and sheds can breed fungus gnats.
Common Mistakes to Avoid
- Spraying flying gnats without treating the soil — Killing adults in the air is pointless if larvae are still developing in the soil. The soil is the source — treat it.
- Overwatering because "the plant needs it" — Most houseplants do better slightly underwatered than overwatered. If you have gnats, your plant is almost certainly being watered too often.
- Confusing fungus gnats with fruit flies — They look similar but breed in different places. If your traps near plants aren't catching anything, the flies might be fruit flies breeding in your kitchen. Check both areas.
When to Call a Professional
Gnats virtually never require professional pest control. If your gnat problem persists after trying the steps above, the issue is likely one of these:
- You haven't correctly identified the fly — Make sure you're treating the right species. Fungus gnats, fruit flies, and drain flies all look similar but need different approaches.
- There's a hidden breeding source — An overwatered plant in another room, a slow drain leak, or forgotten produce can sustain gnat populations even when you think you've addressed everything.
- You have phorid flies — These look like fruit flies but breed in decaying organic matter in unusual places (under cracked floor tiles, in wall voids with a moisture leak). If nothing else works, a professional can help identify the source.
Frequently Asked Questions
Do gnats bite?
Fungus gnats and fruit flies don't bite. However, if you're getting bitten by tiny flying insects, you might have biting midges (no-see-ums) or sand flies, which are different and less common indoors. Biting midges are found outdoors near water and are most active at dawn and dusk.
Are gnats harmful to my plants?
Adult fungus gnats don't damage plants, but their larvae feed on plant roots and organic matter in the soil. In large numbers, larvae can damage the root systems of seedlings and young plants. Mature, established plants can usually handle fungus gnat larvae without significant harm.
Will gnats go away on their own?
Only if you stop overwatering and remove their breeding conditions. If the soil stays consistently moist, gnats will keep reproducing. Adult gnats live about a week, but new generations keep emerging from the soil.
Need Professional Help with Gnats?
DIY not cutting it? Describe your pest problem and get matched with licensed professionals in your area.
Get a Free QuoteFind Gnats Exterminators Near You
Browse our directory of licensed pest control professionals who can help with gnats problems.
Search DirectoryRelated DIY Guides
How to Get Rid of Fruit Flies Fast (DIY Guide)
Get rid of fruit flies in your kitchen with simple DIY traps and prevention tips. Learn what attracts them, how to make vinegar traps, and how to keep them away for good.
How to Get Rid of Mosquitoes in Your Yard (DIY Guide)
DIY guide to reducing mosquitoes in your yard. Learn how to eliminate breeding sites, choose repellents, and create a mosquito-free outdoor space.
How to Get Rid of Drain Flies (DIY Guide)
Get rid of drain flies with this easy DIY guide. Learn what causes them, how to clean drains properly, and prevent them from coming back.
This guide is for informational purposes only. Always follow product label instructions and safety precautions when applying any pest control treatment. Last updated: February 2026.