The best foods to eat before bed are light, nutrient-dense snacks that contain natural sleep-promoting compounds, kept to around 150 calories. Foods rich in tryptophan, magnesium, and natural melatonin can genuinely help you fall asleep faster and stay asleep longer. But what you eat matters just as much as when you eat it and how much.
Best Foods for Sleep
Your body uses tryptophan, an amino acid found in many common foods, to produce both serotonin and melatonin. Serotonin helps regulate mood and appetite, while melatonin directly controls your sleep-wake cycle. Foods naturally high in tryptophan include turkey, chicken, fish, eggs, cheese, milk, pumpkin seeds, sunflower seeds, and peanuts. A small serving of any of these an hour or so before bed gives your body the raw material it needs to ramp up melatonin production on its own schedule.
Pairing a tryptophan source with a small amount of carbohydrate helps the process along. A handful of whole grain crackers with cheese, a small bowl of oatmeal with pumpkin seeds, or a glass of warm milk with a banana are all practical combinations. The carbohydrate triggers a mild insulin response that clears competing amino acids from the bloodstream, letting more tryptophan reach the brain.
Two Fruits Worth Trying
Kiwifruit has some of the strongest clinical evidence behind it. In a study published in the Asia Pacific Journal of Clinical Nutrition, adults who ate two kiwis one hour before bed every night for four weeks fell asleep 35% faster, cutting their average time to fall asleep from about 34 minutes to 20 minutes. Their total sleep time increased by nearly an hour, from roughly 354 minutes to 395 minutes per night. Sleep efficiency, the percentage of time in bed actually spent sleeping, rose from 87% to 91%. Objective measurements from wrist-worn activity trackers confirmed the improvements.
Tart cherry juice is another option. Tart cherries contain small amounts of natural melatonin (about 0.135 micrograms per 100 grams of cherries). Up to 16 ounces per day has been used safely in studies for periods of two weeks. The melatonin content is modest compared to supplements, but the juice also contains compounds that may slow melatonin breakdown in the body, extending its effects.
Why Magnesium Matters at Night
Magnesium activates the calming branch of your nervous system by supporting the same chemical signaling pathway that many prescription sleep aids target. A double-blind, placebo-controlled study found that increasing magnesium intake helped treat insomnia and other sleep-related problems. You don’t need a supplement to get enough. Spinach, kale, broccoli, almonds, walnuts, sesame seeds, sunflower seeds, oatmeal, and milk (particularly whole or 2%) are all solid sources. A small bowl of oatmeal topped with almonds, or a handful of mixed nuts, delivers a meaningful dose of magnesium alongside other sleep-friendly nutrients.
How Much and When to Eat
The ideal bedtime snack is around 150 calories. That’s roughly a banana with a tablespoon of peanut butter, a small bowl of cereal with milk, or a few crackers with cheese. Enough to prevent the kind of hunger that keeps you awake, but not so much that your digestive system is working hard while you’re trying to wind down.
If you’re eating a larger meal, finish it at least three hours before you plan to lie down. There’s a straightforward physical reason for this. When you eat a full meal, your stomach produces a significant amount of acid to break down the food. Lying down removes gravity from the equation, and that acid can travel up into your esophagus, causing heartburn and reflux. Staying upright for three hours gives your body time to move food through the initial stages of digestion. A small snack closer to bedtime is fine because it doesn’t trigger the same volume of acid production.
What to Avoid Before Bed
Spicy food is one of the worst choices for a nighttime snack. Capsaicin, the compound that makes peppers hot, tricks your nervous system into thinking you’re overheating. Your brain responds by dilating blood vessels and raising your core body temperature, then triggering sweating to cool you back down. This thermoregulation roller coaster is the opposite of what your body needs at bedtime, since falling asleep requires your core temperature to drop.
Caffeine is trickier than most people realize because the timing depends on the dose. A 2024 randomized clinical trial published in the journal SLEEP found that 100 mg of caffeine (roughly one small cup of coffee) can be consumed up to four hours before bed without significantly disrupting sleep. But 400 mg, the amount in a large coffee or two standard cups, should be avoided within 12 hours of bedtime. Even a morning mega-dose was shown to be detrimental to sleep that night. If you’re a one-cup person, an afternoon cutoff is fine. If you’re drinking multiple cups or energy drinks, you need to stop much earlier than you probably think.
High-fat and fried foods take longer to digest and can cause discomfort when you lie down. Sugary snacks and desserts can cause a blood sugar spike followed by a drop that may wake you in the middle of the night. Chocolate is a double offender, combining sugar with caffeine.
Managing Fluids in the Evening
Waking up to use the bathroom is one of the most common sleep disruptors. If this happens to you regularly, try cutting off liquid intake two to three hours before bed. This doesn’t mean you need to dehydrate yourself. Just front-load your water intake earlier in the day and take only small sips in the evening if you’re thirsty. If you’re choosing a bedtime snack that involves liquid, like warm milk or tart cherry juice, keep the portion small and factor it into your overall evening fluid intake.

