The launch of Sleep Stages was a huge step forward in sleep research—for Fitbit users and scientists.

Available on Fitbit Alta HR, Blaze, and Charge 2, Sleep Stages uses motion detection and heart rate variability to estimate the amount of time users spend awake and in light, deep, and REM sleep each night. The result? Data that empowers Fitbit users to take control of their sleep quality and allows Fitbit scientists to dig deeper into the health effects of sleep.

“The ability to easily track your sleep not only helps individuals better understand their own sleep, it also unlocks significant potential for us to better understand population health and gain new insights into the mysteries of sleep and its connection to a variety of health conditions,” says Conor Heneghan, Ph.D., lead sleep research scientist at Fitbit.

With that in mind, researchers tapped Fitbit’s longitudinal sleep database—the most extensive in the world—to analyze millions of nights of Sleep Stages data* to determine how age, gender, and duration affect sleep quality.

The sleep study results are below. Open up your sleep log in the Fitbit app to see how your personal stats compare.

The Sleep Sweet Spot

The average Fitbit user is in bed for 7 hours and 33 minutes but only gets 6 hours and 38 minutes of sleep. The remaining 55 minutes is spent restless or awake. That may seem like a lot, but it’s actually pretty common.

“Sleep is not completely still,” says Fitbit Advisory Panel sleep expert Michael Grandner, MD, director of the Sleep and Health Research Program at the University of Arizona in Tucson. “It’s perfectly normal to have periods of restlessness—10 or even up to 30 could be normal for you.” (Here’s when restlessness might be more concerning.)

That said, 6 hours and 38 minutes is still shy of the 7+ hours the the CDC recommends adults get. If you tend to fall short as well, try to bank those extra minutes: Fitbit data confirms that sleeping 7 to 8 hours gives you the highest combined percentage of deep and REM sleep. In fact, 7.5 hours of sleep is the point at which you typically start getting less percentage of REM and more light.

People who sleep 5 hours or less a night deprive their body of the opportunity to get enough deep sleep, which occurs near the beginning of the night. Deep sleep is important for many physical processes such as cell regeneration, human growth hormone secretion, and feeling refreshed.

Fitbit data shows waking up earlier than usual is what impacts REM sleep, which occurs more at the end of the night. Not getting enough REM sleep can negatively impact your short-term memory, cell regeneration, and mood.

Light sleep seems to act as a filler: You get more when you log less than 7 hours or more than 9 hours of sleep a night. And that’s not necessarily a bad thing—a lot of body maintenance happens during light sleep.

“These findings further support the general recommendation that most adults need to consistently sleep 7 to 9 hours per night, and illustrate why a good night’s rest is so important for your overall well-being,” says Fitbit Advisory Panel sleep expert Michael T. Smith, Jr., Ph.D., professor of psychiatry, neurology, and nursing at Johns Hopkins University School of Medicine in Baltimore.

For more information on sleep stages and cycles, see REM, Light, Deep: How Much of Each Stage of Sleep Are You Getting?

The Gender Sleep Gap

For the second year in a row Fitbit data scientists found women get about 25 minutes more sleep on average each night compared to men. The percentage of time spent in each sleep stage was also similar—until you factor in age.

Fitbit data shows that men get a slightly higher percentage of deep sleep than women until around age 55 when women take the lead.

Women win when it comes to REM, logging an average of 10 more minutes per night than men. Although women tend to average more REM than men over the course of their lifetime, the gap appears to widen around age 50.

Bridging the Generational Divide

Generation Z goes to sleep the latest, but they sleep longer, putting their nightly average of total hours asleep on top. Baby Boomers sleep the least, averaging 6 hours and 33 minutes per night.

REM and light sleep stay pretty stable throughout a person’s lifetime but deep sleep takes a hit, decreasing from an average of 17 percent at age 20 to 12 percent at age 70.

According to Grandner, there are two main things that can lead to less deep sleep. The first is age: “People naturally get less as they get older,” says Grandner. “And there’s not really much you can do about it.”

The second can be more controllable. “Anything that interferes with sleep like pain, illness, and medical problems, can keep your body out of deep sleep artificially,” says Grandner.

So what can you take away from this Fitbit sleep study? Three things:

Keep a consistent sleep schedule —ideally one that lets you get between 7 and 8 hours of sleep a night. That tends to produce the optimal combined percentage of deep and REM sleep.

Consider moving your bedtime up. People who go to bed earlier tend to get more sleep and get higher quality sleep, with 9 to 10 pm being the time slot that yields the highest average percentage of REM sleep.

Remember: Everyone is different . As Grandner told Fitbit , ideal sleep stages are “whatever your body does given enough of an opportunity.” If you feel great on your current sleep schedule, you may not need to change a thing.

*This research is based on aggregated and anonymous data from millions of users April 8-17, 2017. Sleep duration is based on time asleep and does not include restless or awake time. Generations are defined as: Generation Z (age 13-22), Millennials (age 23-40), Generation X (age 41-51), and Baby Boomers (age 52 and above).

This information is for educational purposes only and is not intended as a substitute for medical diagnosis or treatment. You should not use this information to diagnose or treat a health problem or condition. Always check with your doctor before changing your diet, altering your sleep habits, taking supplements, or starting a new fitness routine.