Melatonin, magnesium and selenium have all been linked with getting a better night’s sleep – and nuts contain all three!

Melatonin: Nuts are a top source

review paper, which looked at the melatonin content of a large number of foods, found nuts have the highest melatonin content of all plant foods(1). And pistachios, in particular, contain high levels of melatonin.

Melatonin is a hormone produced by the brain, mostly at night(2).

Studies consistently show that it helps people sleep longer and fall asleep more quickly(3). Melatonin has also been linked with improving sleeping disorders like insomnia, which affects one in three people(2,4).

The body’s melatonin levels increase after eating foods that contain melatonin.

What other foods contain melatonin?

Aside from nuts as the top plant-based source, some cereals, legumes and seeds are also rich in melatonin. And salmon and eggs contain high amounts of melatonin amongst animal sources(1).

Environmental factors, such as temperature and sunlight exposure, can impact the melatonin content of foods, meaning levels can vary quite a bit(1).

Pistachios and melatonin

Researchers from Louisiana State University, in partnership with American Pistachio Growers, analysed the melatonin content of pistachios. They found that pistachios have around 660 nanograms (ng) of melatonin per gram(5). And roasting pistachios didn’t impact their melatonin content.

This is much higher than most fruits, vegetables, cereals, legumes and seeds (1). For example, the melatonin content of oats has been reported at around 90ng/g and tomatoes up to 24ng/g, depending on the type.

Minerals for sleep

Nuts are among the best food sources of selenium and magnesium. Researchers have begun exploring links between these minerals and a good night’s sleep(6-8).

large observational study found people who only slept 5 – 6 hours a day (termed ‘short sleepers’) had lower intakes of selenium, compared with people who slept 7-8 hours a day (normal sleepers)(6).

Brazil nuts are one of the highest natural sources of selenium. Just three Brazil nuts a day provides 100% of the recommended dietary intake selenium.

Magnesium has been shown to help improve insomnia in clinical trials, especially among older people (nearly 50% of older people suffer from insomnia)(7-8). Magnesium is found in a variety of foods, but the best sources include nuts and seeds, and green leafy vegetables.

Sleep quality and the Mediterranean diet

Often considered one of the healthiest dietary patterns in the world, the popular Mediterranean diet has been shown to reduce the risk of chronic disease and overall mortality.

But it may come as a surprise to learn that it’s also been linked with better sleep quality(9)!

Plant foods (like nuts, seeds, legumes, whole grains, fruit, vegetables, herbs and olive oil) take centre stage in the Mediterranean eating pattern. The healthy unsaturated fats and phytochemicals these foods offer have a beneficial effect on inflammation, which may negatively impact sleep duration and quality.

The bottom line: Healthy diet, healthy sleep

Many factors (some of which are really complex!) affect the quality of our sleep.

Is there one best food for a good night’s sleep? Probably not. Instead, a healthy, balanced diet will offer the range of nutrients needed to support sleep.

Enjoying a healthy handful (30g) of nuts each day can boost your intake of melatonin and a host of nutrients, including selenium and magnesium – which could just up your odds of getting a better night’s sleep!



  1. Meng X., et al. Dietary sources and bioactivities of melatonin. Nutrients, 2017. 9(4): 367.
  2. Sleep Health Foundation. Available at:
  3. Costello RB., et al. The effectiveness of melatonin for promoting healthy sleep: A rapid evidence assessment of the literature. Nutr J, 2014. 13: 106.
  4. Ferracioli-Oda E, Qawasmi A, Bloch MH. Meta-analysis: Melatonin for the treatment of primary sleep disorders. PLoS ONE, 2013. 8(5): e63773.
  5. Lasso J. and Yeboah-Awudzi M. Melatonin content of raw and roasted pistachios. Louisiana State University.
  6. Grandner MA,. et al. Dietary nutrients associated with short and long sleep duration. Data from a nationally representative sample. Appetite, 2013. 64: 71-80.
  7. Djokic G,. et al. The effects of magnesium – melatonin – Vit B complex supplementation in treatment of insomnia. Open Access Maced J Med Sci, 2019. 7(18): 3101-05.
  8. Abbasi B, et al. The effect of magnesium supplementation on primary insomnia in elderly: A double-blind placebo-controlled clinical trial. J Res Med Sci, 2012. 17(12): 1161-69.
  9. Muscogiuri G, et al. Sleep quality in obesity: Does adherence to the Mediterranean Diet matter?. Nutrients, 2020. 12(5): 1364.

Source: Nuts for Life