Skip to content
The Pest Guide logo: an orange ant behind a magnifying glass The PestGuide
Question · answered · Flies & Gnats

Are fruit flies attracted to light?

Updated · The Pest Guide · Editorial policy

Illustration of the fruit flies
Fruit flies Family Drosophilidae
Short answer

True fruit flies are not really attracted to light because their world revolves around the volatile smells of microbial fermentation. These insects navigate by their noses to find overripe bananas or yeast cultures, while bugs swarming glowing screens are usually fungus gnats or drain flies.

What is actually going on

You are sitting on the couch late at night, watching television or typing away on your laptop, when a tiny bug dances right across the glowing screen. You automatically swat at the air, assume it came from the fruit bowl on the kitchen counter, and wonder why it finds the television so fascinating.

To give you the short answer right away: fruit flies are not really attracted to light. If you have tiny insects swarming your computer screen, your bedside lamp, or the windowpanes after dark, you are almost certainly dealing with a completely different pest.

True fruit flies, or vinegar flies as entomologists prefer to call them, navigate by their noses rather than their eyes. Their world revolves around the volatile, intoxicating smells of microbial fermentation. They care deeply about acetic acid, ethanol, and active yeast cultures rising from overripe bananas, forgotten potatoes, or the sticky residue left inside an empty soda can. Light is merely a secondary consideration for them, and they usually only drift toward a bright window by sheer random chance in an otherwise dark room.

So why do people think they love light bulbs? Because small indoor flies look remarkably similar to the naked eye. When insects swarm a bright television screen or cluster around a bathroom vanity light, they are usually fungus gnats emerging from overwatered potted plant soil or drain flies living in the gelatinous scum of sink pipes. Those species exhibit strong positive phototaxis, which is the scientific way of saying they are irresistibly drawn to short-wavelength light sources. Fruit flies, on the other hand, would rather fly straight toward an open bottle of cider vinegar.

How to tell for sure

Since looks can be deceiving when dealing with tiny specks flying around your house, a quick visual check usually tells you what you are actually fighting. You do not need a microscope for a basic household ID, though a magnifying glass or a quick look under bright kitchen lights helps.

Start by watching how the insects move. Common fruit flies usually fly in smooth, steady, hovering arcs around food items, garbage cans, and recycling bins. If you see small bugs scuttling rapidly across your countertops in short, jerky bursts before taking flight, those are usually phorid flies, which often indicate broken sub-slab plumbing or deep organic buildup. Tiny insects that make short, weak, hopping flights and spend most of their time resting on bathroom walls or near sink drains are typically drain flies or moth flies. Fungus gnats are the culprits that usually hover right in front of illuminated digital screens, computer monitors, and lamps.

If you can catch one and look closer, physical details give away the species. Common fruit flies usually feature prominent red eyes, a tan thorax, and a striped abdomen, measuring about an eighth of an inch long. Phorid flies have a distinct humpbacked thorax and dark eyes. Drain flies look like miniature, fuzzy moths because their wings are covered in tiny hairs and held roof-like over their bodies. Fungus gnats look a bit like fragile, long-legged mosquitoes with clear wings.

What usually comes next

Once you realize that light is not the secret to your fruit fly problem, your next practical move is to stop wasting money on ultraviolet bug zappers and plug-in light traps. Electric grid zappers and UV glue boards might catch house flies or fungus gnats, but they generally fail against true fruit flies because, once again, those flies are hunting scents, not illumination.

Your best decision is to focus entirely on source elimination and scent-based trapping. Walk around your kitchen and round up any overripe, damaged, or un-refrigerated fruits and vegetables. Wash out the sticky residue inside your recycling bin, especially if you toss beer bottles, wine glasses, or soda cans in there without rinsing them first.

To catch the adults still buzzing around while you tackle the breeding sources, build a simple vinegar trap. Pour a small amount of apple cider vinegar into a glass or a jar, and stir in a single drop of liquid dish soap. The vinegar lures them in with the fermentation odors they crave, while the soap breaks the surface tension of the liquid, causing the flies to sink instead of walking across the top. It is simple, effective, and addresses the actual biology of the insect rather than relying on a glowing light bulb.

When to get help

Most small fly invasions clear up nicely once you throw away the offending piece of fruit and clean the kitchen. However, there are times when DIY methods fall short and you need to bring in outside help.

If you have scrubbed your kitchen spotless, sealed up all the produce, and set out traps, but swarms of flies keep emerging day after day, the breeding ground is likely hidden behind walls, inside ceiling voids, or beneath concrete floor slabs. In commercial kitchens, healthcare facilities, or residential homes where phorid flies or drain flies persist despite rigorous sanitation, call a licensed pest control professional. They have the tools to perform specialized plumbing dye tests, smoke tests, or targeted dust applications to track down broken pipes and inaccessible organic decay.

On the health side, remember that small flies feed and breed in unsanitary materials, meaning they can mechanically transfer bacteria to clean food prep surfaces or sterile environments. If anyone in your household experiences persistent gastrointestinal illness after suspected food contamination, or if an infestation breaks out in a sensitive medical setting, consult a healthcare clinician or local public health authority for guidance.

Next questions