How to Get Rid of Gnats in the Bedroom for Good

Gnats in your bedroom almost always trace back to one of three sources: houseplants with damp soil, overripe fruit, or a rarely used drain. Figuring out which type you’re dealing with is the fastest way to eliminate them, because each one breeds in a different spot and responds to different fixes.

Identify Which Gnat You Have

The three most common indoor “gnats” look and behave differently, and telling them apart takes only a few seconds of observation.

  • Fungus gnats are the most likely culprit in a bedroom. They’re tiny (under ⅛ inch), dark brown or black, and shaped like miniature mosquitoes. You’ll see them hovering just above the soil of potted plants and showing little interest in anything else in the room.
  • Fruit flies have rounder bodies, more like a miniature house fly, and are attracted to ripe fruit, sugary drinks, or alcohol. They’re about ⅛ inch long with either red or dark eyes. If you have a snack plate, an open soda can, or a fruit bowl on your nightstand, these are your problem.
  • Drain flies look moth-like, with fuzzy bodies and broad wings, and are light gray or tan. They breed in the sludge inside drains and tend to land clumsily on walls and ceilings near a bathroom or sink. If your bedroom has an attached bathroom with a drain you don’t run often, check there.

In most bedrooms, fungus gnats are the answer. The rest of this article focuses primarily on them, with notes on fruit flies and drain flies where the approach differs.

Find and Eliminate the Breeding Source

Killing the adults you see flying around is only half the job. A single generation of fungus gnats goes from egg to adult in about 17 days at typical room temperature (75°F), so if the breeding site stays wet and undisturbed, new waves will keep hatching. You need to cut the cycle at the source.

For fungus gnats, that source is moist soil. Females lay eggs in the top layer of potting mix, and the larvae feed on fungi and organic matter in that damp environment. Eggs hatch in roughly 3 days, larvae develop over about 10 days, and after a 4-day pupal stage, fresh adults emerge ready to start the cycle again. The single most effective thing you can do is let your plant soil dry out. Turn up the top 2 centimeters of soil to expose eggs and larvae to air, then don’t water again until the soil is dry at least an inch and a half deep. This alone kills a large portion of developing larvae.

For fruit flies, remove or refrigerate any fruit, empty trash cans, and clean up sticky residue from spilled drinks. For drain flies, run water through unused drains and clean out any buildup inside the pipe with a drain brush or enzyme-based cleaner.

Set Up Traps to Catch Adults

Vinegar Traps

A simple homemade trap works well for both fruit flies and fungus gnats. Pour about ⅓ cup of apple cider vinegar into a small jar or bowl, add 2 tablespoons of water and a single drop of liquid dish soap, then set it near the problem area. The vinegar’s fermentation scent draws the gnats in. The soap breaks the surface tension of the liquid so they sink and drown instead of landing on top and flying away. One drop is enough. Replace the mixture every few days.

Yellow Sticky Traps

For fungus gnats specifically, yellow sticky cards are extremely effective. These are inexpensive cards coated on both sides with adhesive that traps adults on contact. Place them horizontally near the soil surface of your plants, since fungus gnats emerge from and hover close to the growing medium. If you orient them vertically, position the bottom edge level with the top of the plant canopy. You can find these at any garden center, and a few cards placed around your bedroom plants will catch adults before they can lay more eggs.

Treat the Soil Directly

If drying out the soil isn’t enough on its own, or if you have plants that need consistently moist conditions, you can target the larvae directly.

A hydrogen peroxide soil drench is one of the simplest options. Mix one part standard 3% hydrogen peroxide (the kind sold at drugstores) with four parts water, then pour it through the soil as you would normally water. The mixture will fizz on contact as it kills larvae. It won’t harm your plants. Let the soil dry out afterward before watering again.

Diatomaceous earth (DE) is another option. Spread a thin layer of food-grade DE across the top of the soil. The microscite particles are abrasive to soft-bodied larvae and dehydrate them. Wear a mask while applying it, since the fine dust isn’t great to inhale. DE works best when the soil surface is dry, so it pairs well with a reduced watering schedule. You can also mix it into fresh potting mix if you’re repotting a plant that’s heavily infested.

Prevent Gnats From Coming Back

Once you’ve broken the breeding cycle, a few habits keep them from returning. The biggest one is watering discipline. Most houseplants are overwatered to begin with, and consistently soggy topsoil is the single greatest invitation for fungus gnats. Water only when the top inch or more of soil has dried out, and always empty saucers beneath pots so roots aren’t sitting in standing water.

A layer of coarse sand or decorative pebbles on top of the soil creates a physical barrier that discourages females from laying eggs. They need access to moist organic material, and a dry, inorganic top layer makes the pot far less appealing. This is especially useful for plants in your bedroom where you’d rather not deal with sticky traps or powdery DE on your nightstand.

Store fruit in the refrigerator rather than in open bowls, take out bedroom trash regularly (especially if it contains food wrappers or drink containers), and run water through any drains you don’t use daily. If you bring home new plants, inspect the soil before placing them in your room. Quarantining a new plant for a week or two near a sticky trap will tell you quickly if it’s carrying gnats before they spread.

How Long It Takes to Clear Them Out

With the breeding source removed and traps in place, you should see a noticeable drop in adults within a few days. But because eggs and larvae already in the soil will continue developing, expect stragglers for two to three weeks, roughly one full generation cycle. Keep your traps active and your soil dry during this period. If you’re still seeing new gnats after a month, there’s likely a breeding source you haven’t found yet. Check every potted plant in the room, look under furniture for forgotten fruit or spilled liquid, and inspect any nearby drains.