Most people feel colder at night — and need to pile on extra blankets. That isn't just because the world around you is colder. Your body temperature actually drops when you sleep:

Body temperature during sleep

Your core temperature, typically at around 98.6°F, drops by a degree or two as you're getting sleepy and as the night goes on. And a few hours before you wake up again, it starts to rise.

(As a side note, many people experience a similar drop in body temperature in the afternoon, which may be why many of us feel like taking a nap then.)

What makes your body get colder?

The main driver here is light, which regulates your circadian rhythms, aka your sleep/wake cycle. Exposure to light, and blue light in particular, hits specialized receptors in your eyes, which then send this signal to the brain's hypothalamus. The signal then reaches a tiny structure called the suprachiasmatic nucleus.

This structure essentially functions as your body’s master clock. And among other things, it controls the release of the hormone melatonin, which makes people sleepy. And it also controls your body temperature.

So why did we evolve to be colder at night?

This is still largely mysterious, but there are a few possible ideas out there that scientists are exploring.

Metabolism can drop 10% when you sleep — and that may have been a long-ago adaptation

There has been some evidence that this daily cycle of body temperature helps control other daily cycles in the body, such as in the liver and kidneys. "There are a few studies that suggest that even the small 1°–1.5°F change in core body temperature is sufficient to be the cue that synchronizes these cell populations throughout the body," says Christopher Colwell, a professor of psychiatry at UCLA who studies circadian rhythms. "But it’s not definitive at this point."

Another possibility is that decreased metabolism (which would also be reflected by the body creating less heat) is actually one of the reasons for sleeping to begin with. Metabolism can drop 10 percent in sleeping people.

If you think about our evolutionary ancestors struggling to find enough to eat, it would be handy to have periods where we used as little energy as possible. This hypothesis might help explain why many creatures sleep at night rather than during the day. Night is colder than day — so warm-blooded creatures would have to expend even more energy to stay warm if they were awake. Better, then, to go into somewhat-stasis mode and save energy up for only the few hours of eating, mating, and other activities required for survival.

Regulating your temperature can help you sleep better

It's still not entirely clear how much body temperature affects sleepiness itself, but having a naturally elevated body temperature has been associated with insomnia. And trying to sleep when you're too cold or too hot can interfere with your internal body temperature, making it hard to fall asleep or stay asleep. "If your environment is causing you to either be too cold or too hot, then your internal thermostat is going to have to basically work harder to get it to where its ideal temperature needs to be," says Rachel Salas, a neurologist who researchers sleep disorders at Johns Hopkins.

Too much blue light can also interfere with temperature regulation

When she sees patients, she often talks to them about both the temperature of their bedroom and what she calls their "personal environment" — things like your sheets and what you're wearing (cotton can be great for overheated folk).

So, then what's the ideal temperature for your bedroom? "It's all about Goldilocks in this case. Not too hot, not too cold, and whatever works for you," Salas says. She does, however, generally recommend against really hot or cold showers before bed, which can throw your body off.

Exercising before bed can also raise your body temperature, making it difficult to sleep, as Bernie Miller, supervisor at the Sleep Disorders Center at Mayo Clinic in Arizona, told Popular Science.

Also remember that the key to setting your body's clock is light — specifically blue light. That's one reason why experts recommend reducing your exposure to smartphones and TV screens before bed. The app f.lux makes screens less blue after sundown, although there's no published scientific data on its success. However, it certainly can't hurt to give it a try.

Oh, and if you're having serious symptoms of a sleep disorder, get it checked out by a medical professional. After all, sleep is one of the most important things you do every day.