Flies and Gnats: How to Identify and Get Rid of Them

Gnats are flies. Every insect you’d call a “gnat” belongs to the order Diptera, the same group as house flies, making “gnat” an informal label rather than a scientific one. In everyday language, people use “gnat” for any tiny fly that shows up uninvited, whether it’s hovering around fruit on the counter, rising from houseplant soil, or swarming near your face outdoors. Understanding which type you’re dealing with is the fastest route to getting rid of them.

Why People Say “Gnats” When They Mean Flies

The word “gnat” loosely describes any small, delicate fly, usually under 5 millimeters long. House flies, blow flies, and other larger species get called “flies,” while the smaller ones get lumped together as “gnats.” But the group includes very different insects with different habits: fruit flies breed in fermenting produce, fungus gnats breed in damp soil, drain flies breed in the organic sludge inside pipes, and biting midges feed on blood. Solving a gnat problem starts with figuring out which of these you actually have.

Common Types and How to Tell Them Apart

Fruit Flies

Fruit flies are tan or brownish with distinctive red eyes. They’re about 3 millimeters long and almost always appear near ripening fruit, open drinks, or compost bins. If you see tiny flies hovering right above your kitchen counter or trash can, these are the most likely culprit.

Fungus Gnats

Fungus gnats are darker, with long legs and a mosquito-like silhouette. They hover near houseplants because their larvae feed on fungi and organic matter in damp potting soil. At about 75°F, a fungus gnat can go from egg to adult in roughly 17 days: eggs hatch in about 3 days, larvae develop over 10 days, and pupae emerge as adults after another 4 days. That fast cycle explains why a few gnats around one plant can become dozens within weeks.

Drain Flies

Drain flies (also called moth flies) are fuzzy, with broad, leaf-shaped wings that make them look more like tiny moths. They rest on walls near sinks, showers, or floor drains, and they’re sluggish fliers. Their larvae live in the slimy biofilm that lines the inside of pipes.

Eye Gnats

Eye gnats are especially common in the southeastern U.S. These tiny flies, just 1.5 to 2 millimeters, have shiny dark bodies with clear wings and look like miniature house flies. They swarm around faces because they’re attracted to the moisture from eyes, noses, and ears, feeding on proteins in those fluids.

Biting Midges

Also known as no-see-ums, punkies, or pinyon gnats depending on the region, biting midges are the gnats that actually bite. They have four tiny cutting blades in their mouthparts that slice the skin, causing a sharp burning sensation. Bites produce small red welts, and some people develop local allergic reactions with significant itching. If you’re being bitten by something you can barely see, especially around dusk, biting midges are the likely source.

Getting Rid of Fruit Flies

The first step is removing whatever they’re breeding in. Toss overripe fruit, wipe down counters, empty trash cans, and clean any spills of juice or alcohol. Fruit flies can keep reproducing as long as fermenting organic material is available, so sanitation alone solves many infestations within a week or two.

To speed things up, traps work well. The most effective DIY version uses a Mason jar with a few small holes punched in the metal lid using a hammer and nail. Fill the jar about a quarter full with apple cider vinegar and add a few drops of liquid dish soap. The vinegar’s sweet, fermented smell draws the flies in, and the soap breaks the surface tension so they can’t land on the liquid without sinking. In side-by-side testing, this simple setup caught at least 50 flies in a week, far outperforming paper cones, plastic wrap covers, and leftover wine bottles.

If you prefer a hands-off approach, commercial sticky traps shaped like fruit or bright yellow cards placed near problem areas catch flies passively.

Getting Rid of Fungus Gnats

Fungus gnats thrive in consistently moist soil, so the simplest fix is changing how you water. Letting the top 1 to 2 inches of potting soil dry out between waterings makes it much harder for gnats to lay eggs and for larvae to survive. This alone can break the breeding cycle over several weeks.

For an active treatment, mix one part standard 3% hydrogen peroxide with four parts water and pour it over the soil. The mixture will fizz on contact as it kills larvae. Let the soil dry out afterward. You can repeat this each time you notice new adults. Products containing BTI, a naturally occurring bacterial toxin that targets fly larvae, are another option available at most hardware stores. Applied consistently, you should see the population drop significantly after 4 to 5 weeks.

Yellow sticky traps placed at soil level catch adults before they can lay more eggs, which helps reduce numbers while your soil treatments work on the larvae below the surface.

Getting Rid of Drain Flies

Drain flies are uniquely stubborn because killing the adults does nothing about the larvae living inside your pipes. The real target is the layer of organic buildup coating the inside of drains. A stiff pipe brush physically scrubbed through the drain opening removes much of this material. Follow up with an enzyme-based drain gel, which contains microorganisms that digest organic sludge and cling to pipe walls for extended action. Unlike bleach, which runs past the buildup without dissolving it, enzyme cleaners break down the material drain fly larvae actually feed on.

Repeat the treatment every few days for about two weeks. That covers the full development cycle so newly hatching larvae don’t find a food source. Pouring boiling water down the drain daily can supplement the process but rarely solves the problem on its own.

Preventing Gnats From Coming Back

Most gnat problems come down to moisture and organic matter. A few habits keep them from returning:

  • Store produce in the fridge once it starts to ripen, especially bananas, tomatoes, and stone fruits.
  • Take out kitchen trash frequently and keep the bin’s lid sealed.
  • Rinse bottles and cans before putting them in recycling bins.
  • Water houseplants only when needed rather than on a set schedule, and use pots with drainage holes to prevent standing water at the roots.
  • Run drains regularly in guest bathrooms or utility sinks that don’t see daily use, since stagnant water and buildup in rarely used pipes attract drain flies.

Dealing With Biting Gnats Outdoors

Biting midges are harder to control because they breed in wet soil, marshes, and shoreline mud, environments you can’t easily modify. They’re most active around dawn and dusk. Fine-mesh screens (standard window screens have gaps large enough for no-see-ums to pass through) and fans that create airflow across porches or patios are the most reliable physical barriers. Repellents containing DEET or picaridin applied to exposed skin reduce bites during peak activity.

If bites swell significantly, produce intense itching that lasts more than a few days, or develop signs of infection like increasing redness and warmth, an over-the-counter antihistamine or hydrocortisone cream typically helps. People who react strongly to biting midge bites tend to react similarly each time, so knowing your pattern helps you prepare.