How to Get Rid of Gnats
Identify which type of gnat you have and eliminate them at the source. Covers fungus gnats, drain flies, and general prevention.
"Gnats" is a catch-all term people use for any tiny flying insect that is not a fruit fly. But the insects grouped under that label are actually different species with different breeding habits, and the solution depends entirely on which one you have.
The three most common indoor gnats are fungus gnats (which live in houseplant soil), drain flies (which breed in the organic film inside drains), and the occasional fruit fly that gets misidentified. Each one breeds in a different place, responds to different traps, and requires a different elimination approach.
Identifying the type takes about 30 seconds and saves you from wasting time on the wrong treatment.
For fungus gnats, you need yellow sticky traps (available at garden centers or online, about $5 for a pack of 20) and a way to let your soil dry out. For drain flies, baking soda, white vinegar, and boiling water. A small bowl and apple cider vinegar work as a general-purpose trap for any type.
Identify which type of gnat you have
Watch where the gnats congregate. This tells you which species you are dealing with. Fungus gnats hover around houseplants, especially when you water them. They are small, dark, and have a somewhat erratic flying pattern. Drain flies (also called moth flies) are found near bathroom or kitchen drains. They are fuzzy, slightly triangular, and tend to rest on walls near sinks. They look more like tiny moths than flies. Fruit flies are tan or brownish with red eyes and cluster around fruit, trash, or fermented liquids. Once you identify the type, focus your treatment on their specific breeding source.
For fungus gnats, dry out the soil and use sticky traps
Fungus gnat larvae live in the top 2 to 3 inches of moist potting soil, where they feed on organic matter and fungi. The most effective treatment is letting the soil dry out completely between waterings. This kills larvae, which need moisture to survive. Stick yellow sticky traps into the soil surface of affected plants. Adults are attracted to the yellow color, land on the adhesive, and get stuck. Replace traps every 1 to 2 weeks. Within 2 to 3 weeks, the lifecycle breaks as larvae die in dry soil and adults get caught on traps.
Good to know: A layer of coarse sand or decorative gravel (about half an inch) on top of the potting soil creates a physical barrier that prevents adult gnats from reaching the soil to lay eggs. It also makes the surface dry faster, which discourages larvae. This is a long-term preventive measure for any plant prone to fungus gnats.
For drain flies, clean the organic buildup inside the drain
Drain flies breed in the slimy organic film that coats the inside of drains, especially in bathrooms where hair, soap scum, and skin cells accumulate. Any pocket of standing organic sludge will do, so the drain is the first place to look rather than the only one. Killing the adults does nothing because the larvae are inside the pipe where sprays cannot reach. To eliminate them, remove the drain cover and scrub the visible interior with a stiff brush. Pour boiling water slowly down the drain, followed by half a cup of baking soda and half a cup of white vinegar. Let it fizz for 15 minutes, then flush with more hot water. Repeat every 2 to 3 days for a week. Two caveats. The fizzing is an acid and a base neutralizing each other into salty water and carbon dioxide gas, so it loosens the film rather than digesting it, which is why the scrubbing above and the enzymatic cleaner below do most of the work. And if your drain pipes are PVC, use very hot tap water rather than boiling, because PVC is rated to a maximum operating temperature of 140°F while boiling water is 212°F, and this is a treatment you are repeating all week. Enzymatic drain cleaners (like Drain Gel or InVade Bio Drain) are particularly effective because they digest the organic film that drain flies depend on.
Set up vinegar traps for remaining adults
While you address the breeding source, set vinegar traps to catch the adults that are already flying around. Pour half an inch of apple cider vinegar into a small jar or bowl. Add 2 to 3 drops of dish soap to break the surface tension. Place traps near the affected area (next to plants for fungus gnats, near drains for drain flies). The vinegar attracts most small flying insects. This does not solve the problem by itself, but it reduces the adult population while your source elimination takes effect.
For fungus gnats, use hydrogen peroxide soil drench
If drying out the soil is not practical (some tropical plants cannot tolerate dry periods), use a hydrogen peroxide soil drench to kill larvae without harming the plant. Mix one part 3% hydrogen peroxide (the standard drugstore kind) with four parts water. Water your plants with this mixture instead of plain water. The hydrogen peroxide fizzes on contact with organic material in the soil, killing larvae and eggs on contact. It breaks down into water and oxygen, so it does not harm plant roots. Use this treatment once per week for 3 to 4 weeks to catch all stages of the lifecycle.
Prevent future gnat problems
For fungus gnats, avoid overwatering houseplants. Let the top inch or two of soil dry between waterings for most plants. Use well-draining potting mix. Empty saucers under pots after watering so plants do not sit in standing water. For drain flies, clean drains monthly with hot water and the baking soda and vinegar method, following the same pipe caution as step 3. Do not let hair and soap scum build up. For all types, empty and clean pet water bowls daily. Fix leaky faucets and pipes that create standing water. Clean up any organic debris promptly.
Most gnat problems resolve within 1 to 2 weeks once you address the specific breeding source. Fungus gnats take slightly longer because eggs in the soil need time to hatch and encounter the dry conditions that kill larvae. Drain flies disappear quickly once the drain is cleaned because their lifecycle depends entirely on the organic film inside the pipe. If you treat the correct source and the problem persists beyond two weeks, you may have a secondary breeding site. Check other drains, other plants, or areas with standing water that you overlooked initially.
Questions we get asked about this
Answers from experience, not a textbook.
Common indoor gnats (fungus gnats and drain flies) do not bite, do not sting, and do not transmit diseases to humans. Fungus gnats in large numbers can damage houseplant roots because the larvae feed on root material, particularly in seedlings and young plants. Adult gnats are purely a nuisance. They are harmless but annoying.
Gnats are attracted to carbon dioxide, moisture, and warmth, all of which your face produces. They also tend to fly toward light-colored surfaces. They are not targeting you specifically. They are following chemical signals. The best way to deal with this is eliminating the breeding source so there are no gnats to bother you, rather than trying to repel individual insects.
UV bug zappers attract some gnats but are not effective for indoor use. They kill the adults they catch but do nothing about the breeding source, so new adults replace them continuously. Sticky traps are more effective indoors because they can be placed directly at the breeding site (in plant soil or near drains) where they intercept adults before they can lay new eggs.
Yes. Garbage disposals accumulate organic residue on the splash guard (the rubber flap), the grinding chamber walls, and the pipe immediately below. This residue is an ideal breeding ground for both fruit flies and drain flies. Run the disposal with plenty of cold water every time you use it. Clean the splash guard by lifting the flaps and scrubbing the underside with a brush and dish soap. Flush periodically with the baking soda and vinegar method.
No. The plant is salvageable. Repotting in fresh, dry soil is the fastest fix. Remove the plant from its pot, shake off as much of the old soil as possible, and repot in new potting mix. Discard the old soil outside (not in an indoor trash can). Then apply the hydrogen peroxide drench to the new soil as a preventive measure. Add a layer of sand or gravel on top.
Pest Control Pro
How to Get Rid of Ants
How to Get Rid of Fruit Flies
How to Get Rid of Gnats
← you’re hereHow to Get Rid of Mice
How to Get Rid of Roaches