Health professionals may debate the benefits of dairy or the best time to exercise, but there’s one thing they all agree on: Sleep is really freaking important. Getting a good night’s sleep is tied to a slew of health benefits, like clarity of thoughts, quicker reflexes, and an improved mood. That means that not getting enough shut-eye can have some real consequences too, like an out-of-whack appetite (leading to weight gain), growth issues, even a slumping immune system .Short Sleep Duration Promoting Overconsumption of Food: A Reward-Driven Eating Behavior? Chaput, J., Department of Human Nutrition, University of Copenhagen, Frederiksberg C, Denmark, Sleep. 2010 Sep 1; 33(9): 1135–1136.

And believe it or not, what you eat before bed (and when you eat it) can have a serious impact on your sleep quality .Relationship between food intake and sleep pattern in healthy individuals. Crispim, C.A., Zimberg, I.Z., dos Reis, B.G., et. al., Departamento de Psicobiologia, Universidade Federal de São Paulo, São Paulo, Brazil, Journal of Clinical Sleep Medicine. 2011 Dec 15;7(6):659-64. doi: 10.5664/jcsm.1476.

To help you catch more Z’s, we’ve compiled exactly what you should (and shouldn’t) eat before putting on your PJs to ensure an excellent night of sleep.

Sleep Superstars

Tryptophan is magic. This amino acid is found in all types of food, including turkey—although it’s not to blame for your Thanksgiving coma. But research shows that foods with tryptophan produces serotonin, which helps promote sleep.Diet promotes sleep duration and quality. Peuhkuri K., Sihvola N., Korpela R., Institute of Biomedicine, Pharmacology, Medical Nutrition Physiology, University of Helsinki, Helsinki, Finlandm, Nutrition Research. 2012 May;32(5):309-19

“Many people believe eating foods that contain tryptophan will help induce sleep,” says Jessica Redmond, RD. “This recommendation arises from past research, which has shown that a tryptophan deficiency leads to a serotonin deficiency, and serotonin is one of the hormones that influences our circadian rhythm and sleep patterns. The solution? Eating foods like turkey, soy beans, and pumpkin seeds, which contain decent amounts of tryptophan.”

Adding some whole grains. Breads, crackers, pastas, or rice combined with a protein, like turkey, eggs, or low-fat dairy, may be the perfect combination for a pre-sleep snack. “The carbohydrate-containing foods help the tryptophan-rich foods get absorbed by the brain,” says Lindsey Joe, RD.

Consider cherries. These guys are one of the few natural sources of melatonin, a hormone your body produces that’s often recommended as a sleep aid. One study found that a tart cherry juice blend helped older adults struggling with insomnia.Effects of a Tart Cherry Juice Beverage on the Sleep of Older Adults with Insomnia: A Pilot Study. Pigeon, W.R., Carr, M., Gorman, C. Journal of Medicinal Food. 2010 Jun; 13(3): 579–583.

Munch on magnesium. Foods high in magnesium, like dark leafy greens and avocado (did someone say late-night guacamole?) may be just what you need to ease into dreamland. In one study of older adults with insomnia, magnesium had a positive effect on the quality of their sleep, like the length of time they slept and their ease in waking up (among other factors).The effect of magnesium supplementation on primary insomnia in elderly: A double-blind placebo-controlled clinical trial. Abbasi, B., Kimiagar, M., Sadeghniiat, K., et. al. Faculty of Nutrition and Food Technology, Tehran, Iran, Journal of Research in Medical Sciences. 2012 Dec; 17(12):1161-9.

Sleep Stealers

Skip the late-night cup of joe. This one isn’t a shocker, but it bears repeating. “A good night’s sleep requires a specific formula for success, which can vary from person to person. There are, however, certain foods you should avoid to get maximum Z’s, such as caffeine-containing foods or beverages,” Joe says. “Keep your caffeine intake to 200 to 300 mg per day and avoid it close to bedtime.” And don’t forget caffeine isn’t only lurking in your latte: It can also be found in chocolate, energy drinks, soft drinks, and tea.

Ease up on alcohol. Sure, a glass (or two—let’s be honest) of red wine at night may make you feel sleepy, but drinking before bed could actually disturb sleep in healthy people. “Be sure to cut back on nightcaps, enjoying no more than one drink per day for ladies and two drinks per day for gents,” Joe advises.

Say no to high-fat foods: Sorry, but a late-night rendezvous with Ben and Jerry could lead to restlessness in the wee hours. “High-fat foods such as chips, fried foods, or ice cream should be avoided before bed,” advises Lisa Moskovitz, RD. “Fat takes a long time to digest which will keep the body awake, or not well-rested, throughout the [digestion] process.”

What to Pick—and How Much

“To help prepare you for sleep, it is best to avoid eating large meals in the hours leading up to bedtime,” Redmond says. “If you have to eat a late dinner, keep the portions a bit smaller than usual.” If you’re snacking, try putting your food in a bowl, instead of eating it straight out of the package, which can be dangerous territory especially if you’re zoned out in front of the TV.

Redmond suggests these snacks to promote a healthful, rested night of sleep:
•Low-fat milk and whole grain cereal
•Natural peanut butter on whole wheat bread
Yogurt with half a banana and/or one tablespoon of chopped walnuts
•Two cups plain popcorn with a drizzle of olive oil

The Takeaway

Don’t sacrifice a solid night’s sleep to a late-night snack attack, but that doesn’t mean you have to go to bed hungry. A warm glass of milk and some crackers could be just the trick to punch the clock to sleepy time. If you’re eating near your bedtime, remember these three pointers:

•Focus on foods that contain tryptophan (like turkey, eggs, and milk), which can help promote sleep.
•Avoid caffeine, alcohol, and high-fat foods (damn you, Chunky Monkey!). They’ll hinder your ability to count those sheep.
•If you have to eat right before bed, eat a small meal or pre-portioned snack.