Do Flies Sleep?

Written by Drew Wood
Updated: June 8, 2023
Share on:


During a humid summer cookout, flies always seem to show up uninvited and never seem to stop buzzing around your face and food. But what do they do after you go to sleep? Are they really flitting around and landing on your unsuspecting body all night? Or do flies sleep, too? If so, where do they sleep and what are some ways to make sure they never wake up?

Key Facts

  • There are more than 110,000 species of flies in the world.
  • Some of the main species we find in our homes and around our animals eat and lay their eggs on our food, garbage, and feces.
  • They have a short lifespan, living a few days to a few weeks, basically living long enough to lay hundreds of eggs to reproduce.
  • Flies rest throughout the day when they get tired, but also sleep for several hours at night.
  • There are a variety of ways you can try to get rid of them, including preventative measures like using window screens and keeping food and garbage covered, to active measures like traps, natural predators, or pesticides.
Blowfly head macro shot

As seen in this blowfly, flies have extremely large compound eyes with about 4,000 lenses on each.

©Cherdchai Chaivimol/

4 Things You Need to Know About Flies

1. They Carry Disease

Flies can transmit some nasty diseases. Things like typhoid fever, cholera, dysentery, E. coli infections, anthrax, polio, or tuberculosis. Hopefully, you are vaccinated against as much of that as possible, but in developing countries and in the wake of natural disasters, fly-borne illnesses can be deadly.

2. They Aren’t All Bad

Every creature has a role to play in the ecosystem. Flies help pollinate some kinds of plants and help the decomposition process of dead plant and animal matter. Maggots from fly eggs can even be used medically, under a doctor’s supervision, to debride a wound, removing infected and dead flesh. Genetic researchers have learned a lot doing experiments on fruit flies, which go through many generations in a short period of time so that the studies of mutations and evolution can proceed rapidly. Flies are also a significant food source for some birds, animals, and even carnivorous plants like the Venus flytrap or the pitcher plant.

maggots in a pile

It’s possible to use fly maggots to clean out the dead and infected flesh in a wound, but this should be done only under a doctor’s supervision.


3. They Have a Short Lifespan

The lifespan of flies varies depending on what species we’re talking about and the environmental conditions they live in. They can live anywhere from a few hours up to a year. In the best of conditions, a fruit fly can live 40-50 days, while a mayfly might live only a few hours or days – just long enough to reproduce. Common houseflies usually live 15-30 days but can sometimes live to the ripe old age of two months.

4. Prevention is the Easiest Means of Control

It’s a lot easier to deal proactively with flies than dealing with an infestation after it gets started. Simply keeping spills cleaned up, enclosing garbage securely in plastic bags, removing food sources and standing water, and screening your windows can make your house a less hospitable place for flies.

What Do House Flies Eat - Food Garbage

One way to prevent fly infestations is to keep garbage sealed up in plastic bags.


The Most Common Flies You Might Encounter

Here are three of the most common types of flies you’re likely to encounter. These are just examples to give you an idea of the typical behaviors of ordinary flies.

Fruit Flies

Fruit flies are found all over the United States, all year round. Even in the winter they can get into your home on fresh produce imported from warmer areas. They’re attracted to overripe fruit, fermented liquids, drains, garbage cans, and overwatered houseplants. Fruit flies can multiply explosively if left unchecked. A female can lay 500 eggs that may hatch within 24 hours.

Fruit flies on overripe pears

There are over 110,000 species of flies in the world. Here, a swarm of fruit flies enjoys some overripe pears.

© Unbehauen

House Flies

This is the most common type of fly found in and around homes. Their range is worldwide. House flies are typically gray and have four black stripes on their thorax. Female house flies usually only mate once but are capable of producing between 350-900 eggs in their lifetime. Eggs go through larval and pupae stages, feeding on rotting meat, decaying plants, or other garbage. A full-grown fly can live 15-30 days but can at times last up to 60 days.

isolated housefly

A common housefly. Aren’t you glad they aren’t this large in real life?

© Jayasvasti

Horse Flies

These flies absolutely torment horses and other domestic animals. They hang out in rural and suburban areas where there is a good supply of standing water as a breeding site and where lots of animals can be found. In true vampire fashion, females bite mammals painfully and drink their blood, while males feed on pollen and plant nectar. Remarkably, they can fly for over 30 miles. They are particularly attracted to dark moving objects, so black horses, beware. And fiendishly, they are most active on windless, blazing hot days when humans and their domestic stock are already tired and irritable.

Aggressive Animal: Horsefly

Female horseflies attack people and animals to drink their blood. Their bites are extremely painful, much more so than a mosquito.


When and How Do Flies Sleep?

Flies like warm temperatures and are most active in the mornings from late spring to early fall. Throughout the day, they land on things and take short rests. The feet of houseflies extrude a sort of glue that enables them to walk upside down on ceilings and other surfaces, meaning they can even rest in that precarious position. Houseflies particularly like resting on things that have an edge: edges of walls and furniture, wires or strings, and leaf stems of houseplants. Outdoors they will shelter under leaves and branches, on tree trunks, garbage cans, fences, and on stems of tall plants. They can sleep as little as five to 15 minutes during the day but at night will typically sleep for several hours. They prefer to be 5-15 feet off the ground when they sleep at night.

Portrait of a fly on a twig. Eyes to eyes. Macrophotography of an insect fly in its natural environment.

House flies like to rest on thin objects: corners, twigs, electrical cords, edges of lampshades, etc.


How Can You Help Flies Rest . . . In Peace . . . Forever?

So you want those annoying flies to go to their eternal rest. Remember that stopping unwanted guests from coming to your house is easier than getting rid of them after they arrive. So here are some steps for preventing flies and for killing them if prevention fails.

Preventing Flies

  • Make sure garbage cans and dumpsters are closed with tight-fitting lids and cleaned on a regular basis, and garbage is enclosed in well-sealed bags.
  • Improve drainage in your house and yard to remove any standing water.
  • Screen windows with tightly fitting screens kept in good repair.
  • Clean up animal waste in your yard and empty and wash cat litter boxes regularly.
  • Clean up spilled food, crumbs, or alcohol immediately, and keep dishes and countertops clean. A pine-scented cleaner helps repel flies.
  • Run boiling hot water down your drains from time to time to flush out putrefying scum.
  • Scent your house with essential oils, candles, or air fresheners with scents flies find disgusting: basil, bay leaf, cedar, cinnamon, citrus, citronella, cloves, cucumber slices or peels, eucalyptus, lavender, lemongrass, marigolds, mint, peppermint, pine, rosemary, or vanilla.
  • Keep air circulating with ceiling fans or air conditioning, as moving air confuses them and makes them want to get away.

Killing Flies

  • Store-bought fly traps such as sticky strips and flypaper can be effective.
  • You can try an electric fly zapper that attracts them with light and electrocutes them when they land on it.
  • You can improvise a homemade trap by putting a few drops of dish soap in a little vinegar in the bottom of a glass, covered in cellophane with a small hole poked in the top. Flies will get in but have trouble getting out. The soap will prevent them from being able to fly and they’ll drown.
  • There are insecticidal soaps, oils, and microbial insecticides that are environmentally friendly.
  • Sprays or liquids with pyrethrin or azadirachtin are also reported to be safe and effective.
Venus flytrap, Dionaea muscipula, with trapped fly.

Venus flytraps can help naturally reduce your fly population, but you’ll need a lot of them to keep up with these rapidly-multiplying pests.

©Kuttelvaserova Stuchelova/

Bye Bye Flies

Flies have their role to play in the environment, but that doesn’t mean they have to do it in your house. Fortunately, the answer to the question, “do flies sleep” is YES, so you get a little reprieve at night when they rest for a few hours. With a little knowledge and effort, you can make sure it’s the last sleep they ever have. Even though it’s annoying to have to deal with them, after all your work your house will look and smell clean and be healthier than ever. Now your problem will be that your friends like your house so much, they won’t leave! (We hear the question, “do you mind helping me move” is a pretty effective friend-repellant.)

The photo featured at the top of this post is ©

Share on:
About the Author

Drew Wood is a writer at A-Z Animals where his primary focus is on mammals, dinosaurs, and geography. Drew has worked in research and writing for over 20 years and holds a Doctorate in Religion, which he earned in 2009. A resident of Nebraska, Drew enjoys Brazilian jiu-jitsu, reading, and caring for his four dogs.

Thank you for reading! Have some feedback for us? Contact the AZ Animals editorial team.