You Might Like {{displayTitle}} READ

Nobody likes skimping on sleep, but chances are you’ve done it. Whether to study for an exam, finish a tough project, or simply because you got stuck in an airport, pulling an all-nighter happens.

And there’s no denying that even mild sleep deprivation has negative effects, including negative moods, poor cognitive function and metabolic health, obesity, and diabetes. Metabolic effects of sleep disruption, links to obesity and diabetes. Nedeltcheva AV, Scheer FA. Current opinion in endocrinology, diabetes, and obesity, 2015, Apr.;21(4):1752-2978. Effects of sleep deprivation on cognition. Killgore WD. Progress in brain research, 2011, Feb.;185():1875-7855. Sleep deprivation leads to mood deficits in healthy adolescents. Short MA, Louca M. Sleep medicine, 2015, Apr.;16(8):1878-5506. Effects of 72hours total sleep deprivation on male astronauts' executive functions and emotion. Liu Q, Zhou R, Liu L. Comprehensive psychiatry, 2015, Jun.;61():1532-8384. Sleep debt and obesity. Bayon V, Leger D, Gomez-Merino D. Annals of medicine, 2014, Jul.;46(5):1365-2060. In one study, six hours of sleep per night for 14 days produced the same effect as not sleeping for two nights consecutively. The cumulative cost of additional wakefulness: dose-response effects on neurobehavioral functions and sleep physiology from chronic sleep restriction and total sleep deprivation. Van Dongen HP, Maislin G, Mullington JM. Sleep, 2003, Jul.;26(2):0161-8105. Unfortunately, if you didn’t sleep, feeling alert won’t help you make better choices: Another study found that giving sleep-deprived subjects stimulants like caffeine didn't improve their decision-making. Gambling when sleep deprived: don't bet on stimulants. Killgore WD, Grugle NL, Balkin TJ. Chronobiology international, 2012, Apr.;29(1):1525-6073.

But with all that in mind, there are steps you can take to minimize the damage and treat your body (and brain) as well as possible under bad circumstances. Here’s how to survive the night—and recover ASAP.

Prep for a Sleepless Night

1. Bank sleep ahead of time.

How to Pull an All-Nighter

While you can’t always anticipate an all-nighter, if you happen to know a stressful time or multi-time zone trip is headed your way, there are a few ways to prep your body. “If you’re already a sleep-deprived person and then you pull an all-nighter, you’re going to have more cumulative effects,” says Shalini Paruthi, M.D., a fellow of the American Academy of Sleep Medicine. But if you've been sleeping the recommended seven to nine hours a night, you won’t feel as bad after one missed night. Banking sleep: realization of benefits during subsequent sleep restriction and recovery. Rupp TL, Wesensten NJ, Bliese PD. Sleep, 2009, Apr.;32(3):0161-8105. And according to one study, extended sleep (nine or 10 hours) for six days leading up to sleep deprivation also reduces negative effects. Benefits of Sleep Extension on Sustained Attention and Sleep Pressure Before and During Total Sleep Deprivation and Recovery. Arnal PJ, Sauvet F, Leger D. Sleep, 2015, Jul.;():1550-9109.

2. Get any amount of shut-eye.

Yes, we know this is about how to stay up, but if you can, even a 20-minute nap is better than nothing. ”Opt for either a brief nap of less than 20 minutes or a longer nap of 60 to 90 minutes, if possible,” says Natalie Dautovich, Ph.D., a National Sleep Foundation environmental fellow. “This will allow you to wake up during the lighter stages of sleep and feel more rested.”

Get Through the Night

1. Bring on the lights.

How to Pull an All-Nighter

“We need darkness to have the onset of melatonin, which is the hormone that makes us sleepy,” Dautovich says. “So if you’re trying to stay awake, bright light can be very effective.” Specifically, light close to your eyes (for instance, a desk lamp or your computer screen) will kick your brain into high alert.

2. Keep your room temperature moderate.

Studies show that we sleep best when the room is cool, probably around 65 degrees. If you need to stay awake, the solution is to find a not-too-cool, not-too-hot sweet spot. “Make the room temperate or layer on clothing,” Dautovich says. Keeping the temperature around 75 degrees should keep you alert, and also prevent any heat related drowsiness.

3. Skip the sugar and snack on protein and carbs.

This probably sounds like a no-brainer, but refined sugar will lead to a crash within a few hours. “Eating candy to stay awake is not sustained energy,” says Tamara Melton, R.D.N., a spokesperson for the Academy of Nutrition and Dietetics. “It’s a simple sugar that will spike your energy levels up and then drop you down.”

Instead focus on foods that provide long-lasting energy. “Eat something with lean protein,” Melton says. Greek yogurt and berries or an apple and peanut butter make great choices.

Just make sure you avoid heavy foods. “Anything really high in fat—like fettucini alfredo or fried chicken—will not promote staying awake,” Melton says. Instead of one big meal, snack a little throughout the night so you’re less likely to suffer an energy crash.

4. Drink a little coffee—and a lot of water.

For most adults, up to 400mg of caffeine (about four cups of coffee), per day is safe. If you’re staying up all night, spread that out. “You want to aim for 100 to 200mg of caffeine, or a cup or two,” Melton says. Have your coffee with a snack to allow a slower release of caffeine into your system.

The key is to not OD on caffeine. “Often when you’re pulling an all-nighter, you need to concentrate,” Melton says. “More than two cups of coffee, and you might get jittery and your focus will decrease.”

After three or four hours, Melton says it’s OK to have another one to two cups of java. “Just know that it won’t work as well because you’re even more tired at that point,” Melton says.

And once you’re done with coffee, start chugging H2O. “When you’re hydrated you can concentrate better and every part of your system just works better,” Melton says.

5. Chew gum.

Several studies have shown chewing gum can increase alertness, and it may even improve intellectual performance. Chewing Gum: Cognitive Performance, Mood, Well-Being, and Associated Physiology. Allen AP, Smith AP. BioMed research international, 2015, May.;2015():2314-6141. Effects of chewing gum on mood, learning, memory and performance of an intelligence test. Smith A. Nutritional neuroscience, 2009, Jul.;12(2):1476-8305. Help yourself even more by picking a mint flavor. Mint increases cerebral activity and smelling peppermint may improve your memory. Modulation of cognitive performance and mood by aromas of peppermint and ylang-ylang. Moss M, Hewitt S, Moss L. The International journal of neuroscience, 2008, Mar.;118(1):0020-7454. The effect of chewing gum on physiological and self-rated measures of alertness and daytime sleepiness. Johnson AJ, Miles C, Haddrell B. Physiology & behavior, 2011, Oct.;105(3):1873-507X.

6. Get up and walk around.

“Take short breaks every 45 minutes or so to walk around,” Paruthi says. If you’re drinking lots of water, as Melton suggests, it should be easy to build in a bathroom break about every hour.

Paruthi also says you should give your eyes a break occasionally to help stay alert. “If you’re on your computer screen, try looking up and looking at a point in the distance to relax your eye muscles every now and then.”

Survive the Next Day

1. Don't drive.

The Healthiest Way to Pull an All-Nighter

According to one study, drowsy driving is nearly the same as drunk driving. “This means planning ahead,” Paruthi says. “If you’re going to have to stay up, ask a neighbor or friend to drive you to work the next morning.” Paruthi suggests that you avoid driving unless you’ve been able to sleep for at least four hours.

2. Nap if you can, but don’t overdo it.

“You want to avoid a drastic difference in your sleep time, so going to bed mid-morning and waking up mid-evening might throw off your rhythm for the next night,” Dautovich says. Stick to the same nap schedule previously mentioned: 20 minutes or 60 to 90 minutes.

After your nap, no matter how tempting, try to stay awake as close as possible until your normal bedtime so you get back on track.

3. Go easy on the caffeine.

Though you may want an IV of coffee and Red Bull, resist. According to one study, even when caffeine was consumed six hours before bedtime, sleep patterns were still disrupted. “Caffeine early in the day is all right, but if you're still consuming it by 4 p.m., it may make it harder to fall asleep,” says Robert Rosenberg, D.O., author of Sleep Soundly Every Night, Feel Fantastic Every Day.

4. Eat fruits, veggies, and drink (even more) water.

“When people are sleep-deprived, they start to look for comfort food and don’t make good choices,” Melton says. In fact, one study showed that sleep deprivation is associated with a higher body mass index, while another study showed that a lack of sleep caused people to eat more even though they weren't any more active than usual. “Fruits and veggies are helpful because those foods are rich in antioxidants and phytochemicals, which can help protect your cells since they’re not functioning at their best,” Melton explains.

And, just like you did throughout the night, stick to lean proteins, healthy carbs, and lots of water, she adds.

5. Do something active.

This is not the day to try a tough new workout, but a little activity might benefit you. “A light workout could be energizing and could help you stay awake,” Dautovich says. “We also know that physical activity may help you sleep better later.”

6. Don't overeat and don't drink.

It’s easy to overeat when you’re sleep-deprived because, well, eating feels good. “But at a certain point, having too big a meal can make sleeping uncomfortable,” Melton says. “Eat something balanced that you know will keep your GI tract in a happy place.”

And it should be obvious, but drinking alcohol does your body zero favors. “Sleep deprivation plus alcohol is a recipe for disaster,” Rosenberg says. Scientists have known for decades that alcohol disrupts normal sleeping patterns, so if you want a solid recovery night, a glass of wine won’t help.

7. Get a little extra sleep.

Some studies have shown that unlike chronic sleep deprivation, you can undo the damage of one bad night with 10 hours of sleep the following night, Rosenberg says. Other studies have shown that recovery sleep can also have a positive effect on motor skills. Deprivation and Recovery of Sleep in Succession Enhances Reflexive Motor Behavior. Sprenger A, Weber FD, Machner B. Cerebral cortex (New York, N.Y. : 1991), 2015, Jun.;():1460-2199.

The Takeaway

If you need to pull an all-nighter, your healthy behavior matters even more. Stick to lean proteins, drink lots of water, and avoid the high-caloric food you may crave the following day. Plan for recovery sleep that night, and give yourself a break.

“There is no long-term damage from one night of missed sleep,” Rosenberg says. While chronic sleep deprivation is a serious health issue, a single all-nighter is just an annoyance.

READ THIS NEXT: 16 Ways to Sleep Absolutely Anywhere 34U34 Activism Promo