A person rests their head on their desk. Their hands are holding a cup of coffee.
After three consecutive nights of too little sleep, caffeine loses much of its effectiveness. (For Spectrum Health Beat)

It’s a familiar scene. A late night. An early morning. And then Starbucks or Biggby Coffee to the rescue.

Except that doesn’t work in the long run.

“You can’t just replace sleep with caffeine and feel fine,” said Spectrum Health dietitian Christy McFadden. “You can’t live on caffeine alone. Eventually you will need a good night’s rest.”

Science backs her up.

Caffeine loses its effectiveness after three nights of too little sleep, according to a study published in the journal Sleep.

The study included 48 individuals who were only allowed to sleep five hours a night for five nights in a row. After waking, they were given either caffeine or a placebo, and then their moods and alertness were tested throughout the day.

The findings: After a certain point, caffeine doesn’t do a bit of good.

McFadden knows. She’s had her own battles with insomnia. When that happens, her usual two cups of morning coffee don’t help.

If you can’t get the recommended seven to nine hours of sleep a night, McFadden recommends naps (when possible) and fighting sleep deprivation with the right food.

“You have to think of your body as always rebuilding muscles and rebuilding your immune system,” she said. “Small changes, especially when you’re not getting enough sleep, can make a big difference and help you function at a higher level.”

6 tips to re-energize:

1. Don’t skip meals

“Eat several times a day, and never go more than four hours before eating something,” McFadden said. “Fill your body with good fuel.”

2. Get enough protein

Protein is important in rebuilding every cell in your body. Men should aim for 7 ounces a day, while 6 ounces is enough for women and seniors.

3. Add healthy fats

Moderate amounts of fatty fish, nuts, olive oil and avocados are all good choices to help your brain and your mood.

4. Consider some carbs

“If you’re not getting enough sleep, don’t try a low-carbohydrate diet,” McFadden said. “You actually might need a higher level of healthy carbs if you’re not sleeping enough.” Be sure to stick with nutrient-rich, complex carbs like whole grains and legumes.

5. Get your veggies and fruits

Experts recommend covering half of your plate with vegetables during each meal. And snacking on fruit or veggies is always a better choice than cookies or chips.

6. Consider a multivitamin

Although she doesn’t usually recommend vitamin supplements, they can be a safety net in times of too-little-sleep or not eating right.